Active Channel Display NXDN Setup and Misc; #120

This commit is contained in:
lwvmobile 2023-05-02 18:19:41 -04:00
parent fef36e3761
commit 6f538fd166
3 changed files with 26 additions and 2 deletions

View File

@ -560,6 +560,7 @@ typedef struct
char dmr_lrrp_gps[2][200]; //2 slots by 99 char string for string lrrp gps char dmr_lrrp_gps[2][200]; //2 slots by 99 char string for string lrrp gps
char dmr_site_parms[200]; //string for site/net info depending on type of DMR system (TIII or Con+) char dmr_site_parms[200]; //string for site/net info depending on type of DMR system (TIII or Con+)
char call_string[2][200]; //string for call information char call_string[2][200]; //string for call information
char active_channel[31][200]; //string for storing and displaying active trunking channels
dPMRVoiceFS2Frame_t dPMRVoiceFS2Frame; dPMRVoiceFS2Frame_t dPMRVoiceFS2Frame;

View File

@ -157,6 +157,8 @@ noCarrier (dsd_opts * opts, dsd_state * state)
state->p25_vc_freq[0] = 0; state->p25_vc_freq[0] = 0;
state->p25_vc_freq[1] = 0; state->p25_vc_freq[1] = 0;
memset(state->active_channel, 0, sizeof(state->active_channel));
state->is_con_plus = 0; //flag off state->is_con_plus = 0; //flag off
} }
@ -373,11 +375,13 @@ noCarrier (dsd_opts * opts, dsd_state * state)
memset(state->dmr_embedded_gps, 0, sizeof(state->dmr_embedded_gps)); memset(state->dmr_embedded_gps, 0, sizeof(state->dmr_embedded_gps));
memset(state->dmr_lrrp_gps, 0, sizeof(state->dmr_lrrp_gps)); memset(state->dmr_lrrp_gps, 0, sizeof(state->dmr_lrrp_gps));
// memset(state->active_channel, 0, sizeof(state->active_channel));
//REMUS! multi-purpose call_string //REMUS! multi-purpose call_string
sprintf (state->call_string[0], "%s", " "); //21 spaces sprintf (state->call_string[0], "%s", " "); //21 spaces
sprintf (state->call_string[1], "%s", " "); //21 spaces sprintf (state->call_string[1], "%s", " "); //21 spaces
if (time(NULL) - state->last_cc_sync_time > 30) //thirty seconds of no carrier if (time(NULL) - state->last_cc_sync_time > 10) //ten seconds of no carrier
{ {
state->dmr_rest_channel = -1; state->dmr_rest_channel = -1;
state->p25_vc_freq[0] = 0; state->p25_vc_freq[0] = 0;
@ -387,6 +391,7 @@ noCarrier (dsd_opts * opts, dsd_state * state)
sprintf(state->dmr_branding, "%s", ""); sprintf(state->dmr_branding, "%s", "");
sprintf (state->dmr_site_parms, "%s", ""); sprintf (state->dmr_site_parms, "%s", "");
opts->p25_is_tuned = 0; opts->p25_is_tuned = 0;
memset(state->active_channel, 0, sizeof(state->active_channel));
} }
opts->dPMR_next_part_of_superframe = 0; opts->dPMR_next_part_of_superframe = 0;
@ -534,7 +539,7 @@ initOpts (dsd_opts * opts)
//rigctl options //rigctl options
opts->use_rigctl = 0; opts->use_rigctl = 0;
opts->rigctl_sockfd = 0; opts->rigctl_sockfd = 0;
opts->rigctlportno = 7356; //TCP Port Number; GQRX - 7356; SDR++ - 4532 opts->rigctlportno = 4532; //TCP Port Number; GQRX - 7356; SDR++ - 4532
sprintf (opts->rigctlhostname, "%s", "localhost"); sprintf (opts->rigctlhostname, "%s", "localhost");
//udp input options //udp input options
@ -911,6 +916,7 @@ initState (dsd_state * state)
memset(state->dmr_alias_block_segment, 0, sizeof(state->dmr_alias_block_segment)); memset(state->dmr_alias_block_segment, 0, sizeof(state->dmr_alias_block_segment));
memset(state->dmr_embedded_gps, 0, sizeof(state->dmr_embedded_gps)); memset(state->dmr_embedded_gps, 0, sizeof(state->dmr_embedded_gps));
memset(state->dmr_lrrp_gps, 0, sizeof(state->dmr_lrrp_gps)); memset(state->dmr_lrrp_gps, 0, sizeof(state->dmr_lrrp_gps));
memset(state->active_channel, 0, sizeof(state->active_channel));
//REMUS! multi-purpose call_string //REMUS! multi-purpose call_string
sprintf (state->call_string[0], "%s", " "); //21 spaces sprintf (state->call_string[0], "%s", " "); //21 spaces

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 //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_segment, 1, sizeof(state->nxdn_sacch_frame_segment));
memset (state->nxdn_sacch_frame_segcrc, 1, sizeof(state->nxdn_sacch_frame_segcrc)); 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; opts->p25_is_tuned = 0;
if (opts->setmod_bw != 0 ) SetModulation(opts->rigctl_sockfd, opts->setmod_bw); if (opts->setmod_bw != 0 ) SetModulation(opts->rigctl_sockfd, opts->setmod_bw);
SetFreq(opts->rigctl_sockfd, state->p25_cc_freq); 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 //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_segment, 1, sizeof(state->nxdn_sacch_frame_segment));
memset (state->nxdn_sacch_frame_segcrc, 1, sizeof(state->nxdn_sacch_frame_segcrc)); 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; opts->p25_is_tuned = 0;
rtl_udp_tune (opts, state, state->p25_cc_freq); 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 //Add support for tuning data and group/private calls on trunking systems
uint8_t tune = 0; 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 "); 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 //start tuning section here
uint8_t tune = 0; //use this to check to see if okay to tune uint8_t tune = 0; //use this to check to see if okay to tune