Event History Bug Fix; #287

Initialize src_str and tgt_str properly each pass of watchdog_event_current so that wav files do not have a blank string instead of the correct numerical number for src and tgt when applicable; Fix tgt and src string to correct position;

Add dPMR string value to src and tgt for wav files + bugfix; Add Enc if applicable to event history for it;

Misc Nits;
This commit is contained in:
lwvmobile
2025-04-27 21:42:09 -04:00
parent daf014df6a
commit 76905b095b
3 changed files with 11 additions and 4 deletions

View File

@@ -376,7 +376,7 @@ void processdPMRvoice (dsd_opts * opts, dsd_state * state)
fprintf (stderr, "%s", KNRM);
//check other as well before assigning
if(state->dPMRVoiceFS2Frame.CallingIDOk) sprintf (state->dpmr_target_id, "%s", CalledID);
if(state->dPMRVoiceFS2Frame.CalledIDOk) sprintf (state->dpmr_target_id, "%s", CalledID);
}
else

View File

@@ -515,7 +515,7 @@ SNDFILE * close_and_rename_wav_file(SNDFILE * wav_file, char * wav_out_filename,
//check for String based TGT and SRC values (M17, YSF, DSTAR)
if (is_string == 1)
sprintf (new_filename, "%s/%s_%s_%05d_%s_TGT_%s_SRC_%s.wav", dir, datestr, timestr, random_number, sys_str, src_str, tgt_str);
sprintf (new_filename, "%s/%s_%s_%05d_%s_TGT_%s_SRC_%s.wav", dir, datestr, timestr, random_number, sys_str, tgt_str, src_str);
else //is a numerical value
sprintf (new_filename, "%s/%s_%s_%05d_%s_TGT_%d_SRC_%d.wav", dir, datestr, timestr, random_number, sys_str, target_id, source_id);

View File

@@ -4924,7 +4924,9 @@ void watchdog_event_current (dsd_opts * opts, dsd_state * state, uint8_t slot)
uint32_t source_id = 0;
uint32_t target_id = 0;
char src_str[200]; memset (src_str, 0, sizeof(src_str));
sprintf (src_str, "%s", "BUMBLEBEETUNA");
char tgt_str[200]; memset (tgt_str, 0, sizeof(tgt_str));
sprintf (tgt_str, "%s", "BUMBLEBEETUNA");
uint16_t svc_opts = 0;
uint8_t subtype = 0;
uint8_t mfid = 0;
@@ -5138,6 +5140,9 @@ void watchdog_event_current (dsd_opts * opts, dsd_state * state, uint8_t slot)
source_id = 0;
sprintf (sysid_string, "DPMR_CC_%d", state->dpmr_color_code);
sprintf (src_str, "%s", state->dpmr_caller_id);
sprintf (tgt_str, "%s", state->dpmr_target_id);
}
if (state->lastsynctype == 14 || state->lastsynctype == 15 || state->lastsynctype == 37 || state->lastsynctype == 38) //EDACS Calls
@@ -5247,7 +5252,9 @@ void watchdog_event_current (dsd_opts * opts, dsd_state * state, uint8_t slot)
else if (state->lastsynctype == 20 || state->lastsynctype == 24 || state->lastsynctype == 21 || state->lastsynctype == 25 || state->lastsynctype == 22 || state->lastsynctype == 26 || state->lastsynctype == 23 || state->lastsynctype == 27) //dPMR
{
//TODO: See if we can add some decoded data as well in the future to an event string
sprintf (event_string, "%s %s %s TGT: %s SRC: %s ", datestr, timestr, sys_string, state->dpmr_target_id, state->dpmr_caller_id);
sprintf (event_string, "%s %s %s CC: %02d; TGT: %s; SRC: %s; ", datestr, timestr, sys_string, state->dpmr_color_code, state->dpmr_target_id, state->dpmr_caller_id);
if (state->dPMRVoiceFS2Frame.Version[0] == 3)
strcat (event_string, "Scrambler Enc; ");
}
//TODO: Find out why EDACS is also placing items into Slot 2 Event History with valid src, but invalid tg (not a problem, just odd)
else if (state->lastsynctype == 14 || state->lastsynctype == 15 || state->lastsynctype == 37 || state->lastsynctype == 38) //EDACS Calls
@@ -5316,7 +5323,7 @@ void watchdog_event_current (dsd_opts * opts, dsd_state * state, uint8_t slot)
else if (state->lastsynctype == 0 || state->lastsynctype == 1 || state->lastsynctype == 35 || state->lastsynctype == 36)
{
if (sys_id1)
sprintf (event_string, "%s %s %s TGT: %08d; SRC: %08d; NAC: %03X; SYS: %05X:%03X:%d.%d; ", datestr, timestr, sys_string, target_id, source_id, sys_id3, sys_id1, sys_id2, sys_id4, sys_id5);
sprintf (event_string, "%s %s %s TGT: %08d; SRC: %08d; NAC: %03X; NET_STS: %05X:%03X:%d.%d; ", datestr, timestr, sys_string, target_id, source_id, sys_id3, sys_id1, sys_id2, sys_id4, sys_id5);
else
sprintf (event_string, "%s %s %s TGT: %08d; SRC: %08d; NAC: %03X; ", datestr, timestr, sys_string, target_id, source_id, sys_id3);
if (alg_id != 0 && alg_id != 0x80)