Reverse Mute

This commit is contained in:
lwvmobile 2022-12-04 19:15:33 -05:00
parent 62c70cbf92
commit 2fceee5a2f
4 changed files with 55 additions and 3 deletions

View File

@ -326,6 +326,9 @@ typedef struct
char chan_in_file[1024];
//end import filenames
//reverse mute
uint8_t reverse_mute;
} dsd_opts;
typedef struct

View File

@ -446,6 +446,9 @@ initOpts (dsd_opts * opts)
opts->p25_is_tuned = 0; //set to 1 if currently on VC, set back to 0 on carrier drop
opts->trunk_hangtime = 1; //1 second hangtime by default before tuning back to CC
//reverse mute
opts->reverse_mute = 0;
} //initopts
void
@ -883,9 +886,10 @@ usage ()
printf (" (See channel_map.csv for example)\n");
printf (" -2 <file> Import Group List Allow/Block and Label from csv file (numeral 'two')\n");
printf (" (See group.csv for example)\n");
printf (" -3 Enable Extremely Experimental Trunking Features (NXDN/P25/EDACS/DMR TIII, Con+, Cap+ RC following) with RIGCTL/TCP or RTL Input\n");
printf (" -3 Enable Extremely Experimental Trunking Features (NXDN/P25/EDACS/DMR) with RIGCTL/TCP or RTL Input\n");
printf (" -5 <udp p> Enable RIGCTL/TCP; Set UDP Port for RIGCTL. (4532 on SDR++)\n");
printf (" -6 <secs> Set Trunking VC/sync loss hangtime in seconds. (default = 1 second)\n");
printf (" -8 Reverse Mute - Mute Unencrypted Voice Channels\n");
//printf (" (Currently only available on UDP port 4532)\n");
printf ("\n");
exit (0);
@ -1094,7 +1098,7 @@ main (int argc, char **argv)
exitflag = 0;
signal (SIGINT, sigfun);
while ((c = getopt (argc, argv, "haep:P:qs:tv:z:i:o:d:c:g:nw:B:C:R:f:m:u:x:A:S:M:G:D:L:V:U:Y:K:H:X:NQWrlZTF1:2:345:6:7:")) != -1)
while ((c = getopt (argc, argv, "haep:P:qs:tv:z:i:o:d:c:g:nw:B:C:R:f:m:u:x:A:S:M:G:D:L:V:U:Y:K:H:X:NQWrlZTF1:2:345:6:7:8")) != -1)
{
opterr = 0;
switch (c)
@ -1140,6 +1144,11 @@ main (int argc, char **argv)
case '6': //hangtime in seconds, default is 1;
sscanf (optarg, "%d", &opts.trunk_hangtime);
break;
//placeholder until letters get re-arranged
case '8':
opts.reverse_mute = 1;
fprintf (stderr, "Reverse Mute\n");
break;
case 'e':
opts.errorbars = 1;
opts.datascope = 0;

View File

@ -456,7 +456,7 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a
int enc_bit = 0;
//end enc check
if ( (opts->dmr_mono == 1 ||opts->dmr_stereo == 1) && state->currentslot == 0) //all mono traffic routed through 'left'
if ( (opts->dmr_mono == 1 || opts->dmr_stereo == 1) && state->currentslot == 0) //all mono traffic routed through 'left'
{
enc_bit = (state->dmr_so >> 6) & 0x1;
if (enc_bit == 1)
@ -480,6 +480,24 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a
}
}
//reverse mute testing, only mute unencrypted traffic (slave piggyback dsd+ method)
if (opts->reverse_mute == 1)
{
if (state->dmr_encL == 0)
{
state->dmr_encL = 1;
opts->unmute_encrypted_p25 = 0;
opts->dmr_mute_encL = 1;
}
else
{
state->dmr_encL = 0;
opts->unmute_encrypted_p25 = 1;
opts->dmr_mute_encL = 0;
}
}
//end reverse mute test
if (state->dmr_encL == 0 || opts->dmr_mute_encL == 0)
{
state->debug_audio_errors += state->errs2;
@ -518,6 +536,24 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a
}
}
//reverse mute testing, only mute unencrypted traffic (slave piggyback dsd+ method)
if (opts->reverse_mute == 1)
{
if (state->dmr_encR == 0)
{
state->dmr_encR = 1;
opts->unmute_encrypted_p25 = 0;
opts->dmr_mute_encR = 1;
}
else
{
state->dmr_encR = 0;
opts->unmute_encrypted_p25 = 1;
opts->dmr_mute_encR = 0;
}
}
//end reverse mute test
if (state->dmr_encR == 0 || opts->dmr_mute_encR == 0)
{
state->debug_audio_errorsR += state->errs2R;

View File

@ -2067,6 +2067,10 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
{
printw ("| Trunk Tracking Active (P25/EDACS/NXDN/DMR)\n");
}
if (opts->reverse_mute == 1)
{
printw ("| Reverse Mute - Muting Unencrypted Voice\n");
}
printw ("------------------------------------------------------------------------------\n");