From c16da142cf97010b4bd2146ab0b7c1a8ddd56d00 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 19 May 2020 20:47:11 +0100 Subject: [PATCH] Convert to using microseconds. --- NXDNGateway/KenwoodNetwork.cpp | 22 +++++++++++----------- NXDNGateway/KenwoodNetwork.h | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/NXDNGateway/KenwoodNetwork.cpp b/NXDNGateway/KenwoodNetwork.cpp index 55b4149..c5a4a20 100644 --- a/NXDNGateway/KenwoodNetwork.cpp +++ b/NXDNGateway/KenwoodNetwork.cpp @@ -50,7 +50,7 @@ m_seqNo(0U), m_ssrc(0U), m_debug(debug), m_startSecs(0U), -m_startMSecs(0U), +m_startUSecs(0U), m_rtcpTimer(1000U, 0U, 200U), m_hangTimer(1000U, 5U), m_hangType(0U), @@ -381,13 +381,13 @@ bool CKenwoodNetwork::writeRTCPStart() SYSTEMTIME st; ::GetSystemTime(&st); - m_startMSecs = st.wMilliseconds; + m_startUSecs = st.wMilliseconds * 1000U; #else struct timeval tod; ::gettimeofday(&tod, NULL); m_startSecs = tod.tv_sec; - m_startMSecs = tod.tv_usec / 1000U; + m_startUSecs = tod.tv_usec; #endif unsigned char buffer[30U]; @@ -413,10 +413,10 @@ bool CKenwoodNetwork::writeRTCPStart() buffer[14U] = (m_startSecs >> 8) & 0xFFU; buffer[15U] = (m_startSecs >> 0) & 0xFFU; - buffer[16U] = (m_startMSecs >> 24) & 0xFFU; - buffer[17U] = (m_startMSecs >> 16) & 0xFFU; - buffer[18U] = (m_startMSecs >> 8) & 0xFFU; - buffer[19U] = (m_startMSecs >> 0) & 0xFFU; + buffer[16U] = (m_startUSecs >> 24) & 0xFFU; + buffer[17U] = (m_startUSecs >> 16) & 0xFFU; + buffer[18U] = (m_startUSecs >> 8) & 0xFFU; + buffer[19U] = (m_startUSecs >> 0) & 0xFFU; buffer[22U] = 0x02U; @@ -455,10 +455,10 @@ bool CKenwoodNetwork::writeRTCPPing() buffer[14U] = (m_startSecs >> 8) & 0xFFU; buffer[15U] = (m_startSecs >> 0) & 0xFFU; - buffer[16U] = (m_startMSecs >> 24) & 0xFFU; - buffer[17U] = (m_startMSecs >> 16) & 0xFFU; - buffer[18U] = (m_startMSecs >> 8) & 0xFFU; - buffer[19U] = (m_startMSecs >> 0) & 0xFFU; + buffer[16U] = (m_startUSecs >> 24) & 0xFFU; + buffer[17U] = (m_startUSecs >> 16) & 0xFFU; + buffer[18U] = (m_startUSecs >> 8) & 0xFFU; + buffer[19U] = (m_startUSecs >> 0) & 0xFFU; buffer[22U] = 0x02U; diff --git a/NXDNGateway/KenwoodNetwork.h b/NXDNGateway/KenwoodNetwork.h index c7c2d69..aa52d64 100644 --- a/NXDNGateway/KenwoodNetwork.h +++ b/NXDNGateway/KenwoodNetwork.h @@ -58,7 +58,7 @@ private: unsigned int m_ssrc; bool m_debug; uint32_t m_startSecs; - uint32_t m_startMSecs; + uint32_t m_startUSecs; CTimer m_rtcpTimer; CTimer m_hangTimer; unsigned char m_hangType;