DMR Trunking VC Hangtime Tweaks; TG Block Tweak;

This commit is contained in:
lwvmobile
2022-12-14 00:04:36 -05:00
parent 53980c98ed
commit 3ea813ebbc
3 changed files with 11 additions and 16 deletions

View File

@@ -150,9 +150,8 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
state->p25_vc_freq[1] = freq; state->p25_vc_freq[1] = freq;
} }
//if neither current slot has vlc, pi, or voice in it currently //don't tune if currently a vc on the control channel
//may need to fully write this out if this statement doesn't work the way I want it to if ( (time(NULL) - state->last_vc_sync_time > 2) )
if (state->dmrburstL != (16 || 0 || 1) && state->dmrburstR != (16 || 0 || 1) )
{ {
char mode[8]; //allow, block, digital, enc, etc char mode[8]; //allow, block, digital, enc, etc
@@ -165,7 +164,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
} }
} }
if (state->p25_cc_freq != 0 && opts->p25_trunk == 1 && (strcmp(mode, "DE") != 0)) if (state->p25_cc_freq != 0 && opts->p25_trunk == 1 && (strcmp(mode, "B") != 0))
{ {
if (freq != 0) //if we have a valid frequency if (freq != 0) //if we have a valid frequency
{ {
@@ -478,10 +477,8 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
sprintf (state->dmr_branding_sub, "%s", "Cap+ "); sprintf (state->dmr_branding_sub, "%s", "Cap+ ");
fprintf (stderr, "%s", KNRM); fprintf (stderr, "%s", KNRM);
//tuning logic with active tg's in active channels //don't tune if currently a vc on the current channel
//if neither current slot has vlc, pi, or voice in it currently if ( (time(NULL) - state->last_vc_sync_time > 2) )
//may need to fully write this out if this statement doesn't work the way I want it to
if (state->dmrburstL != (16 || 0 || 1) && state->dmrburstR != (16 || 0 || 1) )
{ {
for (j = 0; j < 8; j++) //go through the channels stored looking for active ones to tune to for (j = 0; j < 8; j++) //go through the channels stored looking for active ones to tune to
{ {
@@ -497,7 +494,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
//no more 0 reporting, that was some bad code that caused that issue //no more 0 reporting, that was some bad code that caused that issue
//without priority, this will tune the first one it finds (if group isn't blocked) //without priority, this will tune the first one it finds (if group isn't blocked)
if (t_tg[j] != 0 && state->p25_cc_freq != 0 && opts->p25_trunk == 1 && (strcmp(mode, "DE") != 0)) if (t_tg[j] != 0 && state->p25_cc_freq != 0 && opts->p25_trunk == 1 && (strcmp(mode, "B") != 0))
{ {
if (state->trunk_chan_map[j+1] != 0) //if we have a valid frequency if (state->trunk_chan_map[j+1] != 0) //if we have a valid frequency
{ {
@@ -595,13 +592,11 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
} }
} }
//voice calls can occur on the con+ control channel, so we need the same check for voice as we do for cap+ //don't tune if currently a vc on the control channel
//if neither current slot has vlc, pi, or voice in it currently if ( (time(NULL) - state->last_vc_sync_time > 2) )
//may need to fully write this out if this statement doesn't work the way I want it to
if (state->dmrburstL != (16 || 0 || 1) && state->dmrburstR != (16 || 0 || 1) )
{ {
//need channel map frequencies and stuff, also way to figure out control channel frequency? (channel 0 from channel map?) //need channel map frequencies and stuff, also way to figure out control channel frequency? (channel 0 from channel map?)
if (state->p25_cc_freq != 0 && opts->p25_trunk == 1 && (strcmp(mode, "DE") != 0)) if (state->p25_cc_freq != 0 && opts->p25_trunk == 1 && (strcmp(mode, "B") != 0))
{ {
if (state->trunk_chan_map[lcn] != 0) //if we have a valid frequency if (state->trunk_chan_map[lcn] != 0) //if we have a valid frequency
{ {

View File

@@ -325,7 +325,6 @@ dmr_data_sync (dsd_opts * opts, dsd_state * state)
{ {
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);
} }
else if (opts->audio_in_type == 3) //rtl_fm tuning else if (opts->audio_in_type == 3) //rtl_fm tuning

View File

@@ -55,7 +55,7 @@ int csvGroupImport(dsd_opts * opts, dsd_state * state)
return 0; return 0;
} }
int csvLCNImport(dsd_opts * opts, dsd_state * state) //LCN/LSN import for EDACS/DMR/NXDN? int csvLCNImport(dsd_opts * opts, dsd_state * state) //LCN/LSN import for EDACS, consider migrating to channel map
{ {
char filename[1024] = "filename.csv"; char filename[1024] = "filename.csv";
sprintf (filename, "%s", opts->lcn_in_file); sprintf (filename, "%s", opts->lcn_in_file);
@@ -129,6 +129,7 @@ int csvChanImport(dsd_opts * opts, dsd_state * state) //channel map import
if (field_count == 1) if (field_count == 1)
{ {
sscanf (field, "%ld", &state->trunk_chan_map[chan_number]); sscanf (field, "%ld", &state->trunk_chan_map[chan_number]);
//adding this should be compatible with EDACS, test and obsolete the LCN Import function if desired
sscanf (field, "%ld", &state->trunk_lcn_freq[state->lcn_freq_count]); sscanf (field, "%ld", &state->trunk_lcn_freq[state->lcn_freq_count]);
state->lcn_freq_count++; //keep tally of number of Frequencies imported state->lcn_freq_count++; //keep tally of number of Frequencies imported
} }