|
@@ -78,6 +78,7 @@ static const struct option long_options[] = {
|
78
|
78
|
{ "ecm-report-time", required_argument, NULL, 'H' },
|
79
|
79
|
{ "ecm-irdeto-type", required_argument, NULL, 'G' },
|
80
|
80
|
{ "ecm-no-log", no_argument , NULL, 'K' },
|
|
81
|
+ { "cw-warn-time", required_argument, NULL, 'J' },
|
81
|
82
|
|
82
|
83
|
{ "debug", required_argument, NULL, 'D' },
|
83
|
84
|
{ "help", no_argument, NULL, 'h' },
|
|
@@ -141,6 +142,8 @@ static void show_help(struct ts *ts) {
|
141
|
142
|
printf(" . the reports. Default: %d sec\n", ts->ecm_report_interval);
|
142
|
143
|
printf(" -G --ecm-irdeto-type <int> | Process IRDETO ECMs with type X /0..3/. Default: %d\n", ts->irdeto_ecm);
|
143
|
144
|
printf(" -K --ecm-no-log | Disable ECM and code words logging.\n");
|
|
145
|
+ printf(" -J --cw-warn-time <sec> | Warn if no valid code word has been received.\n");
|
|
146
|
+ printf(" . Set <sec> to 0 to disable. Default: %d sec\n", ts->cw_warn_sec);
|
144
|
147
|
printf("\n");
|
145
|
148
|
printf("Misc options:\n");
|
146
|
149
|
printf(" -D --debug <level> | Message debug level.\n");
|
|
@@ -178,7 +181,7 @@ static int parse_io_param(struct io *io, char *opt, int open_flags, mode_t open_
|
178
|
181
|
|
179
|
182
|
static void parse_options(struct ts *ts, int argc, char **argv) {
|
180
|
183
|
int j, i, ca_err = 0, server_err = 1, input_addr_err = 0, output_addr_err = 0, output_intf_err = 0, ident_err = 0;
|
181
|
|
- while ( (j = getopt_long(argc, argv, "i:d:l:L:I:RzO:o:t:pc:s:U:P:y:eZ:Ef:X:G:KD:h", long_options, NULL)) != -1 ) {
|
|
184
|
+ while ( (j = getopt_long(argc, argv, "i:d:l:L:I:RzO:o:t:pc:s:U:P:y:eZ:Ef:X:G:KJ:D:h", long_options, NULL)) != -1 ) {
|
182
|
185
|
char *p = NULL;
|
183
|
186
|
switch (j) {
|
184
|
187
|
case 'i':
|
|
@@ -301,6 +304,11 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
301
|
304
|
case 'K':
|
302
|
305
|
ts->ecm_cw_log = 0;
|
303
|
306
|
break;
|
|
307
|
+ case 'J':
|
|
308
|
+ ts->cw_warn_sec = strtoul(optarg, NULL, 10);
|
|
309
|
+ if (ts->cw_warn_sec > 86400)
|
|
310
|
+ ts->cw_warn_sec = 86400;
|
|
311
|
+ break;
|
304
|
312
|
|
305
|
313
|
case 'D':
|
306
|
314
|
ts->debug_level = atoi(optarg);
|
|
@@ -391,6 +399,11 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
391
|
399
|
if (!ts->emm_only && ts->ecm_report_interval == 0)
|
392
|
400
|
ts_LOGf("ECM report : disabled\n");
|
393
|
401
|
|
|
402
|
+ if (!ts->emm_only && ts->cw_warn_sec)
|
|
403
|
+ ts_LOGf("CW warning : %d sec\n", ts->cw_warn_sec);
|
|
404
|
+ if (!ts->emm_only && ts->cw_warn_sec)
|
|
405
|
+ ts_LOGf("CW warning : disabled\n");
|
|
406
|
+
|
394
|
407
|
if (!ts->ecm_cw_log)
|
395
|
408
|
ts_LOGf("ECM/CW log : disabled\n");
|
396
|
409
|
|
|
@@ -424,6 +437,11 @@ static void report_ecms(struct ts *ts, time_t now) {
|
424
|
437
|
ts->ecm_processed_count = 0;
|
425
|
438
|
}
|
426
|
439
|
|
|
440
|
+static void report_cw_warn(struct ts *ts, time_t now) {
|
|
441
|
+ ts_LOGf("CW | *** No valid CW was received for %lu seconds!\n", now - ts->cw_last_warn);
|
|
442
|
+ ts->cw_last_warn = now;
|
|
443
|
+}
|
|
444
|
+
|
427
|
445
|
static void do_reports(struct ts *ts) {
|
428
|
446
|
static int first_emm_report = 1;
|
429
|
447
|
static int first_ecm_report = 1;
|
|
@@ -446,6 +464,10 @@ static void do_reports(struct ts *ts) {
|
446
|
464
|
report_ecms(ts, now);
|
447
|
465
|
}
|
448
|
466
|
}
|
|
467
|
+
|
|
468
|
+ if (!ts->emm_only && !ts->key.is_valid_cw) {
|
|
469
|
+ report_cw_warn(ts, now);
|
|
470
|
+ }
|
449
|
471
|
}
|
450
|
472
|
|
451
|
473
|
void signal_quit(int sig) {
|