mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-12 16:57:23 -05:00
EDACS Tweaks to Analog Call Handling;
This commit is contained in:
@@ -91,7 +91,7 @@ long int gen_rms(short *samples, int len, int step)
|
||||
}
|
||||
|
||||
//listening to and playing back analog audio
|
||||
void edacs_analog(dsd_opts * opts, dsd_state * state)
|
||||
void edacs_analog(dsd_opts * opts, dsd_state * state, int afs, unsigned char lcn)
|
||||
{
|
||||
|
||||
int i;
|
||||
@@ -198,18 +198,12 @@ void edacs_analog(dsd_opts * opts, dsd_state * state)
|
||||
if (opts->audio_out_type == 5)
|
||||
{
|
||||
write (opts->audio_out_fd, analog1, 960*2);
|
||||
write (opts->audio_out_fd, analog1, 960*2);
|
||||
write (opts->audio_out_fd, analog1, 960*2);
|
||||
write (opts->audio_out_fd, analog2, 960*2);
|
||||
write (opts->audio_out_fd, analog3, 960*2);
|
||||
}
|
||||
|
||||
opts->rtl_rms = rms;
|
||||
|
||||
//NOTE: On really busy EDACS systems, this could end up being incorrect if we decode an extra frame or two
|
||||
//before tuning and setting due to slight tuner lag and another frame has another call in it
|
||||
int afs = state->lastsrc;
|
||||
int a = afs >> 7;
|
||||
int fs = afs & 0x7F;
|
||||
int lcn = state->edacs_vc_lcn;
|
||||
|
||||
printFrameSync (opts, state, " EDACS", 0, "A");
|
||||
|
||||
@@ -218,7 +212,7 @@ void edacs_analog(dsd_opts * opts, dsd_state * state)
|
||||
|
||||
fprintf (stderr, " Analog RMS: %04ld SQL: %ld", rms, sql);
|
||||
if (afs != 0)
|
||||
fprintf (stderr, " AFS [0x%03X] [%02d-%03d] LCN [%02d]", afs, a, fs, lcn);
|
||||
fprintf (stderr, " AFS [0x%03X] [%02d-%03d] LCN [%02d]", afs, afs >> 7, afs & 0x7F, lcn);
|
||||
|
||||
fprintf (stderr, "%s", KNRM);
|
||||
if (rms > sql) fprintf (stderr, "\n");
|
||||
@@ -489,7 +483,7 @@ void edacs(dsd_opts * opts, dsd_state * state)
|
||||
state->edacs_tuned_lcn = lcn;
|
||||
opts->p25_is_tuned = 1;
|
||||
//debug testing (since I don't have EDACS standard w/ Analog nearby)
|
||||
// edacs_analog(opts, state);
|
||||
// edacs_analog(opts, state, group, lcn);
|
||||
}
|
||||
|
||||
if (opts->audio_in_type == 3) //rtl dongle
|
||||
@@ -499,7 +493,7 @@ void edacs(dsd_opts * opts, dsd_state * state)
|
||||
state->edacs_tuned_lcn = lcn;
|
||||
opts->p25_is_tuned = 1;
|
||||
//debug testing (since I don't have EDACS standard w/ Analog nearby)
|
||||
// edacs_analog(opts, state);
|
||||
// edacs_analog(opts, state, group, lcn);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -630,7 +624,7 @@ void edacs(dsd_opts * opts, dsd_state * state)
|
||||
SetFreq(opts->rigctl_sockfd, state->trunk_lcn_freq[lcn-1]); //minus one because our index starts at zero
|
||||
state->edacs_tuned_lcn = lcn;
|
||||
opts->p25_is_tuned = 1;
|
||||
if (command == 0xEE) edacs_analog(opts, state);
|
||||
if (command == 0xEE) edacs_analog(opts, state, afs, lcn);
|
||||
}
|
||||
|
||||
if (opts->audio_in_type == 3) //rtl dongle
|
||||
@@ -639,7 +633,7 @@ void edacs(dsd_opts * opts, dsd_state * state)
|
||||
rtl_dev_tune (opts, state->trunk_lcn_freq[lcn-1]);
|
||||
state->edacs_tuned_lcn = lcn;
|
||||
opts->p25_is_tuned = 1;
|
||||
if (command == 0xEE) edacs_analog(opts, state);
|
||||
if (command == 0xEE) edacs_analog(opts, state, afs, lcn);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user