From f5a7ab2b77b9b265473f27eb13962f2c47051d73 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Sun, 15 Jan 2023 18:09:47 -0500 Subject: [PATCH] P25 P2 ISCH Var Fix; --- include/dsd.h | 2 +- src/ez.cpp | 4 ++-- src/p25p2_frame.c | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/dsd.h b/include/dsd.h index ce5a648..d1ccacb 100644 --- a/include/dsd.h +++ b/include/dsd.h @@ -1034,7 +1034,7 @@ bool CDMRTrellisDecode(const unsigned char* data, unsigned char* payload); int ez_rs28_ess (int payload[96], int parity[168]); //ezpwd bridge for FME int ez_rs28_facch (int payload[156], int parity[114]); //ezpwd bridge for FME int ez_rs28_sacch (int payload[180], int parity[132]); //ezpwd bridge for FME -unsigned long long int isch_lookup (unsigned long long int isch); //isch map lookup +int isch_lookup (unsigned long long int isch); //isch map lookup int bd_bridge (int payload[196], uint8_t decoded[12]); //bridge to Michael Ossmann Block De-interleaver and 1/2 rate trellis decoder int crc16_lb_bridge (int payload[190], int len); int crc12_xb_bridge (int payload[190], int len); diff --git a/src/ez.cpp b/src/ez.cpp index 1707f43..c66de53 100644 --- a/src/ez.cpp +++ b/src/ez.cpp @@ -312,11 +312,11 @@ void map_isch() isch_map["fb063f092"] = 127; } -unsigned long long int isch_lookup (unsigned long long int isch) +int isch_lookup (unsigned long long int isch) { map_isch(); //initialize the lookup map char s[64]; - unsigned long long int decoded = -2; //initialize lookup to an invalid number + int decoded = -2; //initialize lookup to an invalid number sprintf(s, "%llx", isch); decoded = isch_map[s]; return(decoded); diff --git a/src/p25p2_frame.c b/src/p25p2_frame.c index 9544740..7b77de2 100644 --- a/src/p25p2_frame.c +++ b/src/p25p2_frame.c @@ -76,7 +76,7 @@ int vc_counter = 0; int framing_counter = 0; unsigned long long int isch = 0; -unsigned long long int isch_decoded = 0; +int isch_decoded = -1; int p2_duid[8] = {0}; int16_t duid_decoded = 0; @@ -369,7 +369,7 @@ void process_ISCH (dsd_opts * opts, dsd_state * state) { isch_decoded = isch_lookup(isch); - if (isch_decoded > 0) + if (isch_decoded > -1) { int uf_count = isch_decoded & 0x3; int free = (isch_decoded >> 2) & 0x1; @@ -411,6 +411,7 @@ void process_ISCH (dsd_opts * opts, dsd_state * state) } + isch_decoded = -1; //reset to bad value after running }