diff --git a/include/dsd.h b/include/dsd.h index 2970c32..46de6a2 100644 --- a/include/dsd.h +++ b/include/dsd.h @@ -323,6 +323,8 @@ typedef struct int p25_is_tuned; //set to 1 if currently on VC, set back to 0 if on CC int trunk_hangtime; //hangtime in seconds before tuning back to CC + int scanner_mode; //experimental -- use the channel map as a conventional scanner, quicker tuning, but no CC + //csv import filenames char group_in_file[1024]; char lcn_in_file[1024]; diff --git a/src/dsd_main.c b/src/dsd_main.c index f8b93bb..7f1129e 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -77,6 +77,36 @@ void noCarrier (dsd_opts * opts, dsd_state * state) { + //experimental conventional frequency scanner mode + if (opts->scanner_mode == 1) + { + + if (state->lcn_freq_roll >= state->lcn_freq_count) + { + state->lcn_freq_roll = 0; //reset to zero + } + //check that we have a non zero value first, then tune next frequency + if (state->trunk_lcn_freq[state->lcn_freq_roll] != 0) + { + //rigctl + if (opts->use_rigctl == 1) + { + if (opts->setmod_bw != 0 ) SetModulation(opts->rigctl_sockfd, opts->setmod_bw); + SetFreq(opts->rigctl_sockfd, state->trunk_lcn_freq[state->lcn_freq_roll]); + } + //rtludp + if (opts->audio_in_type == 3) + { + rtl_udp_tune (opts, state, state->trunk_lcn_freq[state->lcn_freq_roll]); + } + + if (state->lastsynctype != -1) fprintf (stderr, "Resume Scanning Mode\n"); + + } + state->lcn_freq_roll++; + } + //end experimental conventional frequency scanner mode + //tune back to last known CC when using trunking after x second hangtime if (opts->p25_trunk == 1 && opts->p25_is_tuned == 1 && ( (time(NULL) - state->last_cc_sync_time) > opts->trunk_hangtime) ) { @@ -502,6 +532,8 @@ initOpts (dsd_opts * opts) opts->p25_is_tuned = 0; //set to 1 if currently on VC, set back to 0 on carrier drop opts->trunk_hangtime = 1; //1 second hangtime by default before tuning back to CC + opts->scanner_mode = 0; //0 disabled, 1 is enabled + //reverse mute opts->reverse_mute = 0; @@ -968,6 +1000,8 @@ usage () printf (" Use this feature to allow MAC_SIGNAL even if CRC errors.\n"); printf (" -F Relax DMR RAS/CRC CSBK/DATA Pass/Fail\n"); printf (" Enabling on some systems could lead to bad voice/data decoding if bad or marginal signal\n"); + printf (" -F Relax NXDN SACCH/FACCH/CAC/F2U CRC Pass/Fail\n"); + printf (" Not recommended on NXDN, but can be bypassed if desired.\n"); printf ("\n"); printf (" -K Manually Enter Basic Privacy Key (Decimal Value of Key Number)\n"); printf ("\n"); @@ -990,6 +1024,9 @@ usage () printf (" -G Import Group List Allow/Block and Label from csv file.\n"); printf (" (See group.csv for example)\n"); printf (" -T Enable Trunking Features (NXDN/P25/EDACS/DMR) with RIGCTL/TCP or RTL Input\n"); + printf (" -Y Enable Fast Scanning Mode with RIGCTL/TCP or RTL Input (Lower z) \n"); + printf (" Experimental -- Can only scan for sync with enabled decoders, don't mix NXDN and DMR/P25!\n"); + printf (" This is not a Trunking Feature, just scans through conventional frequencies fast!\n"); printf (" -W Use Imported Group List as a Trunking Allow/White List -- Only Tune with Mode A\n"); printf (" -p Disable Tune to Private Calls (DMR TIII and P25)\n"); printf (" -E Disable Tune to Group Calls (DMR TIII, Con+, Cap+ and P25)\n"); @@ -1198,7 +1235,7 @@ main (int argc, char **argv) exitflag = 0; - while ((c = getopt (argc, argv, "haepPqs:t:v:z:i:o:d:c:g:nw:B:C:R:f:m:u:x:A:S:M:G:D:L:VU:Y:K:H:X:NQ:WrlZTF01:2:345:6:7:89:Ek:")) != -1) + while ((c = getopt (argc, argv, "haepPqs:t:v:zi:o:d:c:g:nw:B:C:R:f:m:u:x:A:S:M:G:D:L:VU:YK:H:X:NQ:WrlZTF01:2:345:6:7:89:Ek:")) != -1) { opterr = 0; switch (c) @@ -1210,10 +1247,15 @@ main (int argc, char **argv) opts.call_alert = 1; break; - //Free'd up switches include Y,z + //Free'd up switches include z //make sure to put a colon : after each if they need an argument //or remove colon if no argument required + case 'Y': //conventional scanner mode + opts.scanner_mode = 1; //enable scanner + opts.p25_trunk = 0; //turn off trunking mode if user enabled it + break; + case 'k': //NXDN multi-key loader strncpy(opts.key_in_file, optarg, 1023); opts.key_in_file[1023] = '\0'; @@ -1293,6 +1335,7 @@ main (int argc, char **argv) case 'T': //new letter assignment for trunking, flow down to allow temp numbers case '3': opts.p25_trunk = 1; + opts.scanner_mode = 0; //turn off scanner mode if user enabled it break; case 'U': //New letter assignment for RIGCTL TCP port, flow down to allow temp numbers @@ -1442,6 +1485,7 @@ main (int argc, char **argv) fprintf (stderr, "%s", KYEL); fprintf (stderr, "Relax P25 Phase 2 MAC_SIGNAL CRC Pass/Fail\n"); fprintf (stderr, "Relax DMR RAS/CRC CSBK/DATA Pass/Fail\n"); + fprintf (stderr, "Relax NXDN SACCH/FACCH/CAC/F2U CRC Pass/Fail\n"); fprintf (stderr, "%s", KNRM); break; diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index 59272ee..e680f2f 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -2158,6 +2158,12 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) printw ("| Reverse Mute - Muting Unencrypted Voice\n"); } if (opts->aggressive_framesync == 0) printw ("| Selective CRC ERR Bypass Enabled (RAS) \n"); + if (state->M == 1) printw ("| Forcing Key Priority -- Key: %lld \n", state->R); + if (opts->scanner_mode == 1) + { + printw ("| Fast Scan Mode Enabled "); + printw (" - Frequency: [%.06lf] Mhz \n", (double)state->trunk_lcn_freq[state->lcn_freq_roll]/1000000); + } printw ("------------------------------------------------------------------------------\n"); attroff(COLOR_PAIR(4)); @@ -2247,7 +2253,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) } printw ("| "); - printw ("NXDN - RAN: [%2d] ", rn); + printw ("NXDN - RAN: [%02d] ", rn); if (state->nxdn_location_site_code != 0) { printw ("Cat [%s] ", state->nxdn_location_category); @@ -2257,8 +2263,8 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) printw ("\n"); printw ("| "); - printw ("TGT: [%4d] ", tgn); - printw ("SRC: [%4d] ", src); + printw ("TGT: [%05d] ", tgn); + printw ("SRC: [%05d] ", src); if (state->nxdn_alias_block_segment[0][0] > 0) { printw ("ALIAS: ["); @@ -2296,7 +2302,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) } if (state->nxdn_cipher_type == 0x2 && state->carrier == 1) { - printw ("IV: [%016llX]", state->payload_miN); + printw ("IV: [%016llX] ", state->payload_miN); attron(COLOR_PAIR(2)); printw ("DES-OFB "); attroff(COLOR_PAIR(2)); @@ -2304,7 +2310,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) } if (state->nxdn_cipher_type == 0x3 && state->carrier == 1) { - printw ("IV: [%016llX]", state->payload_miN); + printw ("IV: [%016llX] ", state->payload_miN); attron(COLOR_PAIR(2)); printw ("AES-256 "); attroff(COLOR_PAIR(2)); @@ -2901,9 +2907,9 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) printw ("| %s ", SyncTypes[call_matrix[9-j][0]]); if (lls == 28 || lls == 29) { - printw ("RAN [%2lld] ", call_matrix[9-j][1]); - printw ("TG [%4lld] ", call_matrix[9-j][4]); - printw ("RID [%4lld] ", call_matrix[9-j][2]); + printw ("RAN [%02lld] ", call_matrix[9-j][1]); + printw ("TG [%05lld] ", call_matrix[9-j][4]); + printw ("RID [%05lld] ", call_matrix[9-j][2]); } //dPMR if (lls == 20 || lls == 21 || lls == 22 || lls == 23 ||lls == 24 || lls == 25 || lls == 26 || lls == 27) @@ -2980,10 +2986,18 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) else opts->ncurses_compact = 1; } - if (c == 116) //'t' key, toggle trunking + if (c == 116) //'t' key, toggle trunking mode { if (opts->p25_trunk == 1) opts->p25_trunk = 0; else opts->p25_trunk = 1; + opts->scanner_mode = 0; //turn off scanner mode + } + + if (c == 121) //'y' key, toggle scanner mode + { + if (opts->scanner_mode == 1) opts->scanner_mode = 0; + else opts->scanner_mode = 1; + opts->p25_trunk = 0; //turn off trunking mode } if (c == 97) //'a' key, toggle call alert beep