Active Channel Display NXDN Setup and Misc; #120

This commit is contained in:
lwvmobile
2023-05-02 18:20:51 -04:00
parent 00e0f00974
commit 0ef3b4ab4b
3 changed files with 26 additions and 2 deletions

View File

@@ -134,6 +134,7 @@ void NXDN_Elements_Content_decode(dsd_opts * opts, dsd_state * state,
//extra safeguards due to sync issues with NXDN
memset (state->nxdn_sacch_frame_segment, 1, sizeof(state->nxdn_sacch_frame_segment));
memset (state->nxdn_sacch_frame_segcrc, 1, sizeof(state->nxdn_sacch_frame_segcrc));
memset(state->active_channel, 0, sizeof(state->active_channel));
opts->p25_is_tuned = 0;
if (opts->setmod_bw != 0 ) SetModulation(opts->rigctl_sockfd, opts->setmod_bw);
SetFreq(opts->rigctl_sockfd, state->p25_cc_freq);
@@ -145,6 +146,7 @@ void NXDN_Elements_Content_decode(dsd_opts * opts, dsd_state * state,
//extra safeguards due to sync issues with NXDN
memset (state->nxdn_sacch_frame_segment, 1, sizeof(state->nxdn_sacch_frame_segment));
memset (state->nxdn_sacch_frame_segcrc, 1, sizeof(state->nxdn_sacch_frame_segcrc));
memset(state->active_channel, 0, sizeof(state->active_channel));
opts->p25_is_tuned = 0;
rtl_udp_tune (opts, state, state->p25_cc_freq);
}
@@ -453,6 +455,12 @@ void NXDN_decode_VCALL_ASSGN(dsd_opts * opts, dsd_state * state, uint8_t * Messa
}
}
//assign active call to string (might place inside of tune decision to get multiple ones?)
if (state->nxdn_rcn == 0)
sprintf (state->active_channel[0], "Active Ch: %d TG: %d; ", Channel, DestinationID);
if (state->nxdn_rcn == 1)
sprintf (state->active_channel[0], "Active Ch: %d TG: %d; ", OFN, DestinationID);
//Add support for tuning data and group/private calls on trunking systems
uint8_t tune = 0;
@@ -1315,6 +1323,15 @@ void NXDN_decode_scch(dsd_opts * opts, dsd_state * state, uint8_t * Message, uin
if (rep1 == 31) fprintf (stderr, "Termination ");
//add current active to display string -- may need tweaking on if to use rep1 (active ch), or rep2 (home prefix)
if (rep1 != 0 && rep1 != 31)
{
if (gu == 0) sprintf (state->active_channel[rep1], "Active Ch: %d TG: %d-%d; ", rep1, rep2, id); //Group TG
else sprintf (state->active_channel[rep1], "Active Ch: %d TGT: %d-%d; ", rep1, rep2, id); //Private TGT
}
//may not be needed -- DISC also zips the entire thing (all channels)
else if (rep1 == 31) sprintf (state->active_channel[rep1], "%s", ""); //zip it
//start tuning section here
uint8_t tune = 0; //use this to check to see if okay to tune