mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-13 01:07:24 -05:00
EDACS Dotting Sequence FS Detection and CC Jump;
This commit is contained in:
@@ -1142,56 +1142,61 @@ getFrameSync (dsd_opts * opts, dsd_state * state)
|
||||
|
||||
//ProVoice and EDACS sync
|
||||
if (opts->frame_provoice == 1)
|
||||
{
|
||||
strncpy (synctest32, (synctest_p - 31), 32);
|
||||
strncpy (synctest48, (synctest_p - 47), 48);
|
||||
if ((strcmp (synctest32, PROVOICE_SYNC) == 0) || (strcmp (synctest32, PROVOICE_EA_SYNC) == 0))
|
||||
{
|
||||
strncpy (synctest32, (synctest_p - 31), 32);
|
||||
strncpy (synctest48, (synctest_p - 47), 48);
|
||||
if ((strcmp (synctest32, PROVOICE_SYNC) == 0) || (strcmp (synctest32, PROVOICE_EA_SYNC) == 0))
|
||||
{
|
||||
state->last_cc_sync_time = time(NULL);
|
||||
state->carrier = 1;
|
||||
state->offset = synctest_pos;
|
||||
state->max = ((state->max) + lmax) / 2;
|
||||
state->min = ((state->min) + lmin) / 2;
|
||||
sprintf (state->ftype, "ProVoice ");
|
||||
if (opts->errorbars == 1)
|
||||
printFrameSync (opts, state, "+PV ", synctest_pos + 1, modulation);
|
||||
state->lastsynctype = 14;
|
||||
return (14);
|
||||
}
|
||||
else if ((strcmp (synctest32, INV_PROVOICE_SYNC) == 0) || (strcmp (synctest32, INV_PROVOICE_EA_SYNC) == 0))
|
||||
{
|
||||
state->last_cc_sync_time = time(NULL);
|
||||
state->carrier = 1;
|
||||
state->offset = synctest_pos;
|
||||
state->max = ((state->max) + lmax) / 2;
|
||||
state->min = ((state->min) + lmin) / 2;
|
||||
sprintf (state->ftype, "ProVoice ");
|
||||
printFrameSync (opts, state, "-PV ", synctest_pos + 1, modulation);
|
||||
state->lastsynctype = 15;
|
||||
return (15);
|
||||
}
|
||||
else if ( strcmp (synctest48, EDACS_SYNC) == 0)
|
||||
{
|
||||
state->last_cc_sync_time = time(NULL);
|
||||
state->carrier = 1;
|
||||
state->offset = synctest_pos;
|
||||
state->max = ((state->max) + lmax) / 2;
|
||||
state->min = ((state->min) + lmin) / 2;
|
||||
printFrameSync (opts, state, "-EDACS", synctest_pos + 1, modulation);
|
||||
state->lastsynctype = 38;
|
||||
return (38);
|
||||
}
|
||||
else if ( strcmp (synctest48, INV_EDACS_SYNC) == 0)
|
||||
{
|
||||
sprintf (state->ftype, "ProVoice ");
|
||||
if (opts->errorbars == 1)
|
||||
printFrameSync (opts, state, "+PV ", synctest_pos + 1, modulation);
|
||||
state->lastsynctype = 14;
|
||||
return (14);
|
||||
}
|
||||
else if ((strcmp (synctest32, INV_PROVOICE_SYNC) == 0) || (strcmp (synctest32, INV_PROVOICE_EA_SYNC) == 0))
|
||||
{
|
||||
state->last_cc_sync_time = time(NULL);
|
||||
state->carrier = 1;
|
||||
state->offset = synctest_pos;
|
||||
state->max = ((state->max) + lmax) / 2;
|
||||
state->min = ((state->min) + lmin) / 2;
|
||||
printFrameSync (opts, state, "+EDACS", synctest_pos + 1, modulation);
|
||||
state->lastsynctype = 37;
|
||||
return (37);
|
||||
}
|
||||
sprintf (state->ftype, "ProVoice ");
|
||||
printFrameSync (opts, state, "-PV ", synctest_pos + 1, modulation);
|
||||
state->lastsynctype = 15;
|
||||
return (15);
|
||||
}
|
||||
else if ( strcmp (synctest48, EDACS_SYNC) == 0)
|
||||
{
|
||||
state->last_cc_sync_time = time(NULL);
|
||||
state->carrier = 1;
|
||||
state->offset = synctest_pos;
|
||||
state->max = ((state->max) + lmax) / 2;
|
||||
state->min = ((state->min) + lmin) / 2;
|
||||
printFrameSync (opts, state, "-EDACS", synctest_pos + 1, modulation);
|
||||
state->lastsynctype = 38;
|
||||
return (38);
|
||||
}
|
||||
else if ( strcmp (synctest48, INV_EDACS_SYNC) == 0)
|
||||
{
|
||||
state->last_cc_sync_time = time(NULL);
|
||||
state->carrier = 1;
|
||||
state->offset = synctest_pos;
|
||||
state->max = ((state->max) + lmax) / 2;
|
||||
state->min = ((state->min) + lmin) / 2;
|
||||
printFrameSync (opts, state, "+EDACS", synctest_pos + 1, modulation);
|
||||
state->lastsynctype = 37;
|
||||
return (37);
|
||||
}
|
||||
else if ((strcmp (synctest32, DOTTING_SEQUENCE_A) == 0) || (strcmp (synctest32, DOTTING_SEQUENCE_B) == 0))
|
||||
{
|
||||
printFrameSync (opts, state, " EDACS DOTTING SEQUENCE; ", synctest_pos + 1, modulation);
|
||||
eot_cc (opts, state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -671,4 +671,55 @@ void edacs(dsd_opts * opts, dsd_state * state)
|
||||
|
||||
}
|
||||
|
||||
void eot_cc(dsd_opts * opts, dsd_state * state)
|
||||
{
|
||||
|
||||
fprintf (stderr, "EOT; \n");
|
||||
|
||||
//jump back to CC here
|
||||
if (opts->p25_trunk == 1 && state->p25_cc_freq != 0 && opts->p25_is_tuned == 1)
|
||||
{
|
||||
|
||||
//rigctl
|
||||
if (opts->use_rigctl == 1)
|
||||
{
|
||||
state->lasttg = 0;
|
||||
state->lastsrc = 0;
|
||||
state->payload_algid = 0;
|
||||
state->payload_keyid = 0;
|
||||
state->payload_miP = 0;
|
||||
//reset some strings
|
||||
sprintf (state->call_string[0], "%s", " "); //21 spaces
|
||||
sprintf (state->call_string[1], "%s", " "); //21 spaces
|
||||
sprintf (state->active_channel[0], "%s", "");
|
||||
sprintf (state->active_channel[1], "%s", "");
|
||||
opts->p25_is_tuned = 0;
|
||||
state->p25_vc_freq[0] = state->p25_vc_freq[1] = 0;
|
||||
if (opts->setmod_bw != 0 ) SetModulation(opts->rigctl_sockfd, opts->setmod_bw);
|
||||
SetFreq(opts->rigctl_sockfd, state->p25_cc_freq);
|
||||
}
|
||||
|
||||
//rtl
|
||||
else if (opts->audio_in_type == 3)
|
||||
{
|
||||
#ifdef USE_RTLSDR
|
||||
state->lasttg = 0;
|
||||
state->lastsrc = 0;
|
||||
state->payload_algid = 0;
|
||||
state->payload_keyid = 0;
|
||||
state->payload_miP = 0;
|
||||
//reset some strings
|
||||
sprintf (state->call_string[0], "%s", " "); //21 spaces
|
||||
sprintf (state->call_string[1], "%s", " "); //21 spaces
|
||||
sprintf (state->active_channel[0], "%s", "");
|
||||
sprintf (state->active_channel[1], "%s", "");
|
||||
opts->p25_is_tuned = 0;
|
||||
state->p25_vc_freq[0] = state->p25_vc_freq[1] = 0;
|
||||
rtl_dev_tune (opts, state->p25_cc_freq);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user