/* * Copyright © 2008-2010 Stéphane Raimbault * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include #include #include #define G_MSEC_PER_SEC 1000 uint32_t gettime_ms(void) { struct timeval tv; gettimeofday (&tv, NULL); return (uint32_t) tv.tv_sec * 1000 + tv.tv_usec / 1000; } enum { TCP, RTU }; /* Tests based on PI-MBUS-300 documentation */ int main(int argc, char *argv[]) { uint8_t *tab_bit; uint16_t *tab_reg; modbus_t *ctx; int i; int nb_points; double elapsed; uint32_t start; uint32_t end; uint32_t bytes; uint32_t rate; int rc; int n_loop; int use_backend; if (argc > 1) { if (strcmp(argv[1], "tcp") == 0) { use_backend = TCP; n_loop = 100000; } else if (strcmp(argv[1], "rtu") == 0) { use_backend = RTU; n_loop = 100; } else { printf("Usage:\n %s [tcp|rtu] - Modbus client to measure data bandwith\n\n", argv[0]); exit(1); } } else { /* By default */ use_backend = TCP; n_loop = 100000; } if (use_backend == TCP) { ctx = modbus_new_tcp("127.0.0.1", 1502); } else { ctx = modbus_new_rtu("/dev/ttyUSB1", 115200, 'N', 8, 1); modbus_set_slave(ctx, 1); } if (modbus_connect(ctx) == -1) { fprintf(stderr, "Connexion failed: %s\n", modbus_strerror(errno)); modbus_free(ctx); return -1; } /* Allocate and initialize the memory to store the status */ tab_bit = (uint8_t *) malloc(MODBUS_MAX_READ_BITS * sizeof(uint8_t)); memset(tab_bit, 0, MODBUS_MAX_READ_BITS * sizeof(uint8_t)); /* Allocate and initialize the memory to store the registers */ tab_reg = (uint16_t *) malloc(MODBUS_MAX_READ_REGISTERS * sizeof(uint16_t)); memset(tab_reg, 0, MODBUS_MAX_READ_REGISTERS * sizeof(uint16_t)); printf("READ BITS\n\n"); nb_points = MODBUS_MAX_READ_BITS; start = gettime_ms(); for (i=0; i only includes transmitters where there have been changes Link: https://lore.kernel.org/linux-media/20210128234622.75009-1-simon@liddicott.com Signed-off-by: Simon Liddicott <simon@liddicott.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 2021-04-30update Brazilian scan filesMauro Carvalho Chehab2476-12805/+69312 Data updated according with https://portalbsd.com.br/. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 2021-04-30Remove legacy entriesMauro Carvalho Chehab129-24898/+0 There are several entries that used to be at Lyngsat. Several of them were merged with other entries. On others, there's no TV signal anymore. So, drop them. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 2021-04-30Add new satellites from LyngsatMauro Carvalho Chehab75-21/+29721 Those are are new satellite descriptions that didn't use to exist on Lyngsat. Add them. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 2021-04-30Rename a few satellites with two names and update frequenciesMauro Carvalho Chehab2-283/+182 Those two satellites have two names. Use Just one of them. While here, update their frequencies from Lyngsat. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 2021-04-30Update frequencies from LyngsatMauro Carvalho Chehab188-12304/+12666 Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>