diff options
Diffstat (limited to 'op25/gr-op25_repeater/lib')
-rw-r--r-- | op25/gr-op25_repeater/lib/p25_frame_assembler_impl.cc | 1 | ||||
-rw-r--r-- | op25/gr-op25_repeater/lib/p25p1_fdma.cc | 7 | ||||
-rw-r--r-- | op25/gr-op25_repeater/lib/p25p1_fdma.h | 1 | ||||
-rw-r--r-- | op25/gr-op25_repeater/lib/p25p2_tdma.cc | 13 |
4 files changed, 21 insertions, 1 deletions
diff --git a/op25/gr-op25_repeater/lib/p25_frame_assembler_impl.cc b/op25/gr-op25_repeater/lib/p25_frame_assembler_impl.cc index 27d0d68..1c1acf7 100644 --- a/op25/gr-op25_repeater/lib/p25_frame_assembler_impl.cc +++ b/op25/gr-op25_repeater/lib/p25_frame_assembler_impl.cc @@ -132,6 +132,7 @@ p25_frame_assembler_impl::general_work (int noutput_items, int rc = p2tdma.handle_frame(); if (rc > -1) p25p2_queue_msg(rc); + p1fdma.reset_timer(); // prevent P1 timeouts due to long TDMA transmissions } } } diff --git a/op25/gr-op25_repeater/lib/p25p1_fdma.cc b/op25/gr-op25_repeater/lib/p25p1_fdma.cc index 51ce715..336e0e8 100644 --- a/op25/gr-op25_repeater/lib/p25p1_fdma.cc +++ b/op25/gr-op25_repeater/lib/p25p1_fdma.cc @@ -239,6 +239,13 @@ p25p1_fdma::process_duid(uint32_t const duid, uint32_t const nac, uint8_t const // msg.reset(); } +void +p25p1_fdma::reset_timer() +{ + //update last_qtime with current time + gettimeofday(&last_qtime, 0); +} + void p25p1_fdma::rx_sym (const uint8_t *syms, int nsyms) { diff --git a/op25/gr-op25_repeater/lib/p25p1_fdma.h b/op25/gr-op25_repeater/lib/p25p1_fdma.h index 671e781..3595699 100644 --- a/op25/gr-op25_repeater/lib/p25p1_fdma.h +++ b/op25/gr-op25_repeater/lib/p25p1_fdma.h @@ -64,6 +64,7 @@ namespace gr { p25p1_voice_decode p1voice_decode; public: + void reset_timer(); void rx_sym (const uint8_t *syms, int nsyms); p25p1_fdma(const char* udp_host, int port, int debug, bool do_imbe, bool do_output, bool do_msgq, gr::msg_queue::sptr queue, std::deque<int16_t> &output_queue, bool do_audio_output); ~p25p1_fdma(); 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; } |