From f85304471ffe8bfc5cec590aef6efacb686c6501 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Sun, 11 May 2025 12:08:39 -0400 Subject: [PATCH] Event History Setup: #287 P25p2: Misc Tweaks for Harris Things; Misc Event History P2 Tweaks; --- src/dsd_alias.c | 6 ++++-- src/dsd_gps.c | 4 ++-- src/dsd_main.c | 4 ++-- src/p25p2_vpdu.c | 9 +++++++++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/dsd_alias.c b/src/dsd_alias.c index c69f899..a054f45 100644 --- a/src/dsd_alias.c +++ b/src/dsd_alias.c @@ -506,7 +506,9 @@ void l3h_embedded_alias_decode (dsd_opts * opts, dsd_state * state, uint8_t slot if (slot == 1 && state->lasttgR != 0) ttg = state->lasttgR; int8_t ptr = 0; - fprintf (stderr, " TG: %d; SRC: %d; Talker Alias: ", ttg, tsrc); + if (tsrc != 0) + fprintf (stderr, " TG: %d; SRC: %d; Talker Alias: ", ttg, tsrc); + else fprintf (stderr, " TG: UNK; SRC: UNK; Talker Alias: "); for (int8_t i = 4; i <= len; i++) { if ( (input[i] > 0x19) && (input[i] < 0x7F) ) @@ -526,7 +528,7 @@ void l3h_embedded_alias_decode (dsd_opts * opts, dsd_state * state, uint8_t slot //assign completed talker to a more useful string instead snprintf (str, ptr+1, "%s", ttemp); - if (state->event_history_s[slot].Event_History_Items[0].source_id == tsrc) + if (state->event_history_s[slot].Event_History_Items[0].source_id == tsrc && tsrc != 0) sprintf (state->event_history_s[slot].Event_History_Items[0].alias, "%s", str); //The Duke Energy system may relay two src values, may be a good idea to pick one and stick with it diff --git a/src/dsd_gps.c b/src/dsd_gps.c index e82b6cf..f0067cc 100644 --- a/src/dsd_gps.c +++ b/src/dsd_gps.c @@ -381,10 +381,10 @@ void nmea_harris (dsd_opts * opts, dsd_state * state, uint8_t * input, uint32_t else fprintf (stderr, " Last Fix;"); //save to ncurses string - sprintf (state->dmr_embedded_gps[slot], "GPS: (%f%s, %f%s)", latitude, deg_glyph, longitude, deg_glyph); + sprintf (state->dmr_embedded_gps[slot], "(%f%s, %f%s)", latitude, deg_glyph, longitude, deg_glyph); //save to event history string - if (state->event_history_s[slot].Event_History_Items[0].source_id == src) + if (state->event_history_s[slot].Event_History_Items[0].source_id == src && src != 0) sprintf (state->event_history_s[slot].Event_History_Items[0].gps_s, "%s", state->dmr_embedded_gps[slot]); //save to LRRP report for mapping/logging diff --git a/src/dsd_main.c b/src/dsd_main.c index 03104f3..d0ff152 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -1634,11 +1634,11 @@ } //push a DSD-FME started event so users can see what this section does, and also gives users an idea of when context started - state->event_history_s[0].Event_History_Items[0].color_pair = 6; + state->event_history_s[0].Event_History_Items[0].color_pair = 4; watchdog_event_datacall (opts, state, 0, 0, "Any decoded voice calls or data calls display here;", 0); push_event_history (&state->event_history_s[0]); init_event_history (&state->event_history_s[0], 0, 1); - state->event_history_s[0].Event_History_Items[0].color_pair = 6; + state->event_history_s[0].Event_History_Items[0].color_pair = 4; watchdog_event_datacall (opts, state, 0, 0, "DSD-FME Started and Event History Initialized;", 0); push_event_history (&state->event_history_s[0]); init_event_history (&state->event_history_s[0], 0, 1); diff --git a/src/p25p2_vpdu.c b/src/p25p2_vpdu.c index a042d1c..0ffce35 100644 --- a/src/p25p2_vpdu.c +++ b/src/p25p2_vpdu.c @@ -1760,6 +1760,9 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon fprintf (stderr, "%02llX", MAC[i+len_a]); } + //assign here so we don't read an extra opcode value, like MAC Release on FL-DCC-1 (0x31 opcode) + len_b = len; + } //This is now confirmed to have the Harris Talker GPS, but the structure is unusual compared to other MFID messages, @@ -2067,6 +2070,12 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon fprintf (stderr, "MFID90 Group Regroup Voice"); state->gi[slot] = 0; + + uint32_t mfid90_wacn = (MAC[10+len_a] << 16) | (MAC[11+len_a] << 8) | (MAC[12+len_a] & 0xF0); + mfid90_wacn >>= 4; + uint16_t mfid90_sys = ((MAC[12+len_a] << 16) & 0x0F00)| (MAC[12+len_a] << 8); + fprintf (stderr, " EXT - FQSUID: %05X:%03X.%d", mfid90_wacn, mfid90_sys, src); + if (slot == 0) { state->lasttg = gr;