Merge pull request #36 from lwvmobile/lwvmobile-patch-1

P25P1 Information
This commit is contained in:
lwvmobile
2022-02-24 20:20:05 -05:00
committed by GitHub
8 changed files with 70 additions and 33 deletions

View File

@@ -309,6 +309,9 @@ typedef struct
mbe_parms *prev_mp; mbe_parms *prev_mp;
mbe_parms *prev_mp_enhanced; mbe_parms *prev_mp_enhanced;
int p25kid; int p25kid;
int payload_algid;
int payload_keyid;
int payload_mfid;
unsigned int debug_audio_errors; unsigned int debug_audio_errors;
unsigned int debug_header_errors; unsigned int debug_header_errors;

View File

@@ -31,6 +31,7 @@ saveImbe4400Data (dsd_opts * opts, dsd_state * state, char *imbe_d)
if (opts->payload == 1) //make opt variable later on to toggle this if (opts->payload == 1) //make opt variable later on to toggle this
{ {
fprintf(stderr, "\n"); fprintf(stderr, "\n");
//fprintf(stderr, "ALGID=%X KEYID=%X\n", state->payload_algid, state->payload_keyid);
} }
for (i = 0; i < 11; i++) for (i = 0; i < 11; i++)
@@ -49,7 +50,10 @@ saveImbe4400Data (dsd_opts * opts, dsd_state * state, char *imbe_d)
} }
fputc (b, opts->mbe_out_f); fputc (b, opts->mbe_out_f);
} }
//fprintf(stderr, "\n"); if (opts->payload == 1)
{
fprintf(stderr, " err = [%X] [%X] ", state->errs, state->errs2);
}
fflush (opts->mbe_out_f); fflush (opts->mbe_out_f);
} }

View File

@@ -199,6 +199,7 @@ initOpts (dsd_opts * opts)
opts->pulse_flush = 1; //set 0 to flush, 1 for flushed opts->pulse_flush = 1; //set 0 to flush, 1 for flushed
opts->use_ncurses_terminal = 0; //ncurses terminal disabled by default, call with -N opts->use_ncurses_terminal = 0; //ncurses terminal disabled by default, call with -N
opts->payload = 0; //initialize with 0 so can pass == 0 arguments
} }
void void
@@ -658,6 +659,7 @@ main (int argc, char **argv)
else if (optarg[0] == 'u') else if (optarg[0] == 'u')
{ {
opts.unmute_encrypted_p25 = 1; opts.unmute_encrypted_p25 = 1;
fprintf(stderr, "P25 Encrypted Audio Unmuted\n");
} }
break; break;
case 'P': case 'P':

View File

