mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-12 16:57:23 -05:00
DMR LE/CAP+/Misc Tweaks;
This commit is contained in:
12
src/dmr_le.c
12
src/dmr_le.c
@@ -272,9 +272,15 @@ void dmr_sbrc (dsd_opts * opts, dsd_state * state, uint8_t power)
|
||||
uint8_t key = (sbrc_hex >> 3) & 0xFF;
|
||||
uint8_t txi_delay = (sbrc_hex >> 3) & 0x1F; //middle five are the 'delay' value on a TXI system
|
||||
|
||||
//Note: AES-256 Key 1 will pass a CRC3 due to its bit arrangement vs the CRC poly 1101
|
||||
// if (irr_err == 0 && sbrc_hex = 0xD) crc3_okay = 0; //SB: 00000001101
|
||||
|
||||
//NOTE: on above, I belive that we need to check by opcode as well, as a CRC3 can have multiple collisions
|
||||
//so we need to exclude op/alg 0 and 3 from the check (does algID 0x03/0x23 even exist?)
|
||||
|
||||
if (opts->dmr_le == 1) //this will now require a user to switch it on or off until more testing/figuring can be done
|
||||
{
|
||||
if (irr_err != 0) fprintf (stderr, "\n %s SLOT %d SB/RC (FEC ERR) %d %s \n", KRED, slot, irr_err, KNRM);
|
||||
if (irr_err != 0) fprintf (stderr, "\n%s SLOT %d SB/RC (FEC ERR) %d %s \n", KRED, slot, irr_err, KNRM);
|
||||
if (irr_err == 0)
|
||||
{
|
||||
if (sbrc_hex == 0) ; //NULL, do nothing
|
||||
@@ -289,8 +295,8 @@ void dmr_sbrc (dsd_opts * opts, dsd_state * state, uint8_t power)
|
||||
//do something with the reverse channel information
|
||||
}
|
||||
|
||||
//if the call is interruptable (TXI) and the crc3 is okay
|
||||
else if (crc3_okay == 1)
|
||||
//if the call is interruptable (TXI) and the crc3 is okay and TXI Opcode
|
||||
else if (crc3_okay == 1 && (sbrc_opcode == 0 || sbrc_opcode == 3) )
|
||||
{
|
||||
//opcodes -- 0 (NULL), BR Delay (3)
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
@@ -2352,7 +2352,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
|
||||
{
|
||||
printw ("| Fast Scan Mode Enabled ");
|
||||
if (state->lcn_freq_roll != 0)
|
||||
printw (" - Frequency: [%.06lf] Mhz", (double)state->trunk_lcn_freq[state->lcn_freq_roll-1]/1000000);
|
||||
printw (" - Frequency: %.06lf Mhz", (double)state->trunk_lcn_freq[state->lcn_freq_roll-1]/1000000);
|
||||
printw (" Speed: %.02lf sec \n", opts->trunk_hangtime); //not sure values less than 1 make a difference, may be system/environment dependent
|
||||
}
|
||||
|
||||
@@ -2424,7 +2424,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
|
||||
if (idas == 1) printw ("Monitoring RTCH2 Channel"); //Idas RTCH2 Channel
|
||||
if (state->p25_cc_freq != 0)
|
||||
{
|
||||
printw (" - Frequency: [%.06lf] Mhz ", (double)state->p25_cc_freq/1000000);
|
||||
printw (" - Frequency: %.06lf Mhz ", (double)state->p25_cc_freq/1000000);
|
||||
}
|
||||
}
|
||||
else if (opts->p25_is_tuned == 1)
|
||||
@@ -2433,7 +2433,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
|
||||
if (idas == 1) printw ("Monitoring RTCH2 Channel"); //Idas RTCH2
|
||||
if (state->p25_vc_freq[0] != 0)
|
||||
{
|
||||
printw (" - Frequency: [%.06lf] Mhz ", (double)state->p25_vc_freq[0]/1000000);
|
||||
printw (" - Frequency: %.06lf Mhz ", (double)state->p25_vc_freq[0]/1000000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2581,15 +2581,15 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
|
||||
printw ("%s", state->dmr_site_parms); //site id, net id, etc
|
||||
if (state->dmr_rest_channel > 0)
|
||||
{
|
||||
printw ("Rest Channel: [%02d] ", state->dmr_rest_channel);
|
||||
printw ("Rest LSN: %02d; ", state->dmr_rest_channel);
|
||||
if (state->trunk_chan_map[state->dmr_rest_channel] != 0)
|
||||
{
|
||||
printw ("Freq: [%.06lf] Mhz", (double)state->trunk_chan_map[state->dmr_rest_channel]/1000000);
|
||||
printw ("Freq: %.06lf Mhz", (double)state->trunk_chan_map[state->dmr_rest_channel]/1000000);
|
||||
}
|
||||
}
|
||||
else if (state->p25_cc_freq != 0)
|
||||
{
|
||||
printw ("Freq: [%.06lf] MHz", (double)state->p25_cc_freq/1000000);
|
||||
printw ("Freq: %.06lf MHz", (double)state->p25_cc_freq/1000000);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2602,7 +2602,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
|
||||
printw ("P25 P1 - [%05llX][%03llX][%03llX] RFSS: [%lld] SITE: [%lld] ", state->p2_wacn, state->p2_sysid, state->p2_cc, state->p2_rfssid, state->p2_siteid);
|
||||
if (state->p25_cc_freq != 0)
|
||||
{
|
||||
printw ("Freq: [%.06lf] MHz", (double)state->p25_cc_freq/1000000);
|
||||
printw ("Freq: %.06lf MHz", (double)state->p25_cc_freq/1000000);
|
||||
}
|
||||
}
|
||||
else if (lls == 35 || lls == 36) //P2
|
||||
@@ -2624,7 +2624,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
|
||||
{
|
||||
if (state->p25_cc_freq != 0)
|
||||
{
|
||||
printw ("Freq: [%.06lf] MHz", (double)state->p25_cc_freq/1000000);
|
||||
printw ("Freq: %.06lf MHz", (double)state->p25_cc_freq/1000000);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2721,7 +2721,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
|
||||
printw("Double DES");
|
||||
attron(COLOR_PAIR(3));
|
||||
}
|
||||
if (state->payload_algid == 0x83 || state->payload_algid == 0x23)
|
||||
if (state->payload_algid == 0x83)
|
||||
{
|
||||
attron(COLOR_PAIR(1));
|
||||
printw("Triple DES");
|
||||
@@ -2914,7 +2914,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
|
||||
printw("DES-OFB");
|
||||
attron(COLOR_PAIR(3));
|
||||
}
|
||||
if (state->payload_algidR == 0x83 || state->payload_algidR == 0x23)
|
||||
if (state->payload_algidR == 0x83)
|
||||
{
|
||||
attron(COLOR_PAIR(1));
|
||||
printw("Triple DES");
|
||||
@@ -3049,7 +3049,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
|
||||
if (state->p25_vc_freq[0] != 0)
|
||||
{
|
||||
attron(COLOR_PAIR(4));
|
||||
printw ("Frequency: [%.06lf] MHz ", (double)state->p25_vc_freq[0]/1000000);
|
||||
printw ("Frequency: %.06lf MHz ", (double)state->p25_vc_freq[0]/1000000);
|
||||
}
|
||||
if (state->carrier == 1) attron(COLOR_PAIR(3));
|
||||
else attroff(COLOR_PAIR(4));
|
||||
|
||||
@@ -469,7 +469,7 @@ processHDU(dsd_opts* opts, dsd_state* state)
|
||||
{
|
||||
|
||||
fprintf (stderr, "%s", KYEL);
|
||||
fprintf (stderr, " HDU ALG ID: 0x%02X KEY ID: 0x%04X MI: 0x%08llX%08llX%02llX", algidhex, kidhex, mihex1, mihex2, mihex3);
|
||||
fprintf (stderr, " HDU ALG ID: 0x%02X KEY ID: 0x%04X MI: 0x%08llX%08llX", algidhex, kidhex, mihex1, mihex2);
|
||||
state->payload_algid = algidhex;
|
||||
state->payload_keyid = kidhex;
|
||||
if (state->R != 0 && state->payload_algid == 0xAA)
|
||||
@@ -477,6 +477,11 @@ processHDU(dsd_opts* opts, dsd_state* state)
|
||||
fprintf (stderr, " Key: %010llX", state->R);
|
||||
opts->unmute_encrypted_p25 = 1;
|
||||
}
|
||||
else if (state->payload_algid != 0 && state->payload_algid != 0x80)
|
||||
{
|
||||
//may want to mute this again, or may not want to
|
||||
opts->unmute_encrypted_p25 = 0;
|
||||
}
|
||||
fprintf (stderr, "%s", KNRM);
|
||||
//only use 64 MSB, trailing 8 bits aren't used, so no mihex3
|
||||
state->payload_miP = (mihex1 << 32) | (mihex2);
|
||||
|
||||
@@ -371,7 +371,7 @@ processLDU2 (dsd_opts * opts, dsd_state * state)
|
||||
if (irrecoverable_errors == 0)
|
||||
{
|
||||
fprintf (stderr, "%s", KYEL);
|
||||
fprintf (stderr, " LDU2 ALG ID: 0x%02X KEY ID: 0x%04X MI: 0x%08llX%08llX%02llX", algidhex, kidhex, mihex1, mihex2, mihex3);
|
||||
fprintf (stderr, " LDU2 ALG ID: 0x%02X KEY ID: 0x%04X MI: 0x%08llX%08llX", algidhex, kidhex, mihex1, mihex2);
|
||||
state->payload_algid = algidhex;
|
||||
state->payload_keyid = kidhex;
|
||||
if (state->R != 0 && state->payload_algid == 0xAA)
|
||||
@@ -379,6 +379,11 @@ processLDU2 (dsd_opts * opts, dsd_state * state)
|
||||
fprintf (stderr, " Key: %010llX", state->R);
|
||||
opts->unmute_encrypted_p25 = 1;
|
||||
}
|
||||
else if (state->payload_algid != 0 && state->payload_algid != 0x80)
|
||||
{
|
||||
//may want to mute this again, or may not want to
|
||||
opts->unmute_encrypted_p25 = 0;
|
||||
}
|
||||
fprintf (stderr, "%s", KNRM);
|
||||
//only use 64 MSB, trailing 8 bits aren't used, so no mihex3
|
||||
state->payload_miP = (mihex1 << 32) | (mihex2);
|
||||
|
||||
Reference in New Issue
Block a user