diff options
author | Max <ikj1234i@yahoo.com> | 2017-09-05 16:42:55 -0400 |
---|---|---|
committer | Max <ikj1234i@yahoo.com> | 2017-09-05 16:42:55 -0400 |
commit | 93b19531ee0942d4a589bb3e7345e28f1f578759 (patch) | |
tree | e2936e369fc8701e2735ed59f340cb5f1dd0dfcb /op25/gr-op25_repeater/lib/p25p2_tdma.cc | |
parent | 187f5d180cfd89edc38fa0e7df484e811dbd96c3 (diff) |
big patch from Graham - many thx
Diffstat (limited to 'op25/gr-op25_repeater/lib/p25p2_tdma.cc')
-rw-r--r-- | op25/gr-op25_repeater/lib/p25p2_tdma.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/op25/gr-op25_repeater/lib/p25p2_tdma.cc b/op25/gr-op25_repeater/lib/p25p2_tdma.cc index c3c2970..8bc1afe 100644 --- a/op25/gr-op25_repeater/lib/p25p2_tdma.cc +++ b/op25/gr-op25_repeater/lib/p25p2_tdma.cc @@ -118,7 +118,13 @@ int p25p2_tdma::process_mac_pdu(const uint8_t byte_buf[], unsigned int len) unsigned int opcode = (byte_buf[0] >> 5) & 0x7; unsigned int offset = (byte_buf[0] >> 2) & 0x7; // maps sacch opcodes into phase I duid values - static const int opcode_map[8] = {3, 5, 3, 3, 5, 3, 3, 3}; + // 0, 5, 7 - Reserved + // 1 - MAC_PTT + // 2 - MAC_END_PTT + // 3 - MAC_IDLE + // 4 - MAC_ACTIVE + // 6 - MAC_HANGTIME + static const int opcode_map[8] = {3, 5, 15, 15, 5, 3, 3, 3}; return opcode_map[opcode]; // TODO: decode MAC PDU's } @@ -174,6 +180,11 @@ int p25p2_tdma::handle_acch_frame(const uint8_t dibits[], bool fast) } else { crc_errors++; } + // write a zero audio sample (2 bytes) at end of voice to trigger pcm drain + if (((rc == 3) || (rc == 15)) && (write_sock > 0)) { + memset(write_buf, 0, 2); + sendto(write_sock, write_buf, 2, 0, (struct sockaddr *)&write_sock_addr, sizeof(write_sock_addr)); + } return rc; } |