From f799374183ddb1c9f8b989885db6159731a3dd8a Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Sat, 13 Apr 2024 02:55:38 -0400 Subject: [PATCH] EDACS: EA Test Call Continuation (I-CALL zero); Ncurses Display of Test Call; Test Call Type; Notes; --- include/dsd.h | 1 + src/dsd_ncurses.c | 43 ++++++++++++++++++++++++++++++------------- src/edacs-fme.c | 44 ++++++++++++++++++++++++++++++++++++++------ 3 files changed, 69 insertions(+), 19 deletions(-) diff --git a/include/dsd.h b/include/dsd.h index 4a75702..fbe0a0d 100644 --- a/include/dsd.h +++ b/include/dsd.h @@ -770,6 +770,7 @@ typedef struct #define EDACS_IS_INDIVIDUAL 0x10 #define EDACS_IS_ALL_CALL 0x20 #define EDACS_IS_INTERCONNECT 0x40 + #define EDACS_IS_TESTCALL 0x100 //trunking group and lcn freq list long int trunk_lcn_freq[26]; //max number on an EDACS system, should be enough on DMR too hopefully diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index 5258e8b..407d36d 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -3603,7 +3603,8 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) if (print_call != 0) { - if (state->ea_mode == 1) { + if (state->ea_mode == 1) + { // Voice call if ((call_matrix[i][4] & EDACS_IS_VOICE) != 0) { @@ -3619,14 +3620,18 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) // Interconnect call else if ((call_matrix[i][4] & EDACS_IS_INTERCONNECT) != 0) printw (" TGT [ SYSTEM ] SRC [%8lld] Interconnect", call_matrix[i][3] ); + // Test call + else if ((call_matrix[i][4] & EDACS_IS_TESTCALL) != 0) + printw (" TEST CALL"); // Unknown call else printw (" Unknown call type" ); // Call flags - if ((call_matrix[i][4] & EDACS_IS_DIGITAL) == 0) printw (" [Ana]"); - else printw (" [Dig]"); - if ((call_matrix[i][4] & EDACS_IS_EMERGENCY) != 0) printw ("[EM]"); + if ((call_matrix[i][4] & EDACS_IS_TESTCALL) != 0) {} + else if ((call_matrix[i][4] & EDACS_IS_DIGITAL) == 0) printw (" [Ana]"); + else printw (" [Dig]"); + if ((call_matrix[i][4] & EDACS_IS_EMERGENCY) != 0) printw ("[EM]"); } else // Data call @@ -3649,14 +3654,18 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) // Interconnect call else if ((call_matrix[i][4] & EDACS_IS_INTERCONNECT) != 0) printw (" TGT [ SYSTEM ] SRC [%5lld] Interconnect", call_matrix[i][3] ); + // Test call + else if ((call_matrix[i][4] & EDACS_IS_TESTCALL) != 0) + printw (" TEST CALL"); // Unknown call else printw (" Unknown call type" ); // Call flags - if ((call_matrix[i][4] & EDACS_IS_DIGITAL) == 0) printw (" [Ana]"); - else printw (" [Dig]"); - if ((call_matrix[i][4] & EDACS_IS_EMERGENCY) != 0) printw ("[EM]"); + if ((call_matrix[i][4] & EDACS_IS_TESTCALL) != 0) {} + else if ((call_matrix[i][4] & EDACS_IS_DIGITAL) == 0) printw (" [Ana]"); + else printw (" [Dig]"); + if ((call_matrix[i][4] & EDACS_IS_EMERGENCY) != 0) printw ("[EM]"); } else // Data call @@ -3804,14 +3813,18 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) // Interconnect else if ((call_matrix[j][4] & EDACS_IS_INTERCONNECT) != 0) printw ("Target [ SYSTEM ] Source [%8lld] Interconnect", call_matrix[j][3]); + // Test call + else if ((call_matrix[i][4] & EDACS_IS_TESTCALL) != 0) + printw (" TEST CALL"); // Unknown call else printw ("Unknown call type"); // Call flags - if ((call_matrix[j][4] & EDACS_IS_DIGITAL) == 0) printw (" [Ana]"); - else printw (" [Dig]"); - if ((call_matrix[j][4] & EDACS_IS_EMERGENCY) != 0) printw ("[EM]"); + if ((call_matrix[i][4] & EDACS_IS_TESTCALL) != 0) {} + else if ((call_matrix[j][4] & EDACS_IS_DIGITAL) == 0) printw (" [Ana]"); + else printw (" [Dig]"); + if ((call_matrix[j][4] & EDACS_IS_EMERGENCY) != 0) printw ("[EM]"); } else // Data call @@ -3839,14 +3852,18 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) // Interconnect else if ((call_matrix[j][4] & EDACS_IS_INTERCONNECT) != 0) printw ("Target [ SYSTEM ] Source [%5lld] Interconnect", call_matrix[j][3]); + // Test call + else if ((call_matrix[i][4] & EDACS_IS_TESTCALL) != 0) + printw (" TEST CALL"); // Unknown call else printw ("Unknown call type"); // Call flags - if ((call_matrix[j][4] & EDACS_IS_DIGITAL) == 0) printw (" [Ana]"); - else printw (" [Dig]"); - if ((call_matrix[j][4] & EDACS_IS_EMERGENCY) != 0) printw ("[EM]"); + if ((call_matrix[i][4] & EDACS_IS_TESTCALL) != 0) {} + else if ((call_matrix[j][4] & EDACS_IS_DIGITAL) == 0) printw (" [Ana]"); + else printw (" [Dig]"); + if ((call_matrix[j][4] & EDACS_IS_EMERGENCY) != 0) printw ("[EM]"); } else // Data call diff --git a/src/edacs-fme.c b/src/edacs-fme.c index 983fce6..d9700fb 100644 --- a/src/edacs-fme.c +++ b/src/edacs-fme.c @@ -608,11 +608,24 @@ void edacs(dsd_opts * opts, dsd_state * state) { //Test Call (not seen in the wild, see US patent US7546135B2, Figure 2b) + //Finally Captured in the wild, along with the "I-Call" with zero target and zero source if (mt2 == 0x0) { + + // MSG_1 [F802180] MSG_2 [0000000] (MT1: 1F; MT2: 0) Initiate Test Call + int cc_lcn = (msg_1 & 0x3E000) >> 13; //shifted to allow this example to be CC LCN 1, as was reported at the time of capture + int wc_lcn = (msg_1 & 0xF80) >> 7; + fprintf (stderr, "%s", KYEL); - fprintf (stderr, " Initiate Test Call"); + fprintf (stderr, " Initiate Test Call :: CC LCN: %02d; WC LCN: %02d;", cc_lcn, wc_lcn); fprintf (stderr, "%s", KNRM); + + state->edacs_vc_lcn = wc_lcn; + //assign bogus values so that this will show up in ncurses terminal + //and overwrite current values in the matrix + state->lasttg = 999999999; + state->lastsrc = 999999999; + state->edacs_vc_call_type = 0x101; //manually set to 0x101 to trigger voice call in ncurses, but no other flags } //Adjacent Sites else if (mt2 == 0x1) @@ -996,12 +1009,31 @@ void edacs(dsd_opts * opts, dsd_state * state) if (is_digital == 1) state->edacs_vc_call_type |= EDACS_IS_DIGITAL; fprintf (stderr, "%s", KCYN); - if (is_digital == 0) fprintf (stderr, " Analog I-Call"); - else fprintf (stderr, " Digital I-Call"); - if (is_update == 0) fprintf (stderr, " Assignment"); - else fprintf (stderr, " Update"); + if (target == 0 && source == 0) + { + //this seems to be the continuation of the Initiate Test Call Command + //normally, this appears as an "Analog I-Call", but with 0 tg and src, + //its possible that those values could still be present, and that all + //"Analog I-Call" is meant to be the test call update? + fprintf (stderr, " Test Call Update :: LCN: %02d;", lcn); + state->edacs_vc_lcn = lcn; + //assign bogus values so that this will show up in ncurses terminal + //and overwrite current values in the matrix + state->lasttg = 999999999; + state->lastsrc = 999999999; + state->edacs_vc_call_type = 0x101; //manually set to 0x101 to trigger voice call in ncurses, but no other flags + lcn = 0; //set to zero here, because this is not an actual call, so don't tune to it + } + else + { + if (is_digital == 0) fprintf (stderr, " Analog I-Call"); + else fprintf (stderr, " Digital I-Call"); + if (is_update == 0) fprintf (stderr, " Assignment"); + else fprintf (stderr, " Update"); + + fprintf (stderr, " :: Target [%08d] Source [%08d] LCN [%02d]%s", target, source, lcn, get_lcn_status_string(lcn)); + } - fprintf (stderr, " :: Target [%08d] Source [%08d] LCN [%02d]%s", target, source, lcn, get_lcn_status_string(lcn)); fprintf (stderr, "%s", KNRM); char mode[8]; //allow, block, digital enc