diff --git a/include/dsd.h b/include/dsd.h index a67e8a5..fb98555 100644 --- a/include/dsd.h +++ b/include/dsd.h @@ -745,7 +745,7 @@ typedef struct char m17_src_str[50]; char m17_dst_str[50]; - uint8_t m17_meta[14]; //packed meta + uint8_t m17_meta[16]; //packed meta uint8_t m17_enc; //enc type uint8_t m17_enc_st; //scrambler or data subtye diff --git a/src/dsd_mbe.c b/src/dsd_mbe.c index f726a44..669be7a 100644 --- a/src/dsd_mbe.c +++ b/src/dsd_mbe.c @@ -582,7 +582,7 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a state->dropL += 7; short z = 0; - for (short p = 0; p < 6; p++) + for (short p = 0; p <= 6; p++) { //convert bytes back to bits and load into ambe_d array. short b = 0; //reset b to use again @@ -660,7 +660,7 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a state->dropL += 7; short z = 0; - for (short p = 0; p < 6; p++) + for (short p = 0; p <= 6; p++) { //convert bytes back to bits and load into ambe_d array. short b = 0; //reset b to use again @@ -867,7 +867,7 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a state->dropR += 7; short z = 0; - for (short p = 0; p < 6; p++) + for (short p = 0; p <= 6; p++) { //convert bytes back to bits and load into ambe_d array. short b = 0; //reset b to use again @@ -945,7 +945,7 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a state->dropR += 7; short z = 0; - for (short p = 0; p < 6; p++) + for (short p = 0; p <= 6; p++) { //convert bytes back to bits and load into ambe_d array. short b = 0; //reset b to use again diff --git a/src/dsd_symbol.c b/src/dsd_symbol.c index a70ca31..2afc928 100644 --- a/src/dsd_symbol.c +++ b/src/dsd_symbol.c @@ -295,6 +295,10 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync) //NOTE: Worked okay earlier in Cygwin, so should be fine if (opts->audio_out_type == 5) write (opts->audio_out_fd, state->analog_out, 960*2); + + //test hold on scan/trunking + state->last_cc_sync_time = time(NULL); + state->last_vc_sync_time = time(NULL); } memset (state->analog_out, 0, sizeof(state->analog_out)); diff --git a/src/m17.c b/src/m17.c index 322da41..b01dc1a 100644 --- a/src/m17.c +++ b/src/m17.c @@ -157,7 +157,7 @@ void M17decodeLSF(dsd_state * state) uint16_t lsf_type = (uint16_t)ConvertBitIntoBytes(&state->m17_lsf[96], 16); //this is the way the manual/code expects you to read these bits - uint8_t lsf_ps = (lsf_type >> 0) & 0x1; + // uint8_t lsf_ps = (lsf_type >> 0) & 0x1; uint8_t lsf_dt = (lsf_type >> 1) & 0x3; uint8_t lsf_et = (lsf_type >> 3) & 0x3; uint8_t lsf_es = (lsf_type >> 5) & 0x3; @@ -173,8 +173,8 @@ void M17decodeLSF(dsd_state * state) fprintf (stderr, "\n"); //packet or stream - if (lsf_ps == 0) fprintf (stderr, " P-"); - if (lsf_ps == 1) fprintf (stderr, " S-"); + // if (lsf_ps == 0) fprintf (stderr, " P-"); + // if (lsf_ps == 1) fprintf (stderr, " S-"); fprintf (stderr, " CAN: %d", lsf_cn); M17decodeCSD(state, lsf_dst, lsf_src); @@ -211,7 +211,7 @@ void M17decodeLSF(dsd_state * state) if (lsf_et == 1) { fprintf (stderr, " IV: "); - for (i = 0; i < 14; i++) + for (i = 0; i < 16; i++) fprintf (stderr, "%02X", state->m17_meta[i]); } @@ -589,6 +589,10 @@ void M17prepareStream(dsd_opts * opts, dsd_state * state, uint8_t * m17_bits) end = trellis_buf[0]; fn = (uint16_t)ConvertBitIntoBytes(&trellis_buf[1], 15); + //insert fn bits into meta 14 and meta 15 for Initialization Vector + state->m17_meta[14] = (uint8_t)ConvertBitIntoBytes(&trellis_buf[1], 7); + state->m17_meta[15] = (uint8_t)ConvertBitIntoBytes(&trellis_buf[8], 8); + if (opts->payload == 1) fprintf (stderr, " FSN: %05d", fn); diff --git a/src/p25p1_tdu.c b/src/p25p1_tdu.c index 901807d..cf1793e 100644 --- a/src/p25p1_tdu.c +++ b/src/p25p1_tdu.c @@ -37,4 +37,9 @@ processTDU (dsd_opts* opts, dsd_state* state) //reset some strings -- since its a tdu, blank out any call strings, only want during actual call sprintf (state->call_string[0], "%s", " "); //21 spaces sprintf (state->call_string[1], "%s", " "); //21 spaces + + //zero out on termination + state->payload_algid = 0; + state->payload_keyid = 0; + state->payload_miP = 0; } diff --git a/src/p25p1_tdulc.c b/src/p25p1_tdulc.c index 951cbf0..a1aac15 100644 --- a/src/p25p1_tdulc.c +++ b/src/p25p1_tdulc.c @@ -446,4 +446,9 @@ processTDULC (dsd_opts* opts, dsd_state* state) sprintf (state->call_string[0], "%s", " "); //21 spaces sprintf (state->call_string[1], "%s", " "); //21 spaces + //zero out on termination + state->payload_algid = 0; + state->payload_keyid = 0; + state->payload_miP = 0; + } diff --git a/src/ysf.c b/src/ysf.c index 212dd83..57a1a46 100644 --- a/src/ysf.c +++ b/src/ysf.c @@ -812,7 +812,7 @@ void processYSF(dsd_opts * opts, dsd_state * state) //print some useful decoded stuff if (dt == 0 && err == 0) fprintf (stderr, "V/D1 "); //Voice/Data Type 1 - if (dt == 1 && err == 0) fprintf (stderr, "DATA "); //Full Rate Voice + if (dt == 1 && err == 0) fprintf (stderr, "DATA "); //Full Rate Data if (dt == 2 && err == 0) fprintf (stderr, "V/D2 "); //Voice/Data Type 2 if (dt == 3 && err == 0) fprintf (stderr, "VWFR "); //Full Rate Voice