From 4d65c635e48f15260031ff8417dd2c8c6c83ba1e Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Thu, 8 Apr 2021 20:09:11 +0000 Subject: [PATCH] file cleanups; better logging of DMR voice sync vs voice frames; --- Defines.h | 14 +++++++------- Utils.cpp | 16 ++++++++-------- dmr/VoicePacket.cpp | 14 +++++++------- network/BaseNetwork.h | 2 +- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Defines.h b/Defines.h index a8484764..9939eca5 100644 --- a/Defines.h +++ b/Defines.h @@ -220,22 +220,22 @@ inline std::string __FLOAT_STR(const float& value) { /// Creates a read-only get property by reference. #define __READONLY_PROPERTY_BYREF(type, variableName, propName) \ private: type m_##variableName; \ - public: __forceinline type& get##propName(void) const { return m_##variableName; } + public: __forceinline type& get##propName(void) const { return m_##variableName; } /// Creates a get and set property. #define __PROPERTY(type, variableName, propName) \ private: type m_##variableName; \ - public: __forceinline type get##propName(void) const { return m_##variableName; } \ - __forceinline void set##propName(type val) { m_##variableName = val; } + public: __forceinline type get##propName(void) const { return m_##variableName; } \ + __forceinline void set##propName(type val) { m_##variableName = val; } /// Creates a get and set property, does not use "get"/"set". #define __PROPERTY_PLAIN(type, variableName, propName) \ private: type m_##variableName; \ - public: __forceinline type propName(void) const { return m_##variableName; } \ - __forceinline void propName(type val) { m_##variableName = val; } + public: __forceinline type propName(void) const { return m_##variableName; } \ + __forceinline void propName(type val) { m_##variableName = val; } /// Creates a get and set property by reference. #define __PROPERTY_BYREF(type, variableName, propName) \ private: type m_##variableName; \ - public: __forceinline type& get##propName(void) const { return m_##variableName; } \ - __forceinline void set##propName(type& val) { m_##variableName = val; } + public: __forceinline type& get##propName(void) const { return m_##variableName; } \ + __forceinline void set##propName(type& val) { m_##variableName = val; } #endif // __DEFINES_H__ diff --git a/Utils.cpp b/Utils.cpp index 6a861953..e531ccb2 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -56,7 +56,7 @@ void getHostVersion() // --------------------------------------------------------------------------- /// /// -/// +/// /// /// /// @@ -69,7 +69,7 @@ void Utils::dump(const std::string& title, const uint8_t* data, uint32_t length) /// /// -/// +/// /// /// /// @@ -122,7 +122,7 @@ void Utils::dump(int level, const std::string& title, const uint8_t* data, uint3 /// /// -/// +/// /// /// /// @@ -135,7 +135,7 @@ void Utils::dump(const std::string& title, const bool* bits, uint32_t length) /// /// -/// +/// /// /// /// @@ -154,7 +154,7 @@ void Utils::dump(int level, const std::string& title, const bool* bits, uint32_t /// /// -/// +/// /// /// void Utils::byteToBitsBE(uint8_t byte, bool* bits) @@ -173,7 +173,7 @@ void Utils::byteToBitsBE(uint8_t byte, bool* bits) /// /// -/// +/// /// /// void Utils::byteToBitsLE(uint8_t byte, bool* bits) @@ -192,7 +192,7 @@ void Utils::byteToBitsLE(uint8_t byte, bool* bits) /// /// -/// +/// /// /// void Utils::bitsToByteBE(const bool* bits, uint8_t& byte) @@ -211,7 +211,7 @@ void Utils::bitsToByteBE(const bool* bits, uint8_t& byte) /// /// -/// +/// /// /// void Utils::bitsToByteLE(const bool* bits, uint8_t& byte) diff --git a/dmr/VoicePacket.cpp b/dmr/VoicePacket.cpp index a9aacd83..32b6eb0e 100644 --- a/dmr/VoicePacket.cpp +++ b/dmr/VoicePacket.cpp @@ -83,7 +83,7 @@ bool VoicePacket::process(uint8_t* data, uint32_t len) if (fid == FID_ETSI || fid == FID_DMRA) { errors = m_fec.regenerateDMR(data + 2U); if (m_verbose) { - LogMessage(LOG_RF, "DMR Slot %u, DMR_SYNC_VOICE audio, sequence no = 0, errs = %u/141 (%.1f%%)", + LogMessage(LOG_RF, "DMR Slot %u, DT_VOICE_SYNC audio, sequence no = 0, errs = %u/141 (%.1f%%)", m_slot->m_slotNo, errors, float(errors) / 1.41F); } @@ -136,7 +136,7 @@ bool VoicePacket::process(uint8_t* data, uint32_t len) if (fid == FID_ETSI || fid == FID_DMRA) { errors = m_fec.regenerateDMR(data + 2U); if (m_verbose) { - LogMessage(LOG_RF, "DMR Slot %u, DMR_SYNC_VOICE audio, sequence no = %u, errs = %u/141 (%.1f%%)", + LogMessage(LOG_RF, "DMR Slot %u, DT_VOICE audio, sequence no = %u, errs = %u/141 (%.1f%%)", m_slot->m_slotNo, m_rfN, errors, float(errors) / 1.41F); } @@ -287,7 +287,7 @@ bool VoicePacket::process(uint8_t* data, uint32_t len) // validate the source RID if (!acl::AccessControl::validateSrcId(srcId)) { - LogWarning(LOG_RF, "DMR Slot %u, DMR_DATA_SYNC denial, RID rejection, srcId = %u", m_slot->m_slotNo, srcId); + LogWarning(LOG_RF, "DMR Slot %u, DT_VOICE denial, RID rejection, srcId = %u", m_slot->m_slotNo, srcId); delete lc; return false; } @@ -295,7 +295,7 @@ bool VoicePacket::process(uint8_t* data, uint32_t len) // validate the target ID, if the target is a talkgroup if (flco == FLCO_GROUP) { if (!acl::AccessControl::validateTGId(m_slot->m_slotNo, dstId)) { - LogWarning(LOG_RF, "DMR Slot %u, DMR_DATA_SYNC denial, TGID rejection, srcId = %u, dstId = %u", m_slot->m_slotNo, srcId, dstId); + LogWarning(LOG_RF, "DMR Slot %u, DT_VOICE denial, TGID rejection, srcId = %u, dstId = %u", m_slot->m_slotNo, srcId, dstId); delete lc; return false; } @@ -368,7 +368,7 @@ bool VoicePacket::process(uint8_t* data, uint32_t len) if (fid == FID_ETSI || fid == FID_DMRA) { errors = m_fec.regenerateDMR(data + 2U); if (m_verbose) { - LogMessage(LOG_RF, "DMR Slot %u, DMR_AUDIO_SYNC audio, sequence no = %u, errs = %u/141 (%.1f%%)", + LogMessage(LOG_RF, "DMR Slot %u, DT_VOICE audio, sequence no = %u, errs = %u/141 (%.1f%%)", m_slot->m_slotNo, m_rfN, errors, float(errors) / 1.41F); } @@ -490,7 +490,7 @@ void VoicePacket::processNetwork(const data::Data& dmrData) if (fid == FID_ETSI || fid == FID_DMRA) { m_slot->m_netErrs += m_fec.regenerateDMR(data + 2U); if (m_verbose) { - LogMessage(LOG_NET, "DMR Slot %u, DMR_SYNC_VOICE audio, sequence no = %u, errs = %u/141 (%.1f%%)", + LogMessage(LOG_NET, "DMR Slot %u, DT_VOICE_SYNC audio, sequence no = %u, errs = %u/141 (%.1f%%)", m_slot->m_slotNo, m_netN, m_slot->m_netErrs, float(m_slot->m_netErrs) / 1.41F); } } @@ -535,7 +535,7 @@ void VoicePacket::processNetwork(const data::Data& dmrData) if (fid == FID_ETSI || fid == FID_DMRA) { m_slot->m_netErrs += m_fec.regenerateDMR(data + 2U); if (m_verbose) { - LogMessage(LOG_NET, "DMR Slot %u, DMR_SYNC_VOICE audio, sequence no = %u, errs = %u/141 (%.1f%%)", + LogMessage(LOG_NET, "DMR Slot %u, DT_VOICE audio, sequence no = %u, errs = %u/141 (%.1f%%)", m_slot->m_slotNo, m_netN, m_slot->m_netErrs, float(m_slot->m_netErrs) / 1.41F); } } diff --git a/network/BaseNetwork.h b/network/BaseNetwork.h index cb4bc028..53bc4c04 100644 --- a/network/BaseNetwork.h +++ b/network/BaseNetwork.h @@ -218,7 +218,7 @@ namespace network /// Writes the local activity log to the network. virtual bool writeActLog(const char* message); - /// Writes the local activity log to the network. + /// Writes the local diagnostic logs to the network. virtual bool writeDiagLog(const char* message); /// Updates the timer by the passed number of milliseconds.