From 6153f7bc4c7491a7e1edf102db3f8cd96e9c2062 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Thu, 7 Sep 2023 12:04:14 -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 ae12800..7e59705 100644 --- a/src/dmr_csbk.c +++ b/src/dmr_csbk.c @@ -221,6 +221,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 @@ -232,6 +233,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; } } @@ -1027,6 +1029,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 @@ -1038,6 +1041,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; } } @@ -1171,6 +1175,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 @@ -1182,6 +1187,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; } } @@ -1366,6 +1372,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 @@ -1380,6 +1387,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 669be7a..eda34a2 100644 --- a/src/dsd_mbe.c +++ b/src/dsd_mbe.c @@ -216,6 +216,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 @@ -231,6 +232,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 f665cb6..a619374 100644 --- a/src/edacs-fme.c +++ b/src/edacs-fme.c @@ -462,6 +462,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 @@ -473,6 +474,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; } } @@ -597,6 +599,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 @@ -608,6 +611,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 637ea8a..c46b0f0 100644 --- a/src/nxdn_element.c +++ b/src/nxdn_element.c @@ -537,6 +537,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 @@ -544,16 +545,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; } } @@ -1389,6 +1392,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 @@ -1400,6 +1404,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 6ae80d7..d09a919 100644 --- a/src/p25p1_mdpu.c +++ b/src/p25p1_mdpu.c @@ -164,6 +164,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 @@ -320,6 +321,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; } } @@ -417,6 +419,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 1e171d2..31d268d 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 @@ -106,6 +107,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; } } @@ -182,6 +184,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; } } @@ -293,6 +296,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; } } @@ -389,6 +393,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; } } @@ -479,6 +484,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; } } @@ -626,6 +632,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; } } @@ -794,6 +801,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; } } @@ -907,6 +915,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; } } @@ -1005,6 +1014,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; } }