@@ -53,31 +53,6 @@ char * FM_bannerN[9] = {
"https://github.com/lwvmobile/dsd-fme/tree/pulseaudio " "https://github.com/lwvmobile/dsd-fme/tree/pulseaudio "
}; };
/*
char * SyncTypes[20] = {
"P25P1_SYNC",
"INV_P25P1_SYNC",
"X2TDMA_BS/MS_DATA_SYNC",
"INV_X2TDMA_BS/MS_DATA_SYNC",
"X2TDMA_BS/MS_VOICE_SYNC",
"INV_X2TDMA_BS/MS_VOICE_SYNC",
"DSTAR_SYNC",
"INV_DSTAR_SYNC",
"NXDN_BS_VOICE_SYNC", //8
"INV_NXDN_BS_VOICE_SYNC", //9
"DMR_BS/MS_DATA_SYNC", //10
"DMR_MS/BS_VOICE_SYNC", //11
"DMR_MS/BS_DATA_SYNC", //12
"INV_DMR_BS/MS_VOICE_SYNC", //13
"PROVOICE_SYNC", //14
"INV_PROVOICE_SYNC", //15
"NXDN_BS_DATA_SYNC", //16
"INV_NXDN_BS_DATA_SYNC", //17
"DSTAR_HD",
"INV_DSTAR_HD"
};
*/
char * SyncTypes[20] = { char * SyncTypes[20] = {
"+P25P1", "+P25P1",
"-P25P1", "-P25P1",
@@ -159,6 +134,12 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
//printw ("| Press CTRL+C twice to exit\n"); //printw ("| Press CTRL+C twice to exit\n");
printw ("------------------------------------------------------------------------------\n"); printw ("------------------------------------------------------------------------------\n");
if (state->carrier == 0) //reset these to 0 when no carrier
{
//state->payload_algid = 0;
//state->payload_keyid = 0;
//state->payload_mfid = 0;
}
if ( (lls == 14 || lls == 15) && (time(NULL) - call_matrix[9][5] > 5) && state->carrier == 1) //honestly have no idea how to do this for pV, just going time based? only update on carrier == 1. if ( (lls == 14 || lls == 15) && (time(NULL) - call_matrix[9][5] > 5) && state->carrier == 1) //honestly have no idea how to do this for pV, just going time based? only update on carrier == 1.
{ {
@@ -356,8 +337,22 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
} }
if ((lls == 0 || lls == 1)) //1 for P25 P1 Audio if ((lls == 0 || lls == 1)) //1 for P25 P1 Audio
{ {
printw("| TID:[%i] \n| RID:[%i] \n", tg, rd); //printw("| TID:[%i] | RID:[%i] \n", tg, rd);
printw("| NAC: [0x%X] \n", nc); //printw("| NAC: [0x%X] \n", nc);
printw("| TID:[%i] RID:[%i] ", tg, rd);
printw("NAC: [0x%X] \n", nc);
printw("| ALG: [0x%02X] ", state->payload_algid);
printw("KEY: [0x%04X] ", state->payload_keyid);
//printw("MFG: [0x%X] ", state->payload_mfid); //no way of knowing if this is accurate info yet
if (state->payload_keyid != 0 && state->carrier == 1)
{
attron(COLOR_PAIR(2));
printw("**ENC**");
attroff(COLOR_PAIR(2));
attron(COLOR_PAIR(3));
}
printw("\n");
//printw("| System Type: %s \n", ALGIDS[state->payload_keyid] );
} }
//if (state->lastsynctype == 12 || state->lastsynctype == 13) //DMR Voice Types //if (state->lastsynctype == 12 || state->lastsynctype == 13) //DMR Voice Types
if (lls == 12 || lls == 13) //DMR Voice Types if (lls == 12 || lls == 13) //DMR Voice Types

View File

@@ -452,12 +452,22 @@ processHDU(dsd_opts* opts, dsd_state* state)
skipDibit (opts, state, 5); skipDibit (opts, state, 5);
status = getDibit (opts, state); status = getDibit (opts, state);
//TODO: Do something useful with the status bits... //TODO: Do something useful with the status bits...
/*
algidhex = strtol (algid, NULL, 2);
kidhex = strtol (kid, NULL, 2);
if (opts->p25enc == 1) state->payload_algid = algidhex;
state->payload_keyid = kidhex;
if (opts->payload == 1)
{
fprintf (stderr, "ALG ID: 0x%X KEY ID: 0x%X\n", algidhex, kidhex);
}
*/
if (opts->p25enc == 1 && opts->payload == 0)
{ {
algidhex = strtol (algid, NULL, 2); algidhex = strtol (algid, NULL, 2);
kidhex = strtol (kid, NULL, 2); kidhex = strtol (kid, NULL, 2);
fprintf (stderr, "mi: %s algid: $%x kid: $%x\n", mi, algidhex, kidhex); //fprintf (stderr, "mi: %s algid: $%x kid: $%x\n", mi, algidhex, kidhex);
} }
if (opts->p25lc == 1) if (opts->p25lc == 1)
{ {

View File

@@ -330,5 +330,10 @@ processLDU1 (dsd_opts* opts, dsd_state* state)
lcinfo[54] = hex_data[ 0][4] + '0'; lcinfo[54] = hex_data[ 0][4] + '0';
lcinfo[55] = hex_data[ 0][5] + '0'; lcinfo[55] = hex_data[ 0][5] + '0';
if (state->carrier == 1 && state->errs == 0) //only update when carrier is present, otherwise, garbage values may be collected
{
state->payload_mfid = strtol (mfid, NULL, 2);
}
processP25lcw (opts, state, lcformat, mfid, lcinfo); processP25lcw (opts, state, lcformat, mfid, lcinfo);
} }

View File

@@ -360,11 +360,24 @@ processLDU2 (dsd_opts * opts, dsd_state * state)
kid[14] = hex_data[ 0][4] + '0'; kid[14] = hex_data[ 0][4] + '0';
kid[15] = hex_data[ 0][5] + '0'; kid[15] = hex_data[ 0][5] + '0';
if (state->carrier == 1 && state->errs2 == 0) //only update when carrier is present, and no errors
{
//state->payload_mi = strtol (mi, NULL, 2); //no idea what this value is?
algidhex = strtol (algid, NULL, 2);
kidhex = strtol (kid, NULL, 2);
state->payload_algid = algidhex;
state->payload_keyid = kidhex;
}
if (opts->p25enc == 1) if (opts->payload == 1 && state->errs2 == 0)
{
fprintf (stderr, "ALG ID: 0x%X KEY ID: 0x%X\n", algidhex, kidhex);
//fprintf (stderr, "MI: %s\n", mi);
}
if (opts->p25enc == 1 && opts->payload == 0)
{ {
algidhex = strtol (algid, NULL, 2); algidhex = strtol (algid, NULL, 2);
kidhex = strtol (kid, NULL, 2); kidhex = strtol (kid, NULL, 2);
fprintf (stderr, "mi: %s algid: $%x kid: $%x\n", mi, algidhex, kidhex); //fprintf (stderr, "mi: %s algid: $%x kid: $%x\n", mi, algidhex, kidhex);
} }
} }

View File

@@ -386,6 +386,11 @@ processTDULC (dsd_opts* opts, dsd_state* state)
lcinfo[53] = dodeca_data[0][ 9] + '0'; lcinfo[53] = dodeca_data[0][ 9] + '0';
lcinfo[54] = dodeca_data[0][10] + '0'; lcinfo[54] = dodeca_data[0][10] + '0';
lcinfo[55] = dodeca_data[0][11] + '0'; lcinfo[55] = dodeca_data[0][11] + '0';
/*
if (state->carrier == 1) //only update when carrier is present, otherwise, garbage values may be collected
{
state->payload_mfid = strtol (mfid, NULL, 2); //wonder if this is accurate info or not
}
*/
processP25lcw (opts, state, lcformat, mfid, lcinfo); processP25lcw (opts, state, lcformat, mfid, lcinfo);
} }