mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-20 20:55:40 -05:00
Checkdown for Valid P2 Parameters
Checkdown for Valid P2 Parameters --if invalid parameters specified by user for P2 WACN, SYSID, and CC (too large) then treat same as missing parameters and skip processing P2 frames that require scrambling.
This commit is contained in:
@@ -296,7 +296,7 @@ getFrameSync (dsd_opts * opts, dsd_state * state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (1 == 1)
|
if (1 == 1)
|
||||||
{
|
{
|
||||||
if (symbol > state->center)
|
if (symbol > state->center)
|
||||||
{
|
{
|
||||||
@@ -631,10 +631,17 @@ getFrameSync (dsd_opts * opts, dsd_state * state)
|
|||||||
{
|
{
|
||||||
printFrameSync (opts, state, "+P25p2 SISCH", synctest_pos + 1, modulation);
|
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);
|
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
|
else
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s", KRED);
|
fprintf (stderr, "%s", KRED);
|
||||||
@@ -665,11 +672,16 @@ getFrameSync (dsd_opts * opts, dsd_state * state)
|
|||||||
{
|
{
|
||||||
printFrameSync (opts, state, "-P25p2 SISCH", synctest_pos + 1, modulation);
|
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, " 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
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1989,6 +1989,12 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
|
|||||||
printw (" Phase 2 Missing Parameters ");
|
printw (" Phase 2 Missing Parameters ");
|
||||||
attron(COLOR_PAIR(3));
|
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");
|
printw ("\n");
|
||||||
|
|||||||
15
src/p25_p2.c
15
src/p25_p2.c
@@ -1464,7 +1464,8 @@ void process_P2_DUID (dsd_opts * opts, dsd_state * state)
|
|||||||
if (duid_decoded == 0)
|
if (duid_decoded == 0)
|
||||||
{
|
{
|
||||||
fprintf (stderr, " 4V %d", state->fourv_counter[state->currentslot]+1);
|
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);
|
process_4V (opts, state);
|
||||||
}
|
}
|
||||||
@@ -1472,14 +1473,16 @@ void process_P2_DUID (dsd_opts * opts, dsd_state * state)
|
|||||||
else if (duid_decoded == 6)
|
else if (duid_decoded == 6)
|
||||||
{
|
{
|
||||||
fprintf (stderr, " 2V");
|
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);
|
process_2V (opts, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (duid_decoded == 3)
|
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);
|
process_SACCHs(opts, state);
|
||||||
}
|
}
|
||||||
@@ -1494,7 +1497,8 @@ void process_P2_DUID (dsd_opts * opts, dsd_state * state)
|
|||||||
}
|
}
|
||||||
else if (duid_decoded == 9)
|
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);
|
process_FACCHs(opts, state);
|
||||||
}
|
}
|
||||||
@@ -1512,7 +1516,8 @@ void process_P2_DUID (dsd_opts * opts, dsd_state * state)
|
|||||||
fprintf (stderr, " LCCH Sc"); //w/ scrambling
|
fprintf (stderr, " LCCH Sc"); //w/ scrambling
|
||||||
// if (state->currentslot == 0) state->dmrburstL = 31;
|
// if (state->currentslot == 0) state->dmrburstL = 31;
|
||||||
// else state->dmrburstR = 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;
|
state->p2_is_lcch = 1;
|
||||||
process_SACCHs(opts, state);
|
process_SACCHs(opts, state);
|
||||||
|
|||||||
Reference in New Issue
Block a user