From 7148e653e5bc40cbe802f0bd8e8c8502702e6d36 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Sat, 28 Jan 2023 21:00:08 -0500 Subject: [PATCH] DMR Unknown FLCO Tweaks; PI Tweaks; --- src/dmr_flco.c | 51 +++++++++++++++++++++++++++++++++++++------------- src/dmr_pi.c | 23 ++++------------------- 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/src/dmr_flco.c b/src/dmr_flco.c index 52137cd..38b5f35 100644 --- a/src/dmr_flco.c +++ b/src/dmr_flco.c @@ -31,6 +31,7 @@ void dmr_flco (dsd_opts * opts, dsd_state * state, uint8_t lc_bits[], uint32_t C int is_alias = 0; int is_gps = 0; uint8_t slot = state->currentslot; + uint8_t unk = 0; //flag for unknown FLCO + FID combo pf = (uint8_t)(lc_bits[0]); //Protect Flag @@ -52,38 +53,55 @@ void dmr_flco (dsd_opts * opts, dsd_state * state, uint8_t lc_bits[], uint32_t C // sprintf (state->dmr_branding_sub, "%s", "Cap+ "); } - + if (IrrecoverableErrors == 0) { //Embedded Talker Alias Header Only (format and len storage) - if (type == 3 && flco == 0x04) + if (fid == 0 && type == 3 && flco == 0x04) { dmr_embedded_alias_header(opts, state, lc_bits); } //Embedded Talker Alias Header (continuation) and Blocks - if (type == 3 && flco > 0x3 && flco < 0x08) + if (fid == 0 && type == 3 && flco > 0x3 && flco < 0x08) { is_alias = 1; dmr_embedded_alias_blocks(opts, state, lc_bits); } //Embedded GPS - if (type == 3 && flco == 0x08) + if (fid == 0 && type == 3 && flco == 0x08) { is_gps = 1; - if (fid == 0) dmr_embedded_gps(opts, state, lc_bits); //issues with fid 0x10 and flco 0x08 + dmr_embedded_gps(opts, state, lc_bits); + } - //NOTE: fid 0x10 and flco 0x08 produces a lot of 'zero' lat or lon values, I don't believe this is embedded gps + //Unknown CapMax Things + if (fid == 0x10 && (flco == 0x08 || flco == 0x10) ) + { + //NOTE: fid 0x10 and flco 0x08 produces a lot of 'zero' bytes, rid users refer to receiving 'ten' 'elevens'? C0 and C1? //this has been observed to happen often on CapMax systems, so I believe it could be some CapMax 'thing' //Unknown Link Control - FLCO=0x08 FID=0x10 SVC=0xC1 or FLCO=0x08 FID=0x10 SVC=0xC0 <-- have the enc bit set on svc, but these calls aren't enc? - //is this an encrypted embedded link control? - else - { - fprintf (stderr, "%s", KGRN); - fprintf (stderr, " Slot %d Unknown EMB LC - FLCO=0x%02X FID=0x%02X SVC=0x%02X ", slot+1, flco, fid, so); - fprintf (stderr, "%s", KNRM); - } + //flco 0x10 has also been observed lately with similar svc bits, but the tg and src values don't match the vlc/tlc + if (type == 1) fprintf (stderr, "%s \n", KRED); + if (type == 2) fprintf (stderr, "%s \n", KRED); + if (type == 3) fprintf (stderr, "%s", KRED); + fprintf (stderr, " SLOT %d", state->currentslot+1); + fprintf (stderr, " CapMax?"); + unk = 1; + goto END_FLCO; + } + + //unknown other manufacturer or OTA ENC, etc. + if (fid != 0 && fid != 0x58 && fid != 0x68 && fid != 0x10) + { + if (type == 1) fprintf (stderr, "%s \n", KRED); + if (type == 2) fprintf (stderr, "%s \n", KRED); + if (type == 3) fprintf (stderr, "%s", KRED); + fprintf (stderr, " SLOT %d", state->currentslot+1); + fprintf (stderr, " Unknown LC "); + unk = 1; + goto END_FLCO; } } @@ -321,6 +339,13 @@ void dmr_flco (dsd_opts * opts, dsd_state * state, uint8_t lc_bits[], uint32_t C } + END_FLCO: + if (unk == 1) + { + fprintf(stderr, " FLCO=0x%02X FID=0x%02X SVC=0x%02X ", flco, fid, so); + fprintf (stderr, "%s", KNRM); + } + if(IrrecoverableErrors != 0) { if (type != 3) fprintf (stderr, "\n"); diff --git a/src/dmr_pi.c b/src/dmr_pi.c index 092effa..f3abb4c 100644 --- a/src/dmr_pi.c +++ b/src/dmr_pi.c @@ -29,7 +29,7 @@ void dmr_pi (dsd_opts * opts, dsd_state * state, uint8_t PI_BYTE[], uint32_t CRC { fprintf (stderr, "%s ", KYEL); fprintf (stderr, "\n Slot 1"); - fprintf (stderr, " DMR PI Header ALG ID: 0x%02X KEY ID: 0x%02X MI: 0x%08X", state->payload_algid, state->payload_keyid, state->payload_mi); + fprintf (stderr, " DMR PI H- ALG ID: 0x%02X KEY ID: 0x%02X MI: 0x%08X", state->payload_algid, state->payload_keyid, state->payload_mi); fprintf (stderr, "%s ", KNRM); } @@ -57,7 +57,7 @@ void dmr_pi (dsd_opts * opts, dsd_state * state, uint8_t PI_BYTE[], uint32_t CRC { fprintf (stderr, "%s ", KYEL); fprintf (stderr, "\n Slot 2"); - fprintf (stderr, " DMR PI Header ALG ID: 0x%02X KEY ID: 0x%02X MI: 0x%08X", state->payload_algidR, state->payload_keyidR, state->payload_miR); + fprintf (stderr, " DMR PI H- ALG ID: 0x%02X KEY ID: 0x%02X MI: 0x%08X", state->payload_algidR, state->payload_keyidR, state->payload_miR); fprintf (stderr, "%s ", KNRM); } @@ -73,21 +73,6 @@ void dmr_pi (dsd_opts * opts, dsd_state * state, uint8_t PI_BYTE[], uint32_t CRC } } - - if((IrrecoverableErrors == 0) && CRCCorrect) - { - //fprintf (stderr, " (PI CRC Okay)"); - } - else if((IrrecoverableErrors == 0)) - { - //fprintf (stderr, " (PI FEC Okay)"); - } - else { - fprintf (stderr, "%s", KRED); - fprintf (stderr, (" (PI FEC ERR)")); - fprintf (stderr, "%s ", KNRM); - } - } void LFSR(dsd_state * state) @@ -114,7 +99,7 @@ void LFSR(dsd_state * state) { fprintf (stderr, "%s", KYEL); fprintf (stderr, " Slot 1"); - fprintf (stderr, " DMR PI Continuation ALG ID: 0x%02X KEY ID: 0x%02X", state->payload_algid, state->payload_keyid); + fprintf (stderr, " DMR PI C- ALG ID: 0x%02X KEY ID: 0x%02X", state->payload_algid, state->payload_keyid); fprintf(stderr, " Next MI: 0x%08X", lfsr); fprintf (stderr, "%s", KNRM); } @@ -127,7 +112,7 @@ void LFSR(dsd_state * state) { fprintf (stderr, "%s", KYEL); fprintf (stderr, " Slot 2"); - fprintf (stderr, " DMR PI Continuation ALG ID: 0x%02X KEY ID: 0x%02X", state->payload_algidR, state->payload_keyidR); + fprintf (stderr, " DMR PI C- ALG ID: 0x%02X KEY ID: 0x%02X", state->payload_algidR, state->payload_keyidR); fprintf(stderr, " Next MI: 0x%08X", lfsr); fprintf (stderr, "%s", KNRM); }