From dd483c33008525130606a2117111ceae7c2c5a08 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Thu, 7 Sep 2023 12:02:32 -0400 Subject: [PATCH] Init Group Mode Str; Tweak Group List Conditions; --- src/dmr_csbk.c | 8 ++++++++ src/dsd_mbe.c | 2 ++ src/edacs-fme.c | 4 ++++ src/nxdn_element.c | 9 +++++++-- src/p25p1_mdpu.c | 3 +++ src/p25p2_vpdu.c | 10 ++++++++++ 6 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/dmr_csbk.c b/src/dmr_csbk.c index 42905d7..6e1309d 100644 --- a/src/dmr_csbk.c +++ b/src/dmr_csbk.c @@ -225,6 +225,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 if ( (time(NULL) - state->last_vc_sync_time > 2) ) { char mode[8]; //allow, block, digital, enc, etc + sprintf (mode, "%s", ""); //if we are using allow/whitelist mode, then write 'B' to mode for block //comparison below will look for an 'A' to write to mode if it is allowed @@ -236,6 +237,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -1035,6 +1037,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 for (j = start; j < end; j++) //go through the channels stored looking for active ones to tune to { char mode[8]; //allow, block, digital, enc, etc + sprintf (mode, "%s", ""); //if we are using allow/whitelist mode, then write 'B' to mode for block //comparison below will look for an 'A' to write to mode if it is allowed @@ -1046,6 +1049,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -1179,6 +1183,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 } char mode[8]; //allow, block, digital, enc, etc + sprintf (mode, "%s", ""); //if we are using allow/whitelist mode, then write 'B' to mode for block //comparison below will look for an 'A' to write to mode if it is allowed @@ -1190,6 +1195,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -1374,6 +1380,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 for (j = 0; j < 6; j++) //go through the channels stored looking for active ones to tune to { char mode[8]; //allow, block, digital, enc, etc + sprintf (mode, "%s", ""); //if we are using allow/whitelist mode, then write 'B' to mode for block //comparison below will look for an 'A' to write to mode if it is allowed @@ -1388,6 +1395,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } diff --git a/src/dsd_mbe.c b/src/dsd_mbe.c index 278176b..c22415b 100644 --- a/src/dsd_mbe.c +++ b/src/dsd_mbe.c @@ -227,6 +227,7 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a //set playback mode for this frame char mode[8]; + sprintf (mode, "%s", ""); //if we are using allow/whitelist mode, then write 'B' to mode for block //comparison below will look for an 'A' to write to mode if it is allowed @@ -242,6 +243,7 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a if (state->group_array[i].groupNumber == groupNumber) { strcpy (mode, state->group_array[i].groupMode); + break; } } diff --git a/src/edacs-fme.c b/src/edacs-fme.c index d1aa138..ab984cd 100644 --- a/src/edacs-fme.c +++ b/src/edacs-fme.c @@ -475,6 +475,7 @@ void edacs(dsd_opts * opts, dsd_state * state) fprintf (stderr, " Group [%05d] Source [%08d] LCN[%02d]", group, source, lcn); char mode[8]; //allow, block, digital enc + sprintf (mode, "%s", ""); //if we are using allow/whitelist mode, then write 'B' to mode for block //comparison below will look for an 'A' to write to mode if it is allowed @@ -486,6 +487,7 @@ void edacs(dsd_opts * opts, dsd_state * state) { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -611,6 +613,7 @@ void edacs(dsd_opts * opts, dsd_state * state) fprintf (stderr, " AFS [0x%03X] [%02d-%03d] LCN [%02d]", afs, a, fs, lcn); char mode[8]; //allow, block, digital enc + sprintf (mode, "%s", ""); //if we are using allow/whitelist mode, then write 'B' to mode for block //comparison below will look for an 'A' to write to mode if it is allowed @@ -622,6 +625,7 @@ void edacs(dsd_opts * opts, dsd_state * state) { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } diff --git a/src/nxdn_element.c b/src/nxdn_element.c index 749993f..dae3f14 100644 --- a/src/nxdn_element.c +++ b/src/nxdn_element.c @@ -539,6 +539,7 @@ void NXDN_decode_VCALL_ASSGN(dsd_opts * opts, dsd_state * state, uint8_t * Messa //run group/source analysis and tune if available/desired //group list mode so we can look and see if we need to block tuning any groups, etc char mode[8]; //allow, block, digital, enc, etc + sprintf (mode, "%s", ""); //if we are using allow/whitelist mode, then write 'B' to mode for block //comparison below will look for an 'A' to write to mode if it is allowed @@ -546,16 +547,18 @@ void NXDN_decode_VCALL_ASSGN(dsd_opts * opts, dsd_state * state, uint8_t * Messa for (int i = 0; i < state->group_tally; i++) { - if (state->group_array[i].groupNumber == DestinationID) //source, or destination? + if (state->group_array[i].groupNumber == DestinationID && DestinationID != 0) //destination, if it isn't 0 { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } //might not be ideal if both source and group/target are both in the array - else if (state->group_array[i].groupNumber == SourceUnitID) //source, or destination? + else if (state->group_array[i].groupNumber == SourceUnitID && DestinationID == 0) //source, if destination is 0 { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -1394,6 +1397,7 @@ void NXDN_decode_scch(dsd_opts * opts, dsd_state * state, uint8_t * Message, uin //run group/tgt analysis and tune if available/desired //group list mode so we can look and see if we need to block tuning any groups, etc char mode[8]; //allow, block, digital, enc, etc + sprintf (mode, "%s", ""); //if we are using allow/whitelist mode, then write 'B' to mode for block //comparison below will look for an 'A' to write to mode if it is allowed @@ -1405,6 +1409,7 @@ void NXDN_decode_scch(dsd_opts * opts, dsd_state * state, uint8_t * Message, uin { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } diff --git a/src/p25p1_mdpu.c b/src/p25p1_mdpu.c index 3397c7a..ea31b5a 100644 --- a/src/p25p1_mdpu.c +++ b/src/p25p1_mdpu.c @@ -163,6 +163,7 @@ void processMPDU(dsd_opts * opts, dsd_state * state) //group list mode so we can look and see if we need to block tuning any groups, etc char mode[8]; //allow, block, digital, enc, etc + sprintf (mode, "%s", ""); //if we are using allow/whitelist mode, then write 'B' to mode for block //comparison below will look for an 'A' to write to mode if it is allowed @@ -322,6 +323,7 @@ void processMPDU(dsd_opts * opts, dsd_state * state) { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -420,6 +422,7 @@ void processMPDU(dsd_opts * opts, dsd_state * state) { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } diff --git a/src/p25p2_vpdu.c b/src/p25p2_vpdu.c index eb43cbc..53d7a04 100644 --- a/src/p25p2_vpdu.c +++ b/src/p25p2_vpdu.c @@ -76,6 +76,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon //group list mode so we can look and see if we need to block tuning any groups, etc char mode[8]; //allow, block, digital, enc, etc + sprintf (mode, "%s", ""); //if we are using allow/whitelist mode, then write 'B' to mode for block //comparison below will look for an 'A' to write to mode if it is allowed @@ -107,6 +108,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -184,6 +186,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -295,6 +298,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -391,6 +395,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -481,6 +486,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -628,6 +634,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -796,6 +803,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -909,6 +917,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } } @@ -1008,6 +1017,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { fprintf (stderr, " [%s]", state->group_array[i].groupName); strcpy (mode, state->group_array[i].groupMode); + break; } }