1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

setmod2: add symbol rate parameter, add verbose messages

This commit is contained in:
Marcin Kaluza 2017-10-24 12:08:48 +02:00
parent fefdde5e00
commit 5b875366d9

View File

@ -35,19 +35,32 @@ static int set_property(int fd, uint32_t cmd, uint32_t data)
int main(int argc, char ** argv) int main(int argc, char ** argv)
{ {
if (argc < 3) { if (argc < 3) {
fprintf(stderr, "Usage: %s /dev/dvb/adapterX/modY freq[MHz] bitrate[kbit/s]\n", argv[0]); fprintf(stderr, "Usage: %s /dev/dvb/adapterX/modY freq[MHz] bitrate[kbit/s] [symbolrate[ksyms/s]]\n", argv[0]);
exit(1); exit(1);
} }
int fd; int fd;
unsigned int freq = atoi(argv[2])*1000000;
unsigned int bitrate = atoi(argv[3])*1000;
unsigned int symbol_rate = 6900000;
struct dvb_mod_params mp; struct dvb_mod_params mp;
struct dvb_mod_channel_params mc; struct dvb_mod_channel_params mc;
if (argc == 4) symbol_rate = atoi(argv[3]);
if (symbol_rate <= 7100) symbol_rate *= 1000;
fd = open(argv[1], O_RDONLY); fd = open(argv[1], O_RDONLY);
set_property(fd, MODULATOR_MODULATION, QAM_256); set_property(fd, MODULATOR_MODULATION, QAM_256);
set_property(fd, MODULATOR_SYMBOL_RATE, 6900000);
set_property(fd, MODULATOR_FREQUENCY, atoi(argv[2])*1000000); fprintf(stderr, "Symbol rate: %u\n", symbol_rate);
set_property(fd, MODULATOR_INPUT_BITRATE, atoi(argv[3])*1000); set_property(fd, MODULATOR_SYMBOL_RATE, symbol_rate);
fprintf(stderr, "Frequency: %u\n", freq);
set_property(fd, MODULATOR_FREQUENCY, freq);
fprintf(stderr, "Bitrate: %u\n", bitrate);
set_property(fd, MODULATOR_INPUT_BITRATE, bitrate);
close(fd); close(fd);
} }