diff --git a/op25/gr-op25_repeater/lib/p25p1_fdma.cc b/op25/gr-op25_repeater/lib/p25p1_fdma.cc index 6a8d7ea..396fb55 100644 --- a/op25/gr-op25_repeater/lib/p25p1_fdma.cc +++ b/op25/gr-op25_repeater/lib/p25p1_fdma.cc @@ -283,6 +283,12 @@ p25p1_fdma::process_HDU(const bit_vector& A) ess_keyid = ((HB[j+2] & 0x03) << 14) + (HB[j+3] << 8) + (HB[j+4] << 2) + (HB[j+5] >> 4); // 16 bit KeyId vf_tgid = ((HB[j+5] & 0x0f) << 12) + (HB[j+6] << 6) + HB[j+7]; // 16 bit TGID + if (ess_algid == 0) { // workaround spurious algid + ess_algid = 128; // unenc + if (d_debug) + fprintf(stderr, "***HDU detected zero algid, msgq_id %d***\n", d_msgq_id); + } + if (d_debug >= 10) { fprintf (stderr, "ESS: tgid=%d, mfid=%x, algid=%x, keyid=%x, mi=", vf_tgid, MFID, ess_algid, ess_keyid); for (i = 0; i < 9; i++) { @@ -374,6 +380,12 @@ p25p1_fdma::process_LDU2(const bit_vector& A) ess_algid = (HB[j ] << 2) + (HB[j+1] >> 4); // 8 bit AlgId ess_keyid = ((HB[j+1] & 0x0f) << 12) + (HB[j+2] << 6) + HB[j+3]; // 16 bit KeyId + if (ess_algid == 0) { // workaround spurious algid + ess_algid = 128; // unenc + if (d_debug) + fprintf(stderr, "***LDU2 detected zero algid, msgq_id %d***\n", d_msgq_id); + } + if (d_debug >= 10) { fprintf(stderr, "ESS: algid=%x, keyid=%x, mi=", ess_algid, ess_keyid); for (int i = 0; i < 9; i++) { diff --git a/op25/gr-op25_repeater/lib/p25p2_tdma.cc b/op25/gr-op25_repeater/lib/p25p2_tdma.cc index 88aff51..586a0f1 100644 --- a/op25/gr-op25_repeater/lib/p25p2_tdma.cc +++ b/op25/gr-op25_repeater/lib/p25p2_tdma.cc @@ -206,6 +206,13 @@ void p25p2_tdma::handle_mac_ptt(const uint8_t byte_buf[], const unsigned int len } ess_algid = byte_buf[10]; ess_keyid = (byte_buf[11] << 8) + byte_buf[12]; + + if (ess_algid == 0) { // workaround spurious algid + ess_algid = 128; // unenc + if (d_debug) + fprintf(stderr, "***mac_ptt detected zero algid, msgq_id %d***\n", d_msgq_id); + } + if (d_debug >= 10) { fprintf(stderr, ", algid=%x, keyid=%x, mi=", ess_algid, ess_keyid); for (int i = 0; i < 9; i++) { @@ -455,6 +462,12 @@ void p25p2_tdma::handle_4V2V_ess(const uint8_t dibits[]) ess_algid = (ESS_B[0] << 2) + (ESS_B[1] >> 4); ess_keyid = ((ESS_B[1] & 15) << 12) + (ESS_B[2] << 6) + ESS_B[3]; + if (ess_algid == 0) { // workaround spurious algid + ess_algid = 128; // unenc + if (d_debug) + fprintf(stderr, "***burst detected zero algid, msgq_id %d***\n", d_msgq_id); + } + j = 0; for (i = 0; i < 9;) { ess_mi[i++] = (uint8_t) (ESS_B[j+4] << 2) + (ESS_B[j+5] >> 4);