diff --git a/src/dsd_frame_sync.c b/src/dsd_frame_sync.c index a6a3c07..272cc17 100644 --- a/src/dsd_frame_sync.c +++ b/src/dsd_frame_sync.c @@ -296,7 +296,7 @@ getFrameSync (dsd_opts * opts, dsd_state * state) } - if (1 == 1) + if (1 == 1) { if (symbol > state->center) { @@ -631,10 +631,17 @@ getFrameSync (dsd_opts * opts, dsd_state * state) { printFrameSync (opts, state, "+P25p2 SISCH", synctest_pos + 1, modulation); } - if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0) + if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0 && + state->p2_wacn != 0xFFFFF && state->p2_cc != 0xFFF && state->p2_sysid != 0xFFF) { fprintf (stderr, " WACN [%05llX] SYS [%03llX] NAC [%03llX] ", state->p2_wacn, state->p2_sysid, state->p2_cc); } + else if (state->p2_wacn == 0xFFFFF || state->p2_cc == 0xFFF || state->p2_sysid == 0xFFF) + { + fprintf (stderr, "%s", KRED); + fprintf (stderr, " P2 Invalid Parameters "); + fprintf (stderr, "%s", KNRM); + } else { fprintf (stderr, "%s", KRED); @@ -665,11 +672,16 @@ getFrameSync (dsd_opts * opts, dsd_state * state) { printFrameSync (opts, state, "-P25p2 SISCH", synctest_pos + 1, modulation); } - if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0) + if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0 && + state->p2_wacn != 0xFFFFF && state->p2_cc != 0xFFF && state->p2_sysid != 0xFFF) { - //fprintf (stderr, "%s", KCYN); fprintf (stderr, " WACN [%05llX] SYS [%03llX] NAC [%03llX] ", state->p2_wacn, state->p2_sysid, state->p2_cc); - //fprintf (stderr, "%s", KNRM); + } + else if (state->p2_wacn == 0xFFFFF || state->p2_cc == 0xFFF || state->p2_sysid == 0xFFF) + { + fprintf (stderr, "%s", KRED); + fprintf (stderr, " P2 Invalid Parameters "); + fprintf (stderr, "%s", KNRM); } else { diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index de80ab8..3c5adc0 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -1989,6 +1989,12 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) printw (" Phase 2 Missing Parameters "); attron(COLOR_PAIR(3)); } + if (state->p2_wacn == 0xFFFFF || state->p2_sysid == 0xFFF || state->p2_cc == 0xFFF) + { + attron(COLOR_PAIR(2)); + printw (" Phase 2 Invalid Parameters "); + attron(COLOR_PAIR(3)); + } } printw ("\n"); diff --git a/src/p25_p2.c b/src/p25_p2.c index 382aae6..5347e58 100644 --- a/src/p25_p2.c +++ b/src/p25_p2.c @@ -1464,7 +1464,8 @@ void process_P2_DUID (dsd_opts * opts, dsd_state * state) if (duid_decoded == 0) { fprintf (stderr, " 4V %d", state->fourv_counter[state->currentslot]+1); - if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0) + if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0 && + state->p2_wacn != 0xFFFFF && state->p2_cc != 0xFFF && state->p2_sysid != 0xFFF) { process_4V (opts, state); } @@ -1472,14 +1473,16 @@ void process_P2_DUID (dsd_opts * opts, dsd_state * state) else if (duid_decoded == 6) { fprintf (stderr, " 2V"); - if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0) + if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0 && + state->p2_wacn != 0xFFFFF && state->p2_cc != 0xFFF && state->p2_sysid != 0xFFF) { process_2V (opts, state); } } else if (duid_decoded == 3) { - if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0) + if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0 && + state->p2_wacn != 0xFFFFF && state->p2_cc != 0xFFF && state->p2_sysid != 0xFFF) { process_SACCHs(opts, state); } @@ -1494,7 +1497,8 @@ void process_P2_DUID (dsd_opts * opts, dsd_state * state) } else if (duid_decoded == 9) { - if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0) + if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0 && + state->p2_wacn != 0xFFFFF && state->p2_cc != 0xFFF && state->p2_sysid != 0xFFF) { process_FACCHs(opts, state); } @@ -1512,7 +1516,8 @@ void process_P2_DUID (dsd_opts * opts, dsd_state * state) fprintf (stderr, " LCCH Sc"); //w/ scrambling // if (state->currentslot == 0) state->dmrburstL = 31; // else state->dmrburstR = 31; - if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0) + if (state->p2_wacn != 0 && state->p2_cc != 0 && state->p2_sysid != 0 && + state->p2_wacn != 0xFFFFF && state->p2_cc != 0xFFF && state->p2_sysid != 0xFFF) { state->p2_is_lcch = 1; process_SACCHs(opts, state);