From 5dbccaadf6f85bcf18bb173e57de08cf92b9f714 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Tue, 21 May 2024 09:42:46 -0400 Subject: [PATCH] Add Per Call String For NXDN Conventional / Type-D; --- src/dsd_ncurses.c | 9 ++++++++- src/nxdn_element.c | 13 +++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index 073c196..a5442af 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -2148,9 +2148,16 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) //open wav file if enabled and both rd and tg are not 0 if (opts->dmr_stereo_wav == 1 && src != 0 ) //&& tgn != 0, some TG can be 0 on NXDN { + //setup a call string for the per call (group/private and/or emergency) + //No Space Skips / Truncates Needed on NXDN string variant + char cs[200]; memcpy (cs, state->call_string[0], 200*sizeof(char)); + //close old first, assign name based on time and radio, open wav file closeWavOutFileL (opts, state); - sprintf (opts->wav_out_file, "%s/%s %s NXDN - RAN %d - TGT %d - SRC %d.wav", opts->wav_out_dir, datestr, timestr, rn, tgn, src); + + // sprintf (opts->wav_out_file, "%s/%s %s NXDN - RAN %d - DST %d - SRC %d.wav", opts->wav_out_dir, datestr, timestr, rn, tgn, src); //original + sprintf (opts->wav_out_file, "%s/%s %s NXDN - RAN %d - %s - DST %d - SRC %d.wav", opts->wav_out_dir, datestr, timestr, rn, cs, tgn, src); //with call string + openWavOutFileL (opts, state); //testing for now, will want to move to per call later } diff --git a/src/nxdn_element.c b/src/nxdn_element.c index 9d6112e..a542e79 100644 --- a/src/nxdn_element.c +++ b/src/nxdn_element.c @@ -647,6 +647,10 @@ void NXDN_decode_VCALL_ASSGN(dsd_opts * opts, dsd_state * state, uint8_t * Messa state->nxdn_last_tg = DestinationID; sprintf (state->nxdn_call_type, "%s", NXDN_Call_Type_To_Str(CallType)); + //Call String for Per Call WAV File + sprintf (state->call_string[0], "%s", NXDN_Call_Type_To_Str(CallType)); + if (CCOption & 0x80) strcat (state->call_string[0], " Emergency"); + //check the rkey array for a scrambler key value //TGT ID and Key ID could clash though if csv or system has both with different keys if (state->rkey_array[DestinationID] != 0) @@ -681,6 +685,10 @@ void NXDN_decode_VCALL_ASSGN(dsd_opts * opts, dsd_state * state, uint8_t * Messa state->nxdn_last_tg = DestinationID; sprintf (state->nxdn_call_type, "%s", NXDN_Call_Type_To_Str(CallType)); + //Call String for Per Call WAV File + sprintf (state->call_string[0], "%s", NXDN_Call_Type_To_Str(CallType)); + if (CCOption & 0x80) strcat (state->call_string[0], " Emergency"); + //check the rkey array for a scrambler key value //TGT ID and Key ID could clash though if csv or system has both with different keys if (state->rkey_array[DestinationID] != 0) @@ -1215,6 +1223,11 @@ void NXDN_decode_VCALL(dsd_opts * opts, dsd_state * state, uint8_t * Message) if(CCOption & 0x40) fprintf(stderr, "Visitor "); if(CCOption & 0x20) fprintf(stderr, "Priority Paging "); + //Call String for Per Call WAV File + sprintf (state->call_string[0], "%s", NXDN_Call_Type_To_Str(CallType)); + if (CCOption & 0x80) strcat (state->call_string[0], " Emergency"); + if (CipherType) strcat (state->call_string[0], " Enc"); + if((CipherType == 2) || (CipherType == 3)) { state->NxdnElementsContent.PartOfCurrentEncryptedFrame = 1;