From ca161aa402980966af30ffab2a010e5a1d23e581 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Mon, 10 Apr 2023 12:08:23 -0400 Subject: [PATCH] cleanup trailing whitespace; --- src/Defines.h | 6 +- src/Log.cpp | 4 +- src/dmr/Control.cpp | 4 +- src/dmr/Control.h | 6 +- src/dmr/DMRDefines.h | 2 +- src/dmr/SiteData.h | 2 +- src/dmr/Slot.cpp | 16 +- src/dmr/Slot.h | 4 +- src/dmr/lc/PrivacyLC.cpp | 2 +- src/dmr/lc/csbk/CSBKFactory.cpp | 4 +- src/dmr/lc/csbk/CSBK_ACK_RSP.cpp | 2 +- src/dmr/lc/csbk/CSBK_BSDWNACT.cpp | 2 +- src/dmr/lc/csbk/CSBK_CALL_ALRT.cpp | 2 +- src/dmr/lc/csbk/CSBK_EXT_FNCT.cpp | 2 +- src/dmr/lc/csbk/CSBK_PRECCSBK.cpp | 2 +- src/dmr/lc/csbk/CSBK_RAW.h | 2 +- src/dmr/lc/csbk/CSBK_TV_GRANT.h | 2 +- src/dmr/lc/csbk/CSBK_UU_ANS_RSP.cpp | 2 +- src/dmr/lc/csbk/CSBK_UU_V_REQ.cpp | 2 +- src/dmr/lookups/DMRAffiliationLookup.h | 2 +- src/dmr/packet/ControlSignaling.h | 2 +- src/dmr/packet/Data.cpp | 2 +- src/dmr/packet/Data.h | 2 +- src/dmr/packet/Voice.cpp | 6 +- src/dmr/packet/Voice.h | 2 +- src/edac/AMBEFEC.cpp | 8 +- src/edac/AMBEFEC.h | 2 +- src/edac/BCH.cpp | 4 +- src/edac/CRC.cpp | 10 +- src/edac/Golay24128.h | 2 +- src/edac/SHA256.cpp | 4 +- src/edac/SHA256.h | 2 +- src/edac/rs/RS.h | 140 +++++++++--------- src/host/Host.cpp | 36 ++--- src/host/Host.h | 6 +- src/host/calibrate/HostCal.cpp | 18 +-- src/host/setup/HostSetup.cpp | 2 +- src/lookups/AffiliationLookup.cpp | 2 +- src/lookups/AffiliationLookup.h | 2 +- src/lookups/IdenTableLookup.h | 2 +- src/lookups/RadioIdLookup.cpp | 2 +- src/modem/Modem.cpp | 6 +- src/modem/Modem.h | 8 +- src/modem/port/PseudoPTYPort.h | 2 +- src/modem/port/UARTPort.cpp | 4 +- src/network/Network.cpp | 4 +- src/network/Network.h | 2 +- src/network/RESTAPI.cpp | 52 +++---- src/network/RESTDefines.h | 2 +- src/network/UDPSocket.cpp | 4 +- src/network/UDPSocket.h | 2 +- src/network/json/json.h | 12 +- src/network/rest/RequestDispatcher.h | 36 ++--- src/network/rest/http/ClientConnection.h | 30 ++-- src/network/rest/http/HTTPClient.h | 32 ++-- src/network/rest/http/HTTPHeaders.h | 20 +-- src/network/rest/http/HTTPLexer.cpp | 10 +- src/network/rest/http/HTTPLexer.h | 14 +- src/network/rest/http/HTTPPayload.cpp | 8 +- src/network/rest/http/HTTPPayload.h | 16 +- src/network/rest/http/HTTPRequestHandler.cpp | 12 +- src/network/rest/http/HTTPRequestHandler.h | 16 +- src/network/rest/http/HTTPServer.h | 42 +++--- src/network/rest/http/ServerConnection.h | 32 ++-- .../rest/http/ServerConnectionManager.h | 27 ++-- src/nxdn/Audio.h | 6 +- src/nxdn/Control.cpp | 16 +- src/nxdn/Control.h | 10 +- src/nxdn/NXDNDefines.h | 2 +- src/nxdn/channel/FACCH1.cpp | 6 +- src/nxdn/channel/LICH.cpp | 2 +- src/nxdn/channel/UDCH.cpp | 2 +- src/nxdn/edac/Convolution.h | 2 +- src/nxdn/lc/RTCH.cpp | 2 +- src/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.cpp | 2 +- src/nxdn/lc/rcch/RCCHFactory.cpp | 4 +- src/nxdn/packet/Data.cpp | 12 +- src/nxdn/packet/Data.h | 2 +- src/nxdn/packet/Trunk.cpp | 4 +- src/nxdn/packet/Trunk.h | 2 +- src/nxdn/packet/Voice.cpp | 44 +++--- src/nxdn/packet/Voice.h | 2 +- src/p25/Control.cpp | 8 +- src/p25/Control.h | 10 +- src/p25/data/DataBlock.cpp | 4 +- src/p25/data/DataHeader.cpp | 2 +- src/p25/dfsi/LC.cpp | 6 +- src/p25/dfsi/packet/DFSITrunk.cpp | 4 +- src/p25/dfsi/packet/DFSITrunk.h | 2 +- src/p25/dfsi/packet/DFSIVoice.cpp | 12 +- src/p25/dfsi/packet/DFSIVoice.h | 2 +- src/p25/lc/AMBT.h | 2 +- src/p25/lc/LC.cpp | 4 +- src/p25/lc/TDULC.h | 2 +- src/p25/lc/TSBK.cpp | 2 +- src/p25/lc/TSBK.h | 2 +- src/p25/lc/tdulc/LC_GROUP.cpp | 2 +- src/p25/lc/tdulc/LC_PRIVATE.cpp | 2 +- src/p25/lc/tdulc/LC_TEL_INT_VCH_USER.cpp | 2 +- src/p25/lc/tdulc/TDULCFactory.cpp | 4 +- src/p25/lc/tsbk/IOSP_ACK_RSP.cpp | 4 +- src/p25/lc/tsbk/IOSP_CALL_ALRT.cpp | 2 +- src/p25/lc/tsbk/IOSP_EXT_FNCT.h | 2 +- src/p25/lc/tsbk/IOSP_GRP_AFF.cpp | 4 +- src/p25/lc/tsbk/IOSP_GRP_AFF.h | 2 +- src/p25/lc/tsbk/IOSP_GRP_VCH.cpp | 2 +- src/p25/lc/tsbk/IOSP_MSG_UPDT.cpp | 2 +- src/p25/lc/tsbk/IOSP_RAD_MON.cpp | 2 +- src/p25/lc/tsbk/IOSP_RAD_MON.h | 2 +- src/p25/lc/tsbk/IOSP_STS_UPDT.cpp | 2 +- src/p25/lc/tsbk/IOSP_UU_ANS.cpp | 2 +- src/p25/lc/tsbk/IOSP_UU_VCH.cpp | 2 +- src/p25/lc/tsbk/IOSP_U_REG.cpp | 2 +- src/p25/lc/tsbk/ISP_AUTH_FNE_RST.cpp | 2 +- src/p25/lc/tsbk/ISP_AUTH_RESP.cpp | 2 +- src/p25/lc/tsbk/ISP_AUTH_RESP.h | 2 +- src/p25/lc/tsbk/ISP_AUTH_SU_DMD.cpp | 2 +- src/p25/lc/tsbk/ISP_CAN_SRV_REQ.cpp | 2 +- src/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.cpp | 2 +- src/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.h | 2 +- src/p25/lc/tsbk/ISP_LOC_REG_REQ.cpp | 2 +- src/p25/lc/tsbk/ISP_SNDCP_CH_REQ.cpp | 2 +- src/p25/lc/tsbk/ISP_U_DEREG_REQ.cpp | 2 +- src/p25/lc/tsbk/MBT_IOSP_EXT_FNCT.h | 2 +- src/p25/lc/tsbk/MBT_OSP_ADJ_STS_BCAST.h | 2 +- src/p25/lc/tsbk/OSP_ADJ_STS_BCAST.cpp | 2 +- src/p25/lc/tsbk/OSP_ADJ_STS_BCAST.h | 2 +- src/p25/lc/tsbk/OSP_AUTH_FNE_RESP.h | 2 +- src/p25/lc/tsbk/OSP_DENY_RSP.cpp | 2 +- src/p25/lc/tsbk/OSP_DVM_GIT_HASH.cpp | 2 +- src/p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.cpp | 4 +- src/p25/lc/tsbk/OSP_MOT_CC_BSI.cpp | 2 +- src/p25/lc/tsbk/OSP_MOT_GRG_ADD.cpp | 2 +- src/p25/lc/tsbk/OSP_MOT_GRG_DEL.cpp | 2 +- src/p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.cpp | 2 +- src/p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.cpp | 2 +- src/p25/lc/tsbk/OSP_MOT_PSH_CCH.cpp | 2 +- src/p25/lc/tsbk/OSP_NET_STS_BCAST.cpp | 2 +- src/p25/lc/tsbk/OSP_QUE_RSP.cpp | 2 +- src/p25/lc/tsbk/OSP_RFSS_STS_BCAST.cpp | 2 +- src/p25/lc/tsbk/OSP_SNDCP_CH_GNT.h | 2 +- src/p25/lc/tsbk/OSP_SYNC_BCAST.cpp | 4 +- src/p25/lc/tsbk/OSP_SYS_SRV_BCAST.cpp | 2 +- src/p25/lc/tsbk/OSP_TIME_DATE_ANN.cpp | 4 +- src/p25/lc/tsbk/OSP_TSBK_RAW.h | 2 +- src/p25/lc/tsbk/OSP_U_DEREG_ACK.cpp | 2 +- src/p25/lc/tsbk/TSBKFactory.cpp | 10 +- src/p25/lookups/P25AffiliationLookup.h | 2 +- src/p25/packet/Data.cpp | 10 +- src/p25/packet/Data.h | 2 +- src/p25/packet/Trunk.cpp | 4 +- src/p25/packet/Voice.cpp | 36 ++--- src/p25/packet/Voice.h | 2 +- src/remote/RESTClient.cpp | 8 +- src/remote/RESTClientMain.cpp | 16 +- src/yaml/Yaml.cpp | 28 ++-- src/yaml/Yaml.h | 4 +- 157 files changed, 567 insertions(+), 568 deletions(-) diff --git a/src/Defines.h b/src/Defines.h index 22de6c86..459ee724 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -112,7 +112,7 @@ typedef unsigned long long ulong64_t; #define __VER__ "D03.00.00 (" __GIT_VER__ ")" #define __BUILD__ __DATE__ " " __TIME__ -#define HOST_SW_API +#define HOST_SW_API #if defined(_WIN32) || defined(_WIN64) #define DEFAULT_CONF_FILE "config.yml" @@ -265,7 +265,7 @@ inline std::string strtoupper(const std::string value) { buffer[0U + offset] = (val >> 24) & 0xFFU; \ buffer[1U + offset] = (val >> 16) & 0xFFU; \ buffer[2U + offset] = (val >> 8) & 0xFFU; \ - buffer[3U + offset] = (val >> 0) & 0xFFU; + buffer[3U + offset] = (val >> 0) & 0xFFU; #define __GET_UINT32(buffer, offset) \ (buffer[offset + 0U] << 24) | \ (buffer[offset + 1U] << 16) | \ @@ -274,7 +274,7 @@ inline std::string strtoupper(const std::string value) { #define __SET_UINT16(val, buffer, offset) \ buffer[0U + offset] = (val >> 16) & 0xFFU; \ buffer[1U + offset] = (val >> 8) & 0xFFU; \ - buffer[2U + offset] = (val >> 0) & 0xFFU; + buffer[2U + offset] = (val >> 0) & 0xFFU; #define __GET_UINT16(buffer, offset) \ (buffer[offset + 0U] << 16) | \ (buffer[offset + 1U] << 8) | \ diff --git a/src/Log.cpp b/src/Log.cpp index 6ca26224..e705acf6 100644 --- a/src/Log.cpp +++ b/src/Log.cpp @@ -318,7 +318,7 @@ void Log(uint32_t level, const char *module, const char* fmt, ...) else { ::sprintf(buffer, "%c: %04u-%02u-%02u %02u:%02u:%02u.%03u ", LEVELS[level], st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds); } - } + } else { if (module != nullptr) { ::sprintf(buffer, "%c: (%s) ", LEVELS[level], module); @@ -340,7 +340,7 @@ void Log(uint32_t level, const char *module, const char* fmt, ...) else { ::sprintf(buffer, "%c: %04d-%02d-%02d %02d:%02d:%02d.%03lu ", LEVELS[level], tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, now.tv_usec / 1000U); } - } + } else { if (module != nullptr) { ::sprintf(buffer, "%c: (%s) ", LEVELS[level], module); diff --git a/src/dmr/Control.cpp b/src/dmr/Control.cpp index d44adff6..5ec7f36f 100644 --- a/src/dmr/Control.cpp +++ b/src/dmr/Control.cpp @@ -97,7 +97,7 @@ Control::Control(bool authoritative, uint32_t colorCode, uint32_t callHang, uint acl::AccessControl::init(m_ridLookup, m_tidLookup); Slot::init(this, authoritative, colorCode, SiteData(), embeddedLCOnly, dumpTAData, callHang, modem, network, duplex, m_ridLookup, m_tidLookup, m_idenTable, rssiMapper, jitter, verbose); - + m_slot1 = new Slot(1U, timeout, tgHang, queueSize, dumpDataPacket, repeatDataPacket, dumpCSBKData, debug, verbose); m_slot2 = new Slot(2U, timeout, tgHang, queueSize, dumpDataPacket, repeatDataPacket, dumpCSBKData, debug, verbose); @@ -185,7 +185,7 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::vectorsetSilenceThreshold(silenceThreshold); m_slot2->setSilenceThreshold(silenceThreshold); diff --git a/src/dmr/Control.h b/src/dmr/Control.h index c61b153c..f2f04d07 100644 --- a/src/dmr/Control.h +++ b/src/dmr/Control.h @@ -48,7 +48,7 @@ namespace dmr // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + class HOST_SW_API Slot; namespace packet { class HOST_SW_API ControlSignaling; } @@ -68,9 +68,9 @@ namespace dmr ~Control(); /// Helper to set DMR configuration options. - void setOptions(yaml::Node& conf, bool supervisor, const std::vector voiceChNo, const std::unordered_map voiceChData, + void setOptions(yaml::Node& conf, bool supervisor, const std::vector voiceChNo, const std::unordered_map voiceChData, uint32_t netId, uint8_t siteId, uint8_t channelId, uint32_t channelNo, bool printOptions); - + /// Gets a flag indicating whether the DMR control channel is running. bool getCCRunning() { return m_ccRunning; } /// Sets a flag indicating whether the DMR control channel is running. diff --git a/src/dmr/DMRDefines.h b/src/dmr/DMRDefines.h index f3553a1e..35772120 100644 --- a/src/dmr/DMRDefines.h +++ b/src/dmr/DMRDefines.h @@ -132,7 +132,7 @@ namespace dmr const uint8_t DMR_ALOHA_VER_151 = 0x00U; const uint8_t DMR_CHNULL = 0x00U; - + const uint16_t DMR_LOGICAL_CH_ABSOLUTE = 0xFFFU; const uint8_t DEFAULT_NRAND_WAIT = 8U; diff --git a/src/dmr/SiteData.h b/src/dmr/SiteData.h index f0eab21e..3c2553fc 100644 --- a/src/dmr/SiteData.h +++ b/src/dmr/SiteData.h @@ -121,7 +121,7 @@ namespace dmr break; case SITE_MODEL_HUGE: { - value = (value << 2) + (m_netId & 0x03U); + value = (value << 2) + (m_netId & 0x03U); value = (value << 10) + (m_siteId & 0x3FFU); } break; diff --git a/src/dmr/Slot.cpp b/src/dmr/Slot.cpp index 7ad75329..9ae73fc5 100644 --- a/src/dmr/Slot.cpp +++ b/src/dmr/Slot.cpp @@ -193,15 +193,15 @@ bool Slot::processFrame(uint8_t *data, uint32_t len) if (data[0U] == modem::TAG_LOST && m_rfState == RS_RF_AUDIO) { if (m_rssi != 0U) { - ::ActivityLog("DMR", true, "Slot %u RF voice transmission lost, %.1f seconds, BER: %.1f%%, RSSI: -%u/-%u/-%u dBm", + ::ActivityLog("DMR", true, "Slot %u RF voice transmission lost, %.1f seconds, BER: %.1f%%, RSSI: -%u/-%u/-%u dBm", m_slotNo, float(m_rfFrames) / 16.667F, float(m_rfErrs * 100U) / float(m_rfBits), m_minRSSI, m_maxRSSI, m_aveRSSI / m_rssiCount); } else { - ::ActivityLog("DMR", true, "Slot %u RF voice transmission lost, %.1f seconds, BER: %.1f%%", + ::ActivityLog("DMR", true, "Slot %u RF voice transmission lost, %.1f seconds, BER: %.1f%%", m_slotNo, float(m_rfFrames) / 16.667F, float(m_rfErrs * 100U) / float(m_rfBits)); } - LogMessage(LOG_RF, "DMR Slot %u, total frames: %d, total bits: %d, errors: %d, BER: %.4f%%", + LogMessage(LOG_RF, "DMR Slot %u, total frames: %d, total bits: %d, errors: %d, BER: %.4f%%", m_slotNo, m_rfFrames, m_rfBits, m_rfErrs, float(m_rfErrs * 100U) / float(m_rfBits)); // release trunked grant (if necessary) @@ -440,7 +440,7 @@ void Slot::clock() if ((m_dmr->m_tsccCnt % 2) == 0) { setShortLC_Payload(m_siteData, m_dmr->m_tsccCnt); } - } + } else { setShortLC_TSCC(m_siteData, m_dmr->m_tsccCnt); } @@ -514,7 +514,7 @@ void Slot::clock() if (m_netState == RS_NET_AUDIO) { // We've received the voice header haven't we? m_netFrames += 1U; - ::ActivityLog("DMR", false, "Slot %u network watchdog has expired, %.1f seconds, %u%% packet loss, BER: %.1f%%", + ::ActivityLog("DMR", false, "Slot %u network watchdog has expired, %.1f seconds, %u%% packet loss, BER: %.1f%%", m_slotNo, float(m_netFrames) / 16.667F, (m_netLost * 100U) / m_netFrames, float(m_netErrs * 100U) / float(m_netBits)); writeEndNet(true); } @@ -605,7 +605,7 @@ void Slot::setTSCC(bool enable, bool dedicated) /// /// /// -void Slot::setTSCCActivated(uint32_t dstId, uint32_t srcId, bool group, bool voice) +void Slot::setTSCCActivated(uint32_t dstId, uint32_t srcId, bool group, bool voice) { m_tsccPayloadDstId = dstId; m_tsccPayloadGroup = group; @@ -658,7 +658,7 @@ void Slot::init(Control* dmr, bool authoritative, uint32_t colorCode, SiteData s m_colorCode = colorCode; m_siteData = siteData; - + m_embeddedLCOnly = embeddedLCOnly; m_dumpTAData = dumpTAData; @@ -673,7 +673,7 @@ void Slot::init(Control* dmr, bool authoritative, uint32_t colorCode, SiteData s m_affiliations = new dmr::lookups::DMRAffiliationLookup(verbose); // set the grant release callback - m_affiliations->setReleaseGrantCallback([=](uint32_t chNo, uint32_t dstId, uint8_t slot) { + m_affiliations->setReleaseGrantCallback([=](uint32_t chNo, uint32_t dstId, uint8_t slot) { Slot* tscc = m_dmr->getTSCCSlot(); if (tscc != nullptr) { if (chNo == tscc->m_channelNo) { diff --git a/src/dmr/Slot.h b/src/dmr/Slot.h index afed14e8..5fd894a9 100644 --- a/src/dmr/Slot.h +++ b/src/dmr/Slot.h @@ -55,7 +55,7 @@ namespace dmr // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + class HOST_SW_API Control; namespace packet { class HOST_SW_API Voice; } namespace packet { class HOST_SW_API Data; } @@ -117,7 +117,7 @@ namespace dmr network::BaseNetwork* network, bool duplex, ::lookups::RadioIdLookup* ridLookup, ::lookups::TalkgroupIdLookup* tidLookup, ::lookups::IdenTableLookup* idenTable, ::lookups::RSSIInterpolator* rssiMapper, uint32_t jitter, bool verbose); /// Sets local configured site data. - static void setSiteData(const std::vector voiceChNo, const std::unordered_map voiceChData, + static void setSiteData(const std::vector voiceChNo, const std::unordered_map voiceChData, uint32_t netId, uint8_t siteId, uint8_t channelId, uint32_t channelNo, bool requireReq); /// Sets TSCC Aloha configuration. static void setAlohaConfig(uint8_t nRandWait, uint8_t backOff); diff --git a/src/dmr/lc/PrivacyLC.cpp b/src/dmr/lc/PrivacyLC.cpp index c898fe80..f18ee8c6 100644 --- a/src/dmr/lc/PrivacyLC.cpp +++ b/src/dmr/lc/PrivacyLC.cpp @@ -53,7 +53,7 @@ PrivacyLC::PrivacyLC(const uint8_t* data) : assert(data != nullptr); m_mi = new uint8_t[DMR_MI_LENGTH_BYTES]; - + m_group = (data[0U] & 0x20U) == 0x20U; m_algId = data[0U] & 7; // Algorithm ID diff --git a/src/dmr/lc/csbk/CSBKFactory.cpp b/src/dmr/lc/csbk/CSBKFactory.cpp index 64c31dc9..5be55ad6 100644 --- a/src/dmr/lc/csbk/CSBKFactory.cpp +++ b/src/dmr/lc/csbk/CSBKFactory.cpp @@ -120,7 +120,7 @@ std::unique_ptr CSBKFactory::createCSBK(const uint8_t* data) break; } - return nullptr; + return nullptr; } // --------------------------------------------------------------------------- @@ -128,7 +128,7 @@ std::unique_ptr CSBKFactory::createCSBK(const uint8_t* data) // --------------------------------------------------------------------------- /// -/// +/// /// /// /// diff --git a/src/dmr/lc/csbk/CSBK_ACK_RSP.cpp b/src/dmr/lc/csbk/CSBK_ACK_RSP.cpp index f41832bd..de4bbd98 100644 --- a/src/dmr/lc/csbk/CSBK_ACK_RSP.cpp +++ b/src/dmr/lc/csbk/CSBK_ACK_RSP.cpp @@ -64,7 +64,7 @@ bool CSBK_ACK_RSP::decode(const uint8_t* data) return false; ulong64_t csbkValue = CSBK::toValue(csbk); - + m_GI = (((csbkValue >> 56) & 0xFFU) & 0x40U) == 0x40U; // Group/Individual Flag m_reason = (uint8_t)((csbkValue >> 33) & 0xFFU); // Reason Code m_dstId = (uint32_t)((csbkValue >> 24) & 0xFFFFU); // Target Radio Address diff --git a/src/dmr/lc/csbk/CSBK_BSDWNACT.cpp b/src/dmr/lc/csbk/CSBK_BSDWNACT.cpp index 8235abcc..a484122d 100644 --- a/src/dmr/lc/csbk/CSBK_BSDWNACT.cpp +++ b/src/dmr/lc/csbk/CSBK_BSDWNACT.cpp @@ -65,7 +65,7 @@ bool CSBK_BSDWNACT::decode(const uint8_t* data) return false; ulong64_t csbkValue = CSBK::toValue(csbk); - + m_bsId = (uint32_t)((csbkValue >> 24) & 0xFFFFFFU); // Base Station Address m_srcId = (uint32_t)(csbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/dmr/lc/csbk/CSBK_CALL_ALRT.cpp b/src/dmr/lc/csbk/CSBK_CALL_ALRT.cpp index 7ce4546c..57f07cd4 100644 --- a/src/dmr/lc/csbk/CSBK_CALL_ALRT.cpp +++ b/src/dmr/lc/csbk/CSBK_CALL_ALRT.cpp @@ -65,7 +65,7 @@ bool CSBK_CALL_ALRT::decode(const uint8_t* data) return false; ulong64_t csbkValue = CSBK::toValue(csbk); - + m_GI = (((csbkValue >> 56) & 0xFFU) & 0x40U) == 0x40U; // Group/Individual Flag m_dstId = (uint32_t)((csbkValue >> 24) & 0xFFFFFFU); // Target Radio Address m_srcId = (uint32_t)(csbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/dmr/lc/csbk/CSBK_EXT_FNCT.cpp b/src/dmr/lc/csbk/CSBK_EXT_FNCT.cpp index 6a5a86e1..9b5570e9 100644 --- a/src/dmr/lc/csbk/CSBK_EXT_FNCT.cpp +++ b/src/dmr/lc/csbk/CSBK_EXT_FNCT.cpp @@ -85,7 +85,7 @@ void CSBK_EXT_FNCT::encode(uint8_t* data) ulong64_t csbkValue = 0U; - csbkValue = + csbkValue = (m_GI ? 0x40U : 0x00U) + // Group or Invididual (m_dataContent ? 0x80U : 0x00U); csbkValue = (csbkValue << 8) + m_extendedFunction; // Function diff --git a/src/dmr/lc/csbk/CSBK_PRECCSBK.cpp b/src/dmr/lc/csbk/CSBK_PRECCSBK.cpp index 2f574487..b7f1a469 100644 --- a/src/dmr/lc/csbk/CSBK_PRECCSBK.cpp +++ b/src/dmr/lc/csbk/CSBK_PRECCSBK.cpp @@ -64,7 +64,7 @@ bool CSBK_PRECCSBK::decode(const uint8_t* data) return false; ulong64_t csbkValue = CSBK::toValue(csbk); - + m_GI = (((csbkValue >> 56) & 0xFFU) & 0x40U) == 0x40U; // Group/Individual Flag m_dataContent = (((csbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // m_CBF = (uint8_t)((csbkValue >> 48) & 0xFFU); // Blocks to Follow diff --git a/src/dmr/lc/csbk/CSBK_RAW.h b/src/dmr/lc/csbk/CSBK_RAW.h index 5a255f8b..375292dc 100644 --- a/src/dmr/lc/csbk/CSBK_RAW.h +++ b/src/dmr/lc/csbk/CSBK_RAW.h @@ -54,7 +54,7 @@ namespace dmr /// Sets the CSBK to encode. void setCSBK(const uint8_t* csbk); - + private: uint8_t* m_csbk; }; diff --git a/src/dmr/lc/csbk/CSBK_TV_GRANT.h b/src/dmr/lc/csbk/CSBK_TV_GRANT.h index 03659df6..d1be7128 100644 --- a/src/dmr/lc/csbk/CSBK_TV_GRANT.h +++ b/src/dmr/lc/csbk/CSBK_TV_GRANT.h @@ -54,7 +54,7 @@ namespace dmr /// Flag indicating whether the grant is a late entry. __PROPERTY(bool, lateEntry, LateEntry); - __COPY(CSBK_TV_GRANT); + __COPY(CSBK_TV_GRANT); }; } // namespace csbk } // namespace lc diff --git a/src/dmr/lc/csbk/CSBK_UU_ANS_RSP.cpp b/src/dmr/lc/csbk/CSBK_UU_ANS_RSP.cpp index b401f15e..500c024f 100644 --- a/src/dmr/lc/csbk/CSBK_UU_ANS_RSP.cpp +++ b/src/dmr/lc/csbk/CSBK_UU_ANS_RSP.cpp @@ -64,7 +64,7 @@ bool CSBK_UU_ANS_RSP::decode(const uint8_t* data) return false; ulong64_t csbkValue = CSBK::toValue(csbk); - + m_dstId = (uint32_t)((csbkValue >> 24) & 0xFFFFFFU); // Target Radio Address m_srcId = (uint32_t)(csbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/dmr/lc/csbk/CSBK_UU_V_REQ.cpp b/src/dmr/lc/csbk/CSBK_UU_V_REQ.cpp index 8832a6a2..b0943f32 100644 --- a/src/dmr/lc/csbk/CSBK_UU_V_REQ.cpp +++ b/src/dmr/lc/csbk/CSBK_UU_V_REQ.cpp @@ -64,7 +64,7 @@ bool CSBK_UU_V_REQ::decode(const uint8_t* data) return false; ulong64_t csbkValue = CSBK::toValue(csbk); - + m_dstId = (uint32_t)((csbkValue >> 24) & 0xFFFFFFU); // Target Radio Address m_srcId = (uint32_t)(csbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/dmr/lookups/DMRAffiliationLookup.h b/src/dmr/lookups/DMRAffiliationLookup.h index 7229577b..bf805d29 100644 --- a/src/dmr/lookups/DMRAffiliationLookup.h +++ b/src/dmr/lookups/DMRAffiliationLookup.h @@ -72,6 +72,6 @@ namespace dmr uint8_t m_tsccSlot; }; } // namespace lookups -} // namespace dmr +} // namespace dmr #endif // __DMR_AFFILIATION_LOOKUP_H__ diff --git a/src/dmr/packet/ControlSignaling.h b/src/dmr/packet/ControlSignaling.h index b4aec562..f35cd77e 100644 --- a/src/dmr/packet/ControlSignaling.h +++ b/src/dmr/packet/ControlSignaling.h @@ -51,7 +51,7 @@ namespace dmr // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + class HOST_SW_API Slot; namespace packet diff --git a/src/dmr/packet/Data.cpp b/src/dmr/packet/Data.cpp index 8aa5bd80..98edcfbd 100644 --- a/src/dmr/packet/Data.cpp +++ b/src/dmr/packet/Data.cpp @@ -374,7 +374,7 @@ void Data::processNetwork(const data::Data& dmrData) m_slot->m_slotNo, float(m_slot->m_netFrames) / 16.667F, (m_slot->m_netLost * 100U) / m_slot->m_netFrames, float(m_slot->m_netErrs * 100U) / float(m_slot->m_netBits)); m_slot->m_dmr->tsccClearActivatedSlot(m_slot->m_slotNo); - + m_slot->writeEndNet(); } else if (dataType == DT_DATA_HEADER) { diff --git a/src/dmr/packet/Data.h b/src/dmr/packet/Data.h index 9acfe2fe..94498502 100644 --- a/src/dmr/packet/Data.h +++ b/src/dmr/packet/Data.h @@ -52,7 +52,7 @@ namespace dmr // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + namespace packet { class HOST_SW_API Voice; } namespace packet { class HOST_SW_API ControlSignaling; } class HOST_SW_API Slot; diff --git a/src/dmr/packet/Voice.cpp b/src/dmr/packet/Voice.cpp index c7b78014..c3eeaf0a 100644 --- a/src/dmr/packet/Voice.cpp +++ b/src/dmr/packet/Voice.cpp @@ -209,7 +209,7 @@ bool Voice::process(uint8_t* data, uint32_t len) } if (m_verbose) { - LogMessage(LOG_RF, DMR_DT_VOICE_LC_HEADER ", slot = %u, srcId = %u, dstId = %u, FLCO = $%02X, FID = $%02X, PF = %u", m_slot->m_slotNo, + LogMessage(LOG_RF, DMR_DT_VOICE_LC_HEADER ", slot = %u, srcId = %u, dstId = %u, FLCO = $%02X, FID = $%02X, PF = %u", m_slot->m_slotNo, m_slot->m_rfLC->getSrcId(), m_slot->m_rfLC->getDstId(), m_slot->m_rfLC->getFLCO(), m_slot->m_rfLC->getFID(), m_slot->m_rfLC->getPF()); } @@ -248,7 +248,7 @@ bool Voice::process(uint8_t* data, uint32_t len) m_slot->writeNetwork(data, DT_VOICE_PI_HEADER); if (m_verbose) { - LogMessage(LOG_RF, DMR_DT_VOICE_PI_HEADER ", slot = %u, algId = %u, kId = %u, dstId = %u", m_slot->m_slotNo, + LogMessage(LOG_RF, DMR_DT_VOICE_PI_HEADER ", slot = %u, algId = %u, kId = %u, dstId = %u", m_slot->m_slotNo, m_slot->m_rfPrivacyLC->getAlgId(), m_slot->m_rfPrivacyLC->getKId(), m_slot->m_rfPrivacyLC->getDstId()); } @@ -635,7 +635,7 @@ void Voice::processNetwork(const data::Data& dmrData) uint8_t data[DMR_FRAME_LENGTH_BYTES + 2U]; dmrData.getData(data + 2U); - + if (dataType == DT_VOICE_LC_HEADER) { if (m_slot->m_netState == RS_NET_AUDIO) return; diff --git a/src/dmr/packet/Voice.h b/src/dmr/packet/Voice.h index aee4827a..9ed14213 100644 --- a/src/dmr/packet/Voice.h +++ b/src/dmr/packet/Voice.h @@ -48,7 +48,7 @@ namespace dmr // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + namespace packet { class HOST_SW_API Data; } class HOST_SW_API Slot; diff --git a/src/edac/AMBEFEC.cpp b/src/edac/AMBEFEC.cpp index 22df851c..ed1d6c75 100644 --- a/src/edac/AMBEFEC.cpp +++ b/src/edac/AMBEFEC.cpp @@ -102,8 +102,8 @@ uint32_t AMBEFEC::regenerateDMR(uint8_t* bytes) const if (READ_BIT(bytes, b2Pos)) b2 |= MASK; if (READ_BIT(bytes, b3Pos)) - b3 |= MASK; - } + b3 |= MASK; + } MASK = 0x1000000U; for (uint32_t i = 0U; i < 25U; i++, MASK >>= 1) { @@ -209,8 +209,8 @@ uint32_t AMBEFEC::measureDMRBER(const uint8_t* bytes) const if (READ_BIT(bytes, b2Pos)) b2 |= MASK; if (READ_BIT(bytes, b3Pos)) - b3 |= MASK; - } + b3 |= MASK; + } MASK = 0x1000000U; for (uint32_t i = 0U; i < 25U; i++, MASK >>= 1) { diff --git a/src/edac/AMBEFEC.h b/src/edac/AMBEFEC.h index 63593b1e..813886ff 100644 --- a/src/edac/AMBEFEC.h +++ b/src/edac/AMBEFEC.h @@ -451,7 +451,7 @@ namespace edac 0xECDB0FU, 0xB542DAU, 0x9E5131U, 0xC7ABA5U, 0x8C38FEU, 0x97010BU, 0xDED290U, 0xA4CC7DU, 0xAD3D2EU, 0xF6B6B3U, 0xF9A540U, 0x205ED9U, 0x634EB6U, 0x5A9567U, 0x11A6D8U, 0x0B3F09U }; - const uint32_t AMBE_A_TABLE[] = { + const uint32_t AMBE_A_TABLE[] = { 0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U, 32U, 36U, 40U, 44U, 48U, 52U, 56U, 60U, 64U, 68U, 1U, 5U, 9U, 13U, 17U, 21U }; const uint32_t AMBE_B_TABLE[] = { diff --git a/src/edac/BCH.cpp b/src/edac/BCH.cpp index 2755ef75..195376d4 100644 --- a/src/edac/BCH.cpp +++ b/src/edac/BCH.cpp @@ -96,9 +96,9 @@ using namespace edac; const int length = 63; const int k = 16; -const int g[] = { +const int g[] = { 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, - 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1 + 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1 }; // --------------------------------------------------------------------------- diff --git a/src/edac/CRC.cpp b/src/edac/CRC.cpp index ab8b362d..38c44ee7 100644 --- a/src/edac/CRC.cpp +++ b/src/edac/CRC.cpp @@ -474,7 +474,7 @@ uint16_t CRC::crc9(const uint8_t* in, uint32_t bitLength) #if DEBUG_CRC_CHECK LogDebug(LOG_HOST, "CRC::crc9(), crc = $%03X, bitlen = %u", crc, bitLength); #endif - + return crc; } @@ -717,7 +717,7 @@ uint16_t CRC::addCRC16(uint8_t* in, uint32_t bitLength) // --------------------------------------------------------------------------- /// -/// +/// /// /// Input byte array. /// Length of byte array in bits. @@ -740,7 +740,7 @@ uint8_t CRC::createCRC6(const uint8_t* in, uint32_t bitLength) } /// -/// +/// /// /// Input byte array. /// Length of byte array in bits. @@ -763,7 +763,7 @@ uint16_t CRC::createCRC12(const uint8_t* in, uint32_t bitLength) } /// -/// +/// /// /// Input byte array. /// Length of byte array in bits. @@ -786,7 +786,7 @@ uint16_t CRC::createCRC15(const uint8_t* in, uint32_t bitLength) } /// -/// +/// /// /// Input byte array. /// Length of byte array in bits. diff --git a/src/edac/Golay24128.h b/src/edac/Golay24128.h index 8bb64054..ac1afbcd 100644 --- a/src/edac/Golay24128.h +++ b/src/edac/Golay24128.h @@ -37,7 +37,7 @@ namespace edac { // --------------------------------------------------------------------------- // Class Declaration - // Implements Golay (23,12,7) and Golay (24,12,8) forward error + // Implements Golay (23,12,7) and Golay (24,12,8) forward error // correction. // --------------------------------------------------------------------------- diff --git a/src/edac/SHA256.cpp b/src/edac/SHA256.cpp index 184ede64..5d8d279a 100644 --- a/src/edac/SHA256.cpp +++ b/src/edac/SHA256.cpp @@ -61,9 +61,9 @@ using namespace edac; // Constants // --------------------------------------------------------------------------- -/* +/* * This array contains the bytes used to pad the buffer to the next 64-byte - * boundary. + * boundary. */ static const uint8_t fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; diff --git a/src/edac/SHA256.h b/src/edac/SHA256.h index bf44e366..b7fd6ec0 100644 --- a/src/edac/SHA256.h +++ b/src/edac/SHA256.h @@ -90,7 +90,7 @@ namespace edac /// void init(); - /// Process the remaining bytes in the internal buffer and the usual prolog according to + /// Process the remaining bytes in the internal buffer and the usual prolog according to /// the standard and write the result to the buffer. void conclude(); }; diff --git a/src/edac/rs/RS.h b/src/edac/rs/RS.h index e17a3c34..9cb2e371 100755 --- a/src/edac/rs/RS.h +++ b/src/edac/rs/RS.h @@ -29,7 +29,7 @@ */ /* * Ezpwd Reed-Solomon -- Reed-Solomon encoder / decoder library - * + * * Copyright (c) 2014, Hard Consulting Corporation. * * Ezpwd Reed-Solomon is free software: you can redistribute it and/or modify it under the terms of @@ -38,43 +38,43 @@ * source tree. Ezpwd Reed-Solomon is also available under Commercial license. The * c++/ezpwd/rs_base file is redistributed under the terms of the LGPL, regardless of the overall * licensing terms. - * + * * Ezpwd Reed-Solomon is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. - * + * * The core Reed-Solomon codec implementation in c++/ezpwd/rs_base is by Phil Karn, converted to C++ * by Perry Kundert (perry@hardconsulting.com), and may be used under the terms of the LGPL. Here * is the terms from Phil's README file (see phil-karn/fec-3.0.1/README): - * + * * COPYRIGHT - * + * * This package is copyright 2006 by Phil Karn, KA9Q. It may be used * under the terms of the GNU Lesser General Public License (LGPL). See * the file "lesser.txt" in this package for license details. - * + * * The c++/ezpwd/rs_base file is, therefore, redistributed under the terms of the LGPL, while the * rest of Ezpwd Reed-Solomon is distributed under either the GPL or Commercial licenses. * Therefore, even if you have obtained Ezpwd Reed-Solomon under a Commercial license, you must make * available the source code of the c++/ezpwd/rs_base file with your product. One simple way to * accomplish this is to include the following URL in your code or documentation: - * + * * https://github.com/pjkundert/ezpwd-reed-solomon/blob/master/c++/ezpwd/rs_base - * - * + * + * * The Linux 3.15.1 version of lib/reed_solomon was also consulted as a cross-reference, which (in * turn) is basically verbatim copied from Phil Karn's LGPL implementation, to ensure that no new * defects had been found and fixed; there were no meaningful changes made to Phil's implementation. * I've personally been using Phil's implementation for years in a heavy industrial use, and it is * rock-solid. - * + * * However, both Phil's and the Linux kernel's (copy of Phil's) implementation will return a * "corrected" decoding with impossible error positions, in some cases where the error load * completely overwhelms the R-S encoding. These cases, when detected, are rejected in this * implementation. This could be considered a defect in Phil's (and hence the Linux kernel's) * implementations, which results in them accepting clearly incorrect R-S decoded values as valid * (corrected) R-S codewords. We chose the report failure on these attempts. - * + * */ #if !defined(__RS_H__) #define __RS_H__ @@ -91,14 +91,14 @@ #include #include -// +// // Preprocessor defines available: -// +// // EZPWD_NO_EXCEPTS -- define to use no exceptions; return -1, or abort on catastrophic failures // EZPWD_NO_MOD_TAB -- define to force no "modnn" Galois modulo table acceleration // EZPWD_ARRAY_SAFE -- define to force usage of bounds-checked arrays for most tabular data // EZPWD_ARRAY_TEST -- define to force erroneous sizing of some arrays for non-production testing -// +// #if defined(EZPWD_NO_EXCEPTS) #include @@ -114,7 +114,7 @@ namespace edac { - namespace rs + namespace rs { // ezpwd::log_ -- compute the log base B of N at compile-time template struct log_{ enum { value = 1 + log_::value }; }; @@ -147,27 +147,27 @@ namespace edac /// virtual std::ostream &output(std::ostream &lhs) const { return lhs << "RS(" << this->size() << "," << this->load() << ")"; } - // + // // {en,de}code -- Compute/Correct errors/erasures in a Reed-Solomon encoded container - // + // // The encoded parity symbols may be included in 'data' (len includes nroots() parity // symbols), or may (optionally) supplied separately in (at least nroots()-sized) - // 'parity'. - // + // 'parity'. + // // For decode, optionally specify some known erasure positions (up to nroots()). If // non-empty 'erasures' is provided, it contains the positions of each erasure. If a // non-zero pointer to a 'position' vector is provided, its capacity will be increased to // be capable of storing up to 'nroots()' ints; the actual deduced error locations will be // returned. - // + // // RETURN VALUE - // + // // Return -1 on error. The encode returns the number of parity symbols produced; // decode returns the number of symbols corrected. Both errors and erasures are included, // so long as they are actually different than the deduced value. In other words, if a // symbol is marked as an erasure but it actually turns out to be correct, it's index will // NOT be included in the returned count, nor the modified erasure vector! - // + // int encode(std::string &data) const { @@ -180,7 +180,7 @@ namespace edac int encode(const std::string &data, std::string &parity) const { typedef uint8_t uT; - typedef std::pair cuTpair; + typedef std::pair cuTpair; typedef std::pair uTpair; parity.resize(nroots()); return encode(cuTpair((const uT*)&data.front(), (const uT*)&data.front() + data.size()), @@ -195,10 +195,10 @@ namespace edac return encode(uTpair((uT*)&data.front(), (uT*)&data.front() + data.size())); } - template int encode(const std::vector&data, std::vector &parity) const + template int encode(const std::vector&data, std::vector &parity) const { typedef typename std::make_unsigned::type uT; - typedef std::pair cuTpair; + typedef std::pair cuTpair; typedef std::pair uTpair; parity.resize(nroots()); return encode(cuTpair((uT*)&data.front(), (uT*)&data.front() + data.size()), @@ -213,8 +213,8 @@ namespace edac } virtual int encode(const std::pair &data) const = 0; - - virtual int encode(const std::pair &data, + + virtual int encode(const std::pair &data, const std::pair &parity) const = 0; virtual int encode(const std::pair &data) const = 0; virtual int encode(const std::pair &data, @@ -223,7 +223,7 @@ namespace edac virtual int encode(const std::pair &data, const std::pair &parity) const = 0; - int decode(std::string &data, const std::vector &erasure = std::vector(), + int decode(std::string &data, const std::vector &erasure = std::vector(), std::vector* position = 0) const { typedef uint8_t uT; @@ -231,16 +231,16 @@ namespace edac return decode(uTpair((uT*)&data.front(), (uT*)&data.front() + data.size()), erasure, position); } - int decode(std::string &data, std::string &parity, const std::vector &erasure = std::vector(), + int decode(std::string &data, std::string &parity, const std::vector &erasure = std::vector(), std::vector* position = 0) const { typedef uint8_t uT; typedef std::pair uTpair; - return decode(uTpair((uT*)&data.front(), (uT*)&data.front() + data.size()), + return decode(uTpair((uT*)&data.front(), (uT*)&data.front() + data.size()), uTpair((uT*)&parity.front(), (uT*)&parity.front() + parity.size()), erasure, position); } - template int decode(std::vector &data, const std::vector &erasure = std::vector(), + template int decode(std::vector &data, const std::vector &erasure = std::vector(), std::vector* position = 0) const { typedef typename std::make_unsigned::type uT; @@ -248,7 +248,7 @@ namespace edac return decode(uTpair((uT*)&data.front(), (uT*)&data.front() + data.size()), erasure, position); } - template int decode(std::vector &data, std::vector &parity, + template int decode(std::vector &data, std::vector &parity, const std::vector &erasure = std::vector(), std::vector* position = 0) const { typedef typename std::make_unsigned::type uT; @@ -257,7 +257,7 @@ namespace edac uTpair((uT*)&parity.front(), (uT*)&parity.front() + parity.size()), erasure, position); } - template int decode(std::array &data, int pad = 0, + template int decode(std::array &data, int pad = 0, const std::vector &erasure = std::vector(), std::vector* position = 0) const { typedef typename std::make_unsigned::type uT; @@ -269,21 +269,21 @@ namespace edac const std::vector &erasure = std::vector(), std::vector* position = 0) const = 0; virtual int decode(const std::pair &data, const std::pair &parity, const std::vector &erasure = std::vector(), std::vector* position = 0) const = 0; - virtual int decode(const std::pair &data, + virtual int decode(const std::pair &data, const std::vector &erasure = std::vector(), std::vector* position = 0) const = 0; - virtual int decode(const std::pair &data, const std::pair &parity, + virtual int decode(const std::pair &data, const std::pair &parity, const std::vector &erasure = std::vector(), std::vector* position = 0) const = 0; virtual int decode(const std::pair &data, const std::vector &erasure = std::vector(), std::vector* position = 0) const = 0; - virtual int decode(const std::pair &data, const std::pair &parity, + virtual int decode(const std::pair &data, const std::pair &parity, const std::vector &erasure = std::vector(), std::vector* position= 0 ) const = 0; }; - // + // // std::ostream << edac::rs::reed_solomon<...> - // + // // Output a R-S codec description in standard form eg. RS(255,253) - // + // inline std::ostream &operator<<(std::ostream &lhs, const edac::rs::reed_solomon_base &rhs) { return rhs.output(lhs); } // --------------------------------------------------------------------------- @@ -306,7 +306,7 @@ namespace edac return sr; } }; - + // --------------------------------------------------------------------------- // Class Declaration // R-S tables common to all RS(NN,*) with same SYM, PRM and PLY. @@ -324,7 +324,7 @@ namespace edac static const int SIZE = (1 << SYM) - 1; // maximum symbols in field static const int NN = SIZE; static const int A0 = SIZE; - + // modulo table: 1/2 the symbol size squared, up to 4k static const int MODS = SYM > 8 ? (1 << 12) : (1 << SYM << SYM / 2); @@ -351,7 +351,7 @@ namespace edac // Generate Galois field lookup tables index_of[0] = A0; // log(zero) = -inf alpha_to[A0] = 0; // alpha**-inf = 0 - + PLY poly; int sr = poly(0); for (int i = 0; i < NN; i++) { @@ -380,7 +380,7 @@ namespace edac /// Finalizes a instance of the reed_solomon_tabs class. virtual ~reed_solomon_tabs() { /* stub */ } - // + // // modnn -- modulo replacement for galois field arithmetics, optionally w/ table acceleration // // @x: the value to reduce (will never be -'ve) @@ -407,7 +407,7 @@ namespace edac x -= NN; x = (x >> MM) + (x & NN); } - + if ( MODS && x >= NN) { x = mod_of[x - NN]; } @@ -415,7 +415,7 @@ namespace edac } }; - + // --------------------------------------------------------------------------- // Class Declaration // Reed-Solomon codec. @@ -436,7 +436,7 @@ namespace edac // All reed_solomon instances with the same template type parameters share a common // (static) set of alpha_to, index_of and genpoly tables. The first instance to be constructed // initializes the tables. - // + // // Each specialized type of reed_solomon implements a specific encode/decode method // appropriate to its datum 'TYP'. When accessed via a generic reed_solomon_base pointer, only // access via "safe" (size specifying) containers or iterators is available. @@ -480,7 +480,7 @@ namespace edac #if DEBUG_RS LogDebug(LOG_HOST, "reed_solomon::reed_solomon() RS(%d,%d): initialized for %d roots", SIZE, LOAD, NROOTS); #endif - + std::array tmppoly; // uninitialized // Form RS code generator polynomial from its roots. Only lower-index entries are @@ -488,7 +488,7 @@ namespace edac tmppoly[0] = 1; for (int i = 0, root = FCR * PRM; i < NROOTS; i++, root += PRM) { tmppoly[i + 1] = 1; - + // Multiply tmppoly[] by @**(root + x) for (int j = i; j > 0; j--) { if (tmppoly[j] != 0) { @@ -497,7 +497,7 @@ namespace edac tmppoly[j] = tmppoly[j - 1]; } } - + // tmppoly[0] can never be zero tmppoly[0] = alpha_to[modnn(index_of[tmppoly[0]] + root)]; } @@ -524,18 +524,18 @@ namespace edac using reed_solomon_base::encode; virtual int encode(const std::pair &data) const { return encode_mask(data.first, data.second - data.first - NROOTS, data.second - NROOTS); } - virtual int encode(const std::pair &data, + virtual int encode(const std::pair &data, const std::pair &parity) const { if (parity.second - parity.first != NROOTS) { EZPWD_RAISE_OR_RETURN(std::runtime_error, "reed-solomon: parity length incompatible with number of roots", -1); } - + return encode_mask(data.first, data.second - data.first, parity.first); } virtual int encode(const std::pair &data) const { return encode_mask(data.first, data.second - data.first - NROOTS, data.second - NROOTS); } - virtual int encode(const std::pair &data, + virtual int encode(const std::pair &data, const std::pair &parity) const { if (parity.second - parity.first != NROOTS) { @@ -546,7 +546,7 @@ namespace edac } virtual int encode(const std::pair &data) const { return encode_mask(data.first, data.second - data.first - NROOTS, data.second - NROOTS); } - virtual int encode(const std::pair &data, + virtual int encode(const std::pair &data, const std::pair &parity) const { if (parity.second - parity.first != NROOTS) { @@ -574,7 +574,7 @@ namespace edac if (SYMBOL > INPUT) { EZPWD_RAISE_OR_RETURN(std::runtime_error, "reed-solomon: output data type too small to contain symbols", -1); } - + std::array tmp; TYP msk = static_cast(~0UL << SYMBOL); for (int i = 0; i < len; ++i) { @@ -600,7 +600,7 @@ namespace edac return NROOTS; } - + using reed_solomon_base::decode; virtual int decode(const std::pair &data, const std::vector &erasure = std::vector(), std::vector* position = 0) const @@ -608,7 +608,7 @@ namespace edac return decode_mask(data.first, data.second - data.first, (uint8_t*)0, erasure, position); } - virtual int decode(const std::pair &data, const std::pair &parity, + virtual int decode(const std::pair &data, const std::pair &parity, const std::vector &erasure = std::vector(), std::vector* position = 0) const { if (parity.second - parity.first != NROOTS) { @@ -618,7 +618,7 @@ namespace edac return decode_mask(data.first, data.second - data.first, parity.first, erasure, position); } - virtual int decode(const std::pair &data, + virtual int decode(const std::pair &data, const std::vector &erasure = std::vector(), std::vector* position = 0) const { return decode_mask(data.first, data.second - data.first, (uint16_t*)0, erasure, position); @@ -634,13 +634,13 @@ namespace edac return decode_mask(data.first, data.second - data.first, parity.first, erasure, position); } - virtual int decode(const std::pair &data, + virtual int decode(const std::pair &data, const std::vector &erasure = std::vector(), std::vector* position = 0) const { return decode_mask(data.first, data.second - data.first, (uint32_t*)0, erasure, position); } - virtual int decode(const std::pair &data, const std::pair &parity, + virtual int decode(const std::pair &data, const std::pair &parity, const std::vector &erasure = std::vector(), std::vector* position= 0 ) const { if (parity.second - parity.first != NROOTS) { @@ -650,14 +650,14 @@ namespace edac return decode_mask(data.first, data.second - data.first, parity.first, erasure, position); } - // + // // decode_mask -- mask INP data into valid SYMBOL data - // + // // Incoming data may be in a variety of sizes, and may contain information beyond the // R-S symbol capacity. For example, we might use a 6-bit R-S symbol to correct the lower // 6 bits of an 8-bit data character. This would allow us to correct common substitution // errors (such as '2' for '3', 'R' for 'T', 'n' for 'm'). - // + // template int decode_mask(INP *data, int len, INP *parity = 0, const std::vector &erasure = std::vector(), @@ -870,7 +870,7 @@ namespace edac #if DEBUG_RS // Test code that verifies the erasure locator polynomial just constructed // Needed only for decoder debugging. - + // find roots of the erasure location polynomial for (int i = 1; i<= no_eras; i++) { reg[i] = index_of[lambda[i]]; @@ -955,7 +955,7 @@ namespace edac if (2 * el <= r + no_eras - 1) { el = r + no_eras - el; - + // 2 lines below: B(x) <-- inv(discr_r) * lambda(x) for (int i = 0; i <= NROOTS; i++) { b[i] = ((lambda[i] == 0) ? A0 : modnn(index_of[lambda[i]] - discr_r + NN)); @@ -1067,7 +1067,7 @@ namespace edac // correction location outside of the data and parity we've been provided! #if DEBUG_RS std::stringstream ss; - ss << "reed_solomon::decode(): ERROR: RS(" << SIZE <<"," << LOAD << ") computed error location: " << loc[j] << + ss << "reed_solomon::decode(): ERROR: RS(" << SIZE <<"," << LOAD << ") computed error location: " << loc[j] << " within " << pad << " pad symbols, not within " << LOAD - pad << " data or " << NROOTS << " parity"; LogDebug(LOG_HOST, "%s", ss.str().c_str()); #endif @@ -1113,7 +1113,7 @@ finish: errors[2 * (eras_pos[i]) + 0] = 'e'; errors[2 * (eras_pos[i]) + 1] = 'e'; } - + std::stringstream ss; ss << "reed_solomon::decode(): e)rase, E)rror; count = " << count << ": " << std::endl << errors; LogDebug(LOG_HOST, "%s", ss.str().c_str()); @@ -1129,12 +1129,12 @@ finish: } }; - // + // // Define the static reed_solomon...<...> members; allowed in header for template types. - // + // // The reed_solomon_tags<...>::iprim < 0 is used to indicate to the first instance that the // static tables require initialization. - // + // template int reed_solomon_tabs::iprim = -1; template std::array::NN + 1> reed_solomon_tabs::alpha_to; template std::array::NN + 1> reed_solomon_tabs::index_of; @@ -1142,5 +1142,5 @@ finish: template std::array::NROOTS + 1> reed_solomon::genpoly; } // namespace rs } // namespace edac - + #endif // __RS_H__ diff --git a/src/host/Host.cpp b/src/host/Host.cpp index 79308f9a..b99f5a6a 100644 --- a/src/host/Host.cpp +++ b/src/host/Host.cpp @@ -570,7 +570,7 @@ int Host::run() } nxdn = std::unique_ptr(new nxdn::Control(m_authoritative, m_nxdnRAN, callHang, m_nxdnQueueSizeBytes, m_timeout, m_rfTalkgroupHang, - m_modem, m_network, m_duplex, m_ridLookup, m_tidLookup, m_idenTable, rssi, + m_modem, m_network, m_duplex, m_ridLookup, m_tidLookup, m_idenTable, rssi, nxdnDumpRcchData, nxdnDebug, nxdnVerbose)); nxdn->setOptions(m_conf, m_supervisor, m_cwCallsign, m_voiceChNo, m_voiceChData, m_siteId, m_sysId, m_channelId, m_channelNo, true); @@ -974,7 +974,7 @@ int Host::run() // if the state is P25; write P25 data if (m_state == STATE_P25) { m_modem->writeP25Data(data, len); - + INTERRUPT_DMR_BEACON; // if there is a NXDN CC running; halt the CC @@ -983,7 +983,7 @@ int Host::run() INTERRUPT_NXDN_CONTROL; } } - + m_modeTimer.start(); } } @@ -994,7 +994,7 @@ int Host::run() } if (nextLen == 0U) { - // if we have no P25 data, and we're either idle or P25 state, check if we + // if we have no P25 data, and we're either idle or P25 state, check if we // need to be starting the CC running flag or writing end of voice call data if (m_state == STATE_IDLE || m_state == STATE_P25) { if (p25->getCCHalted()) { @@ -1052,9 +1052,9 @@ int Host::run() // if the state is NXDN; write NXDN data if (m_state == STATE_NXDN) { m_modem->writeNXDNData(data, len); - + INTERRUPT_DMR_BEACON; - + // if there is a P25 CC running; halt the CC if (p25 != nullptr) { if (p25->getCCRunning() && !p25->getCCHalted()) { @@ -1096,9 +1096,9 @@ int Host::run() if (ret) { m_modeTimer.setTimeout(m_rfModeHang); setState(STATE_DMR); - + START_DMR_DUPLEX_IDLE(true); - + INTERRUPT_DMR_BEACON; INTERRUPT_P25_CONTROL; INTERRUPT_NXDN_CONTROL; @@ -1597,7 +1597,7 @@ int Host::run() m_modem->clearDMRData1(); m_modem->clearDMRData2(); } - + dmr->setCCRunning(false); dmr->setCCHalted(true); @@ -1712,7 +1712,7 @@ bool Host::readParams() if (!systemConf["modeHang"].isNone()) { m_rfModeHang = m_netModeHang = systemConf["modeHang"].as(); } - + m_activeTickDelay = (uint8_t)systemConf["activeTickDelay"].as(5U); if (m_activeTickDelay < 1U) m_activeTickDelay = 1U; @@ -1957,7 +1957,7 @@ bool Host::createModem() } if (dmrQueueSize > 100U) { LogWarning(LOG_HOST, "DMR queue size must be less then 100 frames, defaulting to 100 frames!"); - dmrQueueSize = 100U; + dmrQueueSize = 100U; } if (dmrQueueSize > 60U) { LogWarning(LOG_HOST, "DMR queue size is excessive, >60 frames!"); @@ -1975,7 +1975,7 @@ bool Host::createModem() } if (p25QueueSize > 50U) { LogWarning(LOG_HOST, "P25 queue size must be less then 50 frames, defaulting to 50 frames!"); - p25QueueSize = 50U; + p25QueueSize = 50U; } if (p25QueueSize > 30U) { LogWarning(LOG_HOST, "P25 queue size is excessive, >30 frames!"); @@ -1993,7 +1993,7 @@ bool Host::createModem() } if (nxdnQueueSize > 50U) { LogWarning(LOG_HOST, "NXDN queue size must be less then 50 frames, defaulting to 50 frames!"); - nxdnQueueSize = 50U; + nxdnQueueSize = 50U; } m_nxdnQueueSizeBytes = nxdnQueueSize * nxdn::NXDN_FRAME_LENGTH_BYTES; @@ -2007,7 +2007,7 @@ bool Host::createModem() #else m_useDFSI = false; #endif // defined(ENABLE_P25) && defined(ENABLE_DFSI) - + yaml::Node uartProtocol = modemProtocol["uart"]; std::string uartPort = uartProtocol["port"].as(); uint32_t uartSpeed = uartProtocol["speed"].as(115200); @@ -2209,14 +2209,14 @@ bool Host::createModem() LogInfo(" Debug: yes"); } - m_modem = new Modem(modemPort, m_duplex, rxInvert, txInvert, pttInvert, dcBlocker, cosLockout, fdmaPreamble, dmrRxDelay, p25CorrCount, + m_modem = new Modem(modemPort, m_duplex, rxInvert, txInvert, pttInvert, dcBlocker, cosLockout, fdmaPreamble, dmrRxDelay, p25CorrCount, m_dmrQueueSizeBytes, m_p25QueueSizeBytes, m_nxdnQueueSizeBytes, disableOFlowReset, ignoreModemConfigArea, dumpModemStatus, trace, debug); if (!m_modemRemote) { m_modem->setModeParams(m_dmrEnabled, m_p25Enabled, m_nxdnEnabled); m_modem->setLevels(rxLevel, cwIdTXLevel, dmrTXLevel, p25TXLevel, nxdnTXLevel); m_modem->setSymbolAdjust(dmrSymLevel3Adj, dmrSymLevel1Adj, p25SymLevel3Adj, p25SymLevel1Adj, nxdnSymLevel3Adj, nxdnSymLevel1Adj); m_modem->setDCOffsetParams(txDCOffset, rxDCOffset); - m_modem->setRFParams(m_rxFrequency, m_txFrequency, rxTuning, txTuning, rfPower, dmrDiscBWAdj, p25DiscBWAdj, nxdnDiscBWAdj, dmrPostBWAdj, + m_modem->setRFParams(m_rxFrequency, m_txFrequency, rxTuning, txTuning, rfPower, dmrDiscBWAdj, p25DiscBWAdj, nxdnDiscBWAdj, dmrPostBWAdj, p25PostBWAdj, nxdnPostBWAdj, adfGainMode, afcEnable, afcKI, afcKP, afcRange); m_modem->setSoftPot(rxCoarse, rxFine, txCoarse, txFine, rssiCoarse, rssiFine); m_modem->setDMRColorCode(m_dmrColorCode); @@ -2512,7 +2512,7 @@ void Host::setState(uint8_t state) m_modem->writeDMRStart(false); m_dmrTXTimer.stop(); } - + m_state = HOST_STATE_ERROR; m_modeTimer.stop(); m_cwIdTimer.stop(); @@ -2527,7 +2527,7 @@ void Host::setState(uint8_t state) m_modem->writeDMRStart(false); m_dmrTXTimer.stop(); } - + m_modem->setState(STATE_IDLE); m_modem->clearDMRData1(); diff --git a/src/host/Host.h b/src/host/Host.h index 79193515..e83f2955 100644 --- a/src/host/Host.h +++ b/src/host/Host.h @@ -82,7 +82,7 @@ private: modem::port::IModemPort* m_modemRemotePort; uint8_t m_state; - + Timer m_modeTimer; Timer m_dmrTXTimer; Timer m_cwIdTimer; @@ -114,7 +114,7 @@ private: uint32_t m_txFrequency; uint8_t m_channelId; uint32_t m_channelNo; - + std::vector m_voiceChNo; std::unordered_map m_voiceChData; @@ -161,7 +161,7 @@ private: bool createModem(); /// Initializes network connectivity. bool createNetwork(); - + /// Modem port open callback. bool rmtPortModemOpen(modem::Modem* modem); /// Modem port close callback. diff --git a/src/host/calibrate/HostCal.cpp b/src/host/calibrate/HostCal.cpp index a9304eee..63b631f0 100644 --- a/src/host/calibrate/HostCal.cpp +++ b/src/host/calibrate/HostCal.cpp @@ -2011,7 +2011,7 @@ void HostCal::processDMR1KBER(const uint8_t* buffer, uint8_t seq) uint8_t dmrSeq = seq & 0x0FU; if (dmrSeq > 5U) dmrSeq = 5U; - + errs = 0U; for (uint32_t i = 0U; i < 33U; i++) errs += countErrs(buffer[i], VOICE_1K[i]); @@ -2068,7 +2068,7 @@ void HostCal::processP25BER(const uint8_t* buffer) else { LogMessage(LOG_CAL, P25_HDU_STR ", dstId = %u, algo = %X, kid = %X", lc.getDstId(), lc.getAlgId(), lc.getKId()); } - + m_berBits = 0U; m_berErrs = 0U; m_berFrames = 0U; @@ -2098,7 +2098,7 @@ void HostCal::processP25BER(const uint8_t* buffer) m_berUndecodableLC++; } else { - LogMessage(LOG_CAL, P25_LDU1_STR " LC, mfId = $%02X, lco = $%02X, emerg = %u, encrypt = %u, prio = %u, group = %u, srcId = %u, dstId = %u", + LogMessage(LOG_CAL, P25_LDU1_STR " LC, mfId = $%02X, lco = $%02X, emerg = %u, encrypt = %u, prio = %u, group = %u, srcId = %u, dstId = %u", lc.getMFId(), lc.getLCO(), lc.getEmergency(), lc.getEncrypted(), lc.getPriority(), lc.getGroup(), lc.getSrcId(), lc.getDstId()); } @@ -2150,7 +2150,7 @@ void HostCal::processP25BER(const uint8_t* buffer) m_berUndecodableLC++; } else { - LogMessage(LOG_CAL, P25_LDU2_STR " LC, mfId = $%02X, algo = %X, kid = %X", + LogMessage(LOG_CAL, P25_LDU2_STR " LC, mfId = $%02X, algo = %X, kid = %X", lc.getMFId(), lc.getAlgId(), lc.getKId()); } @@ -2216,7 +2216,7 @@ void HostCal::processP25BER(const uint8_t* buffer) } else { LogMessage(LOG_CAL, P25_PDU_STR ", ack = %u, outbound = %u, fmt = $%02X, mfId = $%02X, sap = $%02X, fullMessage = %u, blocksToFollow = %u, padCount = %u, n = %u, seqNo = %u, lastFragment = %u, hdrOffset = %u", - dataHeader.getAckNeeded(), dataHeader.getOutbound(), dataHeader.getFormat(), dataHeader.getMFId(), dataHeader.getSAP(), dataHeader.getFullMessage(), + dataHeader.getAckNeeded(), dataHeader.getOutbound(), dataHeader.getFormat(), dataHeader.getMFId(), dataHeader.getSAP(), dataHeader.getFullMessage(), dataHeader.getBlocksToFollow(), dataHeader.getPadCount(), dataHeader.getNs(), dataHeader.getFSN(), dataHeader.getLastFragment(), dataHeader.getHeaderOffset()); } @@ -2477,7 +2477,7 @@ bool HostCal::writeConfig(uint8_t modeOverride) m_conf["system"]["modem"]["dmrRxDelay"] = __INT_STR(m_modem->m_dmrRxDelay); buffer[10U] = m_modem->m_dmrRxDelay; - + uint32_t nac = 0xF7EU; buffer[11U] = (nac >> 4) & 0xFFU; buffer[12U] = (nac << 4) & 0xF0U; @@ -2821,7 +2821,7 @@ bool HostCal::eraseFlash() m_updateConfigFromModem = false; LogMessage(LOG_CAL, " - Erased configuration area on modem"); - + m_modem->clock(0U); return true; } @@ -2868,7 +2868,7 @@ bool HostCal::writeFlash() buffer[16U] = (uint8_t)(m_modem->m_txDCOffset + 128); buffer[17U] = (uint8_t)(m_modem->m_rxDCOffset + 128); - + // RF parameters buffer[20U] = (uint8_t)(m_modem->m_dmrDiscBWAdj + 128); buffer[21U] = (uint8_t)(m_modem->m_p25DiscBWAdj + 128); @@ -3025,7 +3025,7 @@ void HostCal::printStatus() if (!m_isHotspot) { LogMessage(LOG_CAL, " - DMR Symbol +/- 3 Level Adj.: %d, DMR Symbol +/- 1 Level Adj.: %d, P25 Symbol +/- 3 Level Adj.: %d, P25 Symbol +/- 1 Level Adj.: %d", m_modem->m_dmrSymLevel3Adj, m_modem->m_dmrSymLevel1Adj, m_modem->m_p25SymLevel3Adj, m_modem->m_p25SymLevel1Adj); - + // are we on a protocol version 3 firmware? if (m_modem->getVersion() >= 3U) { LogMessage(LOG_CAL, " - NXDN Symbol +/- 3 Level Adj.: %d, NXDN Symbol +/- 1 Level Adj.: %d", diff --git a/src/host/setup/HostSetup.cpp b/src/host/setup/HostSetup.cpp index 31eda930..3ea96530 100644 --- a/src/host/setup/HostSetup.cpp +++ b/src/host/setup/HostSetup.cpp @@ -508,7 +508,7 @@ int HostSetup::run() printStatus(); } break; - + case 'a': { rfssConfig = m_conf["system"]["config"]; diff --git a/src/lookups/AffiliationLookup.cpp b/src/lookups/AffiliationLookup.cpp index 9c99e7ad..bc53f5cf 100644 --- a/src/lookups/AffiliationLookup.cpp +++ b/src/lookups/AffiliationLookup.cpp @@ -56,7 +56,7 @@ AffiliationLookup::AffiliationLookup(const char* name, bool verbose) : m_verbose(verbose) { m_rfChTable.clear(); - + m_unitRegTable.clear(); m_grpAffTable.clear(); diff --git a/src/lookups/AffiliationLookup.h b/src/lookups/AffiliationLookup.h index b64d689e..08ac858d 100644 --- a/src/lookups/AffiliationLookup.h +++ b/src/lookups/AffiliationLookup.h @@ -149,7 +149,7 @@ namespace lookups virtual bool isGranted(uint32_t dstId) const; /// Helper to get the channel granted for the given destination ID. virtual uint32_t getGrantedCh(uint32_t dstId); - /// Helper to get the source ID granted for the given destination ID. + /// Helper to get the source ID granted for the given destination ID. virtual uint32_t getGrantedSrcId(uint32_t srcId); /// Helper to set RF channel data. diff --git a/src/lookups/IdenTableLookup.h b/src/lookups/IdenTableLookup.h index 61a5fe85..3013c6b2 100644 --- a/src/lookups/IdenTableLookup.h +++ b/src/lookups/IdenTableLookup.h @@ -101,7 +101,7 @@ namespace lookups // --------------------------------------------------------------------------- // Class Declaration - // Implements a threading lookup table class that contains the bandplan + // Implements a threading lookup table class that contains the bandplan // identity table. // --------------------------------------------------------------------------- diff --git a/src/lookups/RadioIdLookup.cpp b/src/lookups/RadioIdLookup.cpp index 132ce7c9..e98d8c10 100644 --- a/src/lookups/RadioIdLookup.cpp +++ b/src/lookups/RadioIdLookup.cpp @@ -53,7 +53,7 @@ using namespace lookups; /// Full-path to the radio ID table file. /// Interval of time to reload the radio ID table. /// Flag indicating whether radio ID access control is enabled. -RadioIdLookup::RadioIdLookup(const std::string& filename, uint32_t reloadTime, bool ridAcl) : LookupTable(filename, reloadTime), +RadioIdLookup::RadioIdLookup(const std::string& filename, uint32_t reloadTime, bool ridAcl) : LookupTable(filename, reloadTime), m_acl(ridAcl) { /* stub */ diff --git a/src/modem/Modem.cpp b/src/modem/Modem.cpp index f0015cf2..037f3963 100644 --- a/src/modem/Modem.cpp +++ b/src/modem/Modem.cpp @@ -2189,7 +2189,7 @@ void Modem::processFlashConfig(const uint8_t *buffer) int rxDCOffset = int(buffer[17U]) - 128; FLASH_VALUE_CHECK(m_rxDCOffset, rxDCOffset, 0, "rxDCOffset"); - + // RF parameters int8_t dmrDiscBWAdj = int8_t(buffer[20U]) - 128; FLASH_VALUE_CHECK(m_dmrDiscBWAdj, dmrDiscBWAdj, 0, "dmrDiscBWAdj"); @@ -2270,7 +2270,7 @@ void Modem::printDebug(const uint8_t* buffer, uint16_t len) Utils::dump(1U, "Modem Debug Dump", data, len); return; - } + } else { if (m_rspDoubleLength) { LogError(LOG_MODEM, "Invalid debug data received from the modem, len = %u", len); @@ -2308,7 +2308,7 @@ void Modem::printDebug(const uint8_t* buffer, uint16_t len) ::memset(data, 0x00U, 255U); ::memcpy(data, buffer, len); - Utils::dump(1U, "Modem Debug Dump", data, len); + Utils::dump(1U, "Modem Debug Dump", data, len); } } diff --git a/src/modem/Modem.h b/src/modem/Modem.h index 5c7de30b..52c8c869 100644 --- a/src/modem/Modem.h +++ b/src/modem/Modem.h @@ -256,7 +256,7 @@ namespace modem /// If the response handler returns true, processing will stop, otherwise it will continue. void setResponseHandler(std::function handler); /// Sets a custom modem open port handler. - /// If the open handler is set, it is the responsibility of the handler to complete air interface + /// If the open handler is set, it is the responsibility of the handler to complete air interface /// initialization (i.e. write configuration, etc). void setOpenHandler(std::function handler); /// Sets a custom modem close port handler. @@ -288,10 +288,10 @@ namespace modem bool hasP25Space(uint32_t length) const; /// Helper to test if the NXDN ring buffer has free space. bool hasNXDNSpace() const; - + /// Helper to test if the modem is a hotspot. bool isHotspot() const; - + /// Helper to test if the modem is in P25 DFSI data mode. bool isP25DFSI() const; @@ -401,7 +401,7 @@ namespace modem int m_txTuning; // hotspot modem - Tx Frequency Offset uint8_t m_rfPower; // hotspot modem - RF power - int8_t m_dmrDiscBWAdj; // hotspot modem - DMR discriminator BW adjustment + int8_t m_dmrDiscBWAdj; // hotspot modem - DMR discriminator BW adjustment int8_t m_p25DiscBWAdj; // hotspot modem - P25 discriminator BW adjustment int8_t m_nxdnDiscBWAdj; // hotspot modem - NXDN discriminator BW adjustment int8_t m_dmrPostBWAdj; // hotspot modem - DMR post demod BW adjustment diff --git a/src/modem/port/PseudoPTYPort.h b/src/modem/port/PseudoPTYPort.h index ddf127e4..6374b9fb 100644 --- a/src/modem/port/PseudoPTYPort.h +++ b/src/modem/port/PseudoPTYPort.h @@ -47,7 +47,7 @@ namespace modem // PTY serial port. // --------------------------------------------------------------------------- - class HOST_SW_API PseudoPTYPort : public UARTPort + class HOST_SW_API PseudoPTYPort : public UARTPort { public: /// Initializes a new instance of the PseudoPTYPort class. diff --git a/src/modem/port/UARTPort.cpp b/src/modem/port/UARTPort.cpp index 4491d70c..d7873772 100644 --- a/src/modem/port/UARTPort.cpp +++ b/src/modem/port/UARTPort.cpp @@ -258,7 +258,7 @@ void UARTPort::close() /// Serial port device. /// Serial port speed. /// -UARTPort::UARTPort(const std::string& device, SERIAL_SPEED speed, bool assertRTS) : +UARTPort::UARTPort(const std::string& device, SERIAL_SPEED speed, bool assertRTS) : m_isOpen(false), m_device(device), m_speed(speed), @@ -500,7 +500,7 @@ int UARTPort::readNonblock(uint8_t* buffer, uint32_t length) /// /// /// -bool UARTPort::canWrite() +bool UARTPort::canWrite() { #if defined(__APPLE__) fd_set wset; diff --git a/src/network/Network.cpp b/src/network/Network.cpp index 1b2157a0..e7897a4b 100644 --- a/src/network/Network.cpp +++ b/src/network/Network.cpp @@ -209,7 +209,7 @@ void Network::clock(uint32_t ms) } if (::memcmp(m_buffer, TAG_DMR_DATA, 4U) == 0) { -#if defined(ENABLE_DMR) +#if defined(ENABLE_DMR) if (m_enabled && m_dmrEnabled) { if (m_debug) Utils::dump(1U, "Network Received, DMR", m_buffer, length); @@ -285,7 +285,7 @@ void Network::clock(uint32_t ms) for (uint8_t i = 0; i < len; i++) { uint32_t id = (m_buffer[11U + j] << 16) | (m_buffer[12U + j] << 8) | (m_buffer[13U + j] << 0); uint8_t slot = (m_buffer[14U + j]); - + lookups::TalkgroupId tid = m_tidLookup->find(id); if (tid.tgEnabled() == false && tid.tgDefault() == true) { LogMessage(LOG_NET, "Activated TG %u TS %u in TGID table", id, slot); diff --git a/src/network/Network.h b/src/network/Network.h index 26d9b80e..0698396c 100644 --- a/src/network/Network.h +++ b/src/network/Network.h @@ -57,7 +57,7 @@ namespace network /// Sets the instances of the Radio ID and Talkgroup ID lookup tables. void setLookups(lookups::RadioIdLookup* ridLookup, lookups::TalkgroupIdLookup* tidLookup); /// Sets metadata configuration settings from the modem. - void setMetadata(const std::string& callsign, uint32_t rxFrequency, uint32_t txFrequency, float txOffsetMhz, float chBandwidthKhz, + void setMetadata(const std::string& callsign, uint32_t rxFrequency, uint32_t txFrequency, float txOffsetMhz, float chBandwidthKhz, uint8_t channelId, uint32_t channelNo, uint32_t power, float latitude, float longitude, int height, const std::string& location); /// Sets REST API configuration settings from the modem. void setRESTAPIData(const std::string& password, uint16_t port); diff --git a/src/network/RESTAPI.cpp b/src/network/RESTAPI.cpp index 407a1b4c..2102f4f6 100644 --- a/src/network/RESTAPI.cpp +++ b/src/network/RESTAPI.cpp @@ -75,11 +75,11 @@ std::string string_format(const std::string& format, FormatArgs ... args) std::unique_ptr buf(new char[ size ]); std::snprintf(buf.get(), size, format.c_str(), args ...); - return std::string(buf.get(), buf.get() + size - 1); + return std::string(buf.get(), buf.get() + size - 1); } /// -/// +/// /// /// void setResponseDefaultStatus(json::object& obj) @@ -89,7 +89,7 @@ void setResponseDefaultStatus(json::object& obj) } /// -/// +/// /// /// /// @@ -267,7 +267,7 @@ void RESTAPI::entry() void RESTAPI::initializeEndpoints() { m_dispatcher.match(PUT_AUTHENTICATE).put(REST_API_BIND(RESTAPI::restAPI_PutAuth, this)); - + m_dispatcher.match(GET_VERSION).get(REST_API_BIND(RESTAPI::restAPI_GetVersion, this)); m_dispatcher.match(GET_STATUS).get(REST_API_BIND(RESTAPI::restAPI_GetStatus, this)); m_dispatcher.match(GET_VOICE_CH).get(REST_API_BIND(RESTAPI::restAPI_GetVoiceCh, this)); @@ -426,7 +426,7 @@ void RESTAPI::restAPI_PutAuth(const HTTPPayload& request, HTTPPayload& reply, co } if (m_debug) { - Utils::dump("Password Hash", passwordHash, 32U); + Utils::dump("Password Hash", passwordHash, 32U); } // compare hashes @@ -532,7 +532,7 @@ void RESTAPI::restAPI_GetStatus(const HTTPPayload& request, HTTPPayload& reply, modemInfo["dmrSymLevel1Adj"].set(m_host->m_modem->m_dmrSymLevel1Adj); modemInfo["p25SymLevel3Adj"].set(m_host->m_modem->m_p25SymLevel3Adj); modemInfo["p25SymLevel1Adj"].set(m_host->m_modem->m_p25SymLevel1Adj); - + // are we on a protocol version 3 firmware? if (m_host->m_modem->getVersion() >= 3U) { modemInfo["nxdnSymLevel3Adj"].set(m_host->m_modem->m_nxdnSymLevel3Adj); @@ -577,7 +577,7 @@ void RESTAPI::restAPI_GetStatus(const HTTPPayload& request, HTTPPayload& reply, modemInfo["fdmaPreambles"].set(m_host->m_modem->m_fdmaPreamble); modemInfo["dmrRxDelay"].set(m_host->m_modem->m_dmrRxDelay); modemInfo["p25CorrCount"].set(m_host->m_modem->m_p25CorrCount); - + modemInfo["rxFrequency"].set(m_host->m_modem->m_rxFrequency); modemInfo["txFrequency"].set(m_host->m_modem->m_txFrequency); modemInfo["rxTuning"].set(m_host->m_modem->m_rxTuning); @@ -606,7 +606,7 @@ void RESTAPI::restAPI_GetVoiceCh(const HTTPPayload& request, HTTPPayload& reply, json::object response = json::object(); setResponseDefaultStatus(response); - + json::array channels = json::array(); if (m_host->m_voiceChData.size() > 0) { for (auto entry : m_host->m_voiceChData) { @@ -1172,7 +1172,7 @@ void RESTAPI::restAPI_GetRIDWhitelist(const HTTPPayload& request, HTTPPayload& r errorPayload(reply, "OK", HTTPPayload::OK); uint32_t srcId = (uint32_t)::strtoul(match.str(1).c_str(), NULL, 10); - + if (srcId != 0U) { m_ridLookup->toggleEntry(srcId, true); } @@ -1200,7 +1200,7 @@ void RESTAPI::restAPI_GetRIDBlacklist(const HTTPPayload& request, HTTPPayload& r errorPayload(reply, "OK", HTTPPayload::OK); uint32_t srcId = (uint32_t)::strtoul(match.str(1).c_str(), NULL, 10); - + if (srcId != 0U) { m_ridLookup->toggleEntry(srcId, false); } @@ -1268,7 +1268,7 @@ void RESTAPI::restAPI_GetDMRDebug(const HTTPPayload& request, HTTPPayload& reply response["debug"].set(debug); response["verbose"].set(verbose); - + reply.payload(response); return; } @@ -1276,7 +1276,7 @@ void RESTAPI::restAPI_GetDMRDebug(const HTTPPayload& request, HTTPPayload& reply if (match.size() == 3) { uint8_t debug = (uint8_t)::strtoul(match.str(1).c_str(), NULL, 10); uint8_t verbose = (uint8_t)::strtoul(match.str(2).c_str(), NULL, 10); - m_dmr->setDebugVerbose((debug == 1U) ? true : false, (verbose == 1U) ? true : false); + m_dmr->setDebugVerbose((debug == 1U) ? true : false, (verbose == 1U) ? true : false); } } } @@ -1310,7 +1310,7 @@ void RESTAPI::restAPI_GetDMRDumpCSBK(const HTTPPayload& request, HTTPPayload& re bool csbkDump = m_dmr->getCSBKVerbose(); response["verbose"].set(csbkDump); - + reply.payload(response); return; } @@ -1435,7 +1435,7 @@ void RESTAPI::restAPI_GetDMRCCEnable(const HTTPPayload& request, HTTPPayload& re } else { errorPayload(reply, "DMR control data is not enabled!"); - } + } } else { errorPayload(reply, "DMR mode is not enabled", HTTPPayload::SERVICE_UNAVAILABLE); @@ -1619,7 +1619,7 @@ void RESTAPI::restAPI_GetP25Debug(const HTTPPayload& request, HTTPPayload& reply response["debug"].set(debug); response["verbose"].set(verbose); - + reply.payload(response); return; } @@ -1627,7 +1627,7 @@ void RESTAPI::restAPI_GetP25Debug(const HTTPPayload& request, HTTPPayload& reply if (match.size() == 3) { uint8_t debug = (uint8_t)::strtoul(match.str(1).c_str(), NULL, 10); uint8_t verbose = (uint8_t)::strtoul(match.str(2).c_str(), NULL, 10); - m_p25->setDebugVerbose((debug == 1U) ? true : false, (verbose == 1U) ? true : false); + m_p25->setDebugVerbose((debug == 1U) ? true : false, (verbose == 1U) ? true : false); } } } @@ -1661,7 +1661,7 @@ void RESTAPI::restAPI_GetP25DumpTSBK(const HTTPPayload& request, HTTPPayload& re bool tsbkDump = m_p25->trunk()->getTSBKVerbose(); response["verbose"].set(tsbkDump); - + reply.payload(response); return; } @@ -1726,7 +1726,7 @@ void RESTAPI::restAPI_PutP25RID(const HTTPPayload& request, HTTPPayload& reply, return; } } - + errorPayload(reply, "OK", HTTPPayload::OK); if (::strtolower(command) == RID_CMD_P25_SET_MFID) { @@ -1810,13 +1810,13 @@ void RESTAPI::restAPI_GetP25CCEnable(const HTTPPayload& request, HTTPPayload& re m_host->m_p25CtrlChannel = !m_host->m_p25CtrlChannel; m_host->m_p25CtrlBroadcast = true; g_fireP25Control = true; - m_p25->setCCHalted(false); + m_p25->setCCHalted(false); errorPayload(reply, string_format("P25 CC is %s", m_host->m_p25CtrlChannel ? "enabled" : "disabled"), HTTPPayload::OK); } else { errorPayload(reply, "P25 control data is not enabled!"); - } + } } else { errorPayload(reply, "P25 mode is not enabled", HTTPPayload::SERVICE_UNAVAILABLE); @@ -1857,7 +1857,7 @@ void RESTAPI::restAPI_GetP25CCBroadcast(const HTTPPayload& request, HTTPPayload& } else { errorPayload(reply, "P25 control data is not enabled!"); - } + } } else { errorPayload(reply, "P25 mode is not enabled", HTTPPayload::SERVICE_UNAVAILABLE); @@ -1919,7 +1919,7 @@ void RESTAPI::restAPI_PutP25RawTSBK(const HTTPPayload& request, HTTPPayload& rep } if (m_debug) { - Utils::dump("Raw TSBK", tsbk, p25::P25_TSBK_LENGTH_BYTES); + Utils::dump("Raw TSBK", tsbk, p25::P25_TSBK_LENGTH_BYTES); } m_p25->trunk()->writeRF_TSDU_Raw(tsbk); @@ -1987,7 +1987,7 @@ void RESTAPI::restAPI_GetNXDNDebug(const HTTPPayload& request, HTTPPayload& repl response["debug"].set(debug); response["verbose"].set(verbose); - + reply.payload(response); return; } @@ -1995,7 +1995,7 @@ void RESTAPI::restAPI_GetNXDNDebug(const HTTPPayload& request, HTTPPayload& repl if (match.size() == 3) { uint8_t debug = (uint8_t)::strtoul(match.str(1).c_str(), NULL, 10); uint8_t verbose = (uint8_t)::strtoul(match.str(2).c_str(), NULL, 10); - m_nxdn->setDebugVerbose((debug == 1U) ? true : false, (verbose == 1U) ? true : false); + m_nxdn->setDebugVerbose((debug == 1U) ? true : false, (verbose == 1U) ? true : false); } } } @@ -2029,7 +2029,7 @@ void RESTAPI::restAPI_GetNXDNDumpRCCH(const HTTPPayload& request, HTTPPayload& r bool rcchDump = m_nxdn->getRCCHVerbose(); response["verbose"].set(rcchDump); - + reply.payload(response); return; } @@ -2083,7 +2083,7 @@ void RESTAPI::restAPI_GetNXDNCCEnable(const HTTPPayload& request, HTTPPayload& r } else { errorPayload(reply, "NXDN control data is not enabled!"); - } + } } else { errorPayload(reply, "NXDN mode is not enabled", HTTPPayload::SERVICE_UNAVAILABLE); diff --git a/src/network/RESTDefines.h b/src/network/RESTDefines.h index e6a05510..20591f4e 100644 --- a/src/network/RESTDefines.h +++ b/src/network/RESTDefines.h @@ -73,7 +73,7 @@ #define GET_DMR_DEBUG_BASE "/dmr/debug/" #define GET_DMR_DEBUG GET_DMR_DEBUG_BASE"(\\d+)/(\\d+)" #define GET_DMR_DUMP_CSBK_BASE "/dmr/dump-csbk/" -#define GET_DMR_DUMP_CSBK GET_DMR_DUMP_CSBK_BASE"(\\d+)" +#define GET_DMR_DUMP_CSBK GET_DMR_DUMP_CSBK_BASE"(\\d+)" #define PUT_DMR_RID "/dmr/rid" #define GET_DMR_CC_DEDICATED "/dmr/cc-enable" #define GET_DMR_CC_BCAST "/dmr/cc-broadcast" diff --git a/src/network/UDPSocket.cpp b/src/network/UDPSocket.cpp index 508ab0fa..bdb42f5d 100644 --- a/src/network/UDPSocket.cpp +++ b/src/network/UDPSocket.cpp @@ -331,7 +331,7 @@ void UDPSocket::close(const uint32_t index) } /// -/// +/// /// void UDPSocket::startup() { @@ -345,7 +345,7 @@ void UDPSocket::startup() } /// -/// +/// /// void UDPSocket::shutdown() { diff --git a/src/network/UDPSocket.h b/src/network/UDPSocket.h index 85b2753f..758898d6 100644 --- a/src/network/UDPSocket.h +++ b/src/network/UDPSocket.h @@ -118,7 +118,7 @@ namespace network uint32_t m_af[UDP_SOCKET_MAX]; int m_fd[UDP_SOCKET_MAX]; - + uint32_t m_counter; }; } // namespace network diff --git a/src/network/json/json.h b/src/network/json/json.h index eea726dc..3fd28600 100644 --- a/src/network/json/json.h +++ b/src/network/json/json.h @@ -456,10 +456,10 @@ namespace json GET(int, (type_ == number_type && (const_cast(this)->type_ = int32_type, (const_cast(this)->u_.int32_ = u_.number_)), u_.int32_)) - GET(uint32_t, + GET(uint32_t, (type_ == number_type && (const_cast(this)->type_ = uint32_type, (const_cast(this)->u_.uint32_ = u_.number_)), u_.uint32_)) - GET(uint16_t, + GET(uint16_t, (type_ == number_type && (const_cast(this)->type_ = uint16_type, (const_cast(this)->u_.uint16_ = u_.number_)), u_.uint16_)) GET(uint8_t, @@ -744,7 +744,7 @@ namespace json case string_type: serialize_str(*u_.string_, oi); break; - case array_type: + case array_type: { *oi++ = '['; if (indent != -1) { @@ -773,13 +773,13 @@ namespace json *oi++ = ']'; break; } - case object_type: + case object_type: { *oi++ = '{'; if (indent != -1) { ++indent; } - + for (object::const_iterator i = u_.object_->begin(); i != u_.object_->end(); ++i) { if (i != u_.object_->begin()) { *oi++ = ','; @@ -1021,7 +1021,7 @@ namespace json if (!ctx.parse_array_start()) { return false; } - + size_t idx = 0; if (in.expect(']')) { return ctx.parse_array_stop(idx); diff --git a/src/network/rest/RequestDispatcher.h b/src/network/rest/RequestDispatcher.h index b202ebdc..a7cf31d2 100644 --- a/src/network/rest/RequestDispatcher.h +++ b/src/network/rest/RequestDispatcher.h @@ -29,35 +29,35 @@ #include "Defines.h" #include "network/rest/http/HTTPPayload.h" #include "Log.h" - + #include #include #include #include #include - -namespace network + +namespace network { - namespace rest + namespace rest { // --------------------------------------------------------------------------- // Structure Declaration - // + // // --------------------------------------------------------------------------- - struct RequestMatch : std::smatch + struct RequestMatch : std::smatch { /// Initializes a new instance of the RequestMatch structure. RequestMatch(const std::smatch& m, const std::string& c) : std::smatch(m), content(c) { /* stub */ } - + std::string content; }; // --------------------------------------------------------------------------- // Structure Declaration - // + // // --------------------------------------------------------------------------- - + template struct RequestMatcher { typedef std::function RequestHandlerType; @@ -103,7 +103,7 @@ namespace network handler(request, reply, match); } } - + private: std::string m_expression; bool m_isRegEx; @@ -127,7 +127,7 @@ namespace network RequestDispatcher(const std::string& basePath, bool debug) : m_basePath(basePath), m_debug(debug) { /* stub */ } /// - MatcherType& match(const std::string& expression, bool regex = false) + MatcherType& match(const std::string& expression, bool regex = false) { MatcherTypePtr& p = m_matchers[expression]; if (!p) { @@ -146,7 +146,7 @@ namespace network } /// - void handleRequest(const Request& request, Reply& reply) + void handleRequest(const Request& request, Reply& reply) { for (const auto& matcher : m_matchers) { std::smatch what; @@ -175,7 +175,7 @@ namespace network ::LogError(LOG_REST, "unknown endpoint, uri = %s", request.uri.c_str()); reply = http::HTTPPayload::statusPayload(http::HTTPPayload::BAD_REQUEST, "application/json"); } - + private: typedef std::shared_ptr MatcherTypePtr; @@ -201,7 +201,7 @@ namespace network BasicRequestDispatcher(RequestHandlerType handler) : m_handler(handler) { /* stub */ } /// - void handleRequest(const Request& request, Reply& reply) + void handleRequest(const Request& request, Reply& reply) { if (m_handler) { m_handler(request, reply); @@ -224,7 +224,7 @@ namespace network DebugRequestDispatcher() { /* stub */ } /// - void handleRequest(const Request& request, Reply& reply) + void handleRequest(const Request& request, Reply& reply) { for (auto header : request.headers.headers()) ::LogDebug(LOG_REST, "DebugRequestDispatcher::handleRequest() header = %s, value = %s", header.name.c_str(), header.value.c_str()); @@ -233,8 +233,8 @@ namespace network } }; - typedef RequestDispatcher DefaultRequestDispatcher; + typedef RequestDispatcher DefaultRequestDispatcher; } // namespace rest } // namespace network - -#endif // __REST__DISPATCHER_H__ + +#endif // __REST__DISPATCHER_H__ diff --git a/src/network/rest/http/ClientConnection.h b/src/network/rest/http/ClientConnection.h index 357f7f3e..6cf0b81c 100644 --- a/src/network/rest/http/ClientConnection.h +++ b/src/network/rest/http/ClientConnection.h @@ -14,9 +14,9 @@ * Copyright (c) 2003-2013 Christopher M. Kohlhoff * Copyright (C) 2023 by Bryan Biedenkapp N2PLL * -* Permission is hereby granted, free of charge, to any person or organization -* obtaining a copy of the software and accompanying documentation covered by -* this license (the “Software”) to use, reproduce, display, distribute, execute, +* Permission is hereby granted, free of charge, to any person or organization +* obtaining a copy of the software and accompanying documentation covered by +* this license (the “Software”) to use, reproduce, display, distribute, execute, * and transmit the Software, and to prepare derivative works of the Software, and * to permit third-parties to whom the Software is furnished to do so, all subject * to the following: @@ -37,7 +37,7 @@ #if !defined(__REST_HTTP__CLIENT_CONNECTION_H__) #define __REST_HTTP__CLIENT_CONNECTION_H__ -#include "Defines.h" +#include "Defines.h" #include "network/rest/http/HTTPLexer.h" #include "network/rest/http/HTTPPayload.h" #include "Utils.h" @@ -47,18 +47,18 @@ #include #include #include - -namespace network + +namespace network { - namespace rest + namespace rest { - namespace http + namespace http { // --------------------------------------------------------------------------- // Class Declaration // This class represents a single connection from a client. // --------------------------------------------------------------------------- - + template class ClientConnection { @@ -73,29 +73,29 @@ namespace network } /// Initializes a copy instance of the ClientConnection class. ClientConnection(const ClientConnection&) = delete; - + /// ClientConnection& operator=(const ClientConnection&) = delete; /// Start the first asynchronous operation for the connection. void start() { read(); } /// Stop all asynchronous operations associated with the connection. - void stop() + void stop() { try { if (m_socket.is_open()) { - m_socket.close(); + m_socket.close(); } } catch(const std::exception&) { /* ignore */ } } /// Perform an synchronous write operation. - void send(HTTPPayload request) + void send(HTTPPayload request) { request.attachHostHeader(m_socket.remote_endpoint()); - write(request); + write(request); } private: /// Perform an asynchronous read operation. @@ -166,5 +166,5 @@ namespace network } // namespace http } // namespace rest } // namespace network - + #endif // __REST_HTTP__CLIENT_CONNECTION_H__ diff --git a/src/network/rest/http/HTTPClient.h b/src/network/rest/http/HTTPClient.h index 19c21f52..df19cc76 100644 --- a/src/network/rest/http/HTTPClient.h +++ b/src/network/rest/http/HTTPClient.h @@ -9,9 +9,9 @@ /* * Copyright (C) 2023 by Bryan Biedenkapp N2PLL * -* Permission is hereby granted, free of charge, to any person or organization -* obtaining a copy of the software and accompanying documentation covered by -* this license (the “Software”) to use, reproduce, display, distribute, execute, +* Permission is hereby granted, free of charge, to any person or organization +* obtaining a copy of the software and accompanying documentation covered by +* this license (the “Software”) to use, reproduce, display, distribute, execute, * and transmit the Software, and to prepare derivative works of the Software, and * to permit third-parties to whom the Software is furnished to do so, all subject * to the following: @@ -46,11 +46,11 @@ #include #include -namespace network +namespace network { - namespace rest + namespace rest { - namespace http + namespace http { // --------------------------------------------------------------------------- @@ -66,22 +66,22 @@ namespace network m_address(address), m_port(port), m_connection(nullptr), - m_ioContext(), - m_socket(m_ioContext), - m_requestHandler() - { - /* stub */ + m_ioContext(), + m_socket(m_ioContext), + m_requestHandler() + { + /* stub */ } /// Initializes a copy instance of the HTTPClient class. HTTPClient(const HTTPClient&) = delete; /// Finalizes a instance of the HTTPClient class. - ~HTTPClient() + ~HTTPClient() { if (m_connection != nullptr) { close(); } } - + /// HTTPClient& operator=(const HTTPClient&) = delete; @@ -150,7 +150,7 @@ namespace network // the entry() call will block until all asynchronous operations // have finished m_ioContext.run(); - + if (m_connection != nullptr) { m_connection->stop(); } @@ -175,7 +175,7 @@ namespace network asio::io_context m_ioContext; asio::ip::tcp::socket m_socket; - + RequestHandlerType m_requestHandler; std::mutex m_lock; @@ -183,5 +183,5 @@ namespace network } // namespace http } // namespace rest } // namespace network - + #endif // __REST_HTTP__HTTP_CLIENT_H__ diff --git a/src/network/rest/http/HTTPHeaders.h b/src/network/rest/http/HTTPHeaders.h index 146aba48..ffa1473a 100644 --- a/src/network/rest/http/HTTPHeaders.h +++ b/src/network/rest/http/HTTPHeaders.h @@ -14,9 +14,9 @@ * Copyright (c) 2003-2013 Christopher M. Kohlhoff * Copyright (C) 2023 by Bryan Biedenkapp N2PLL * -* Permission is hereby granted, free of charge, to any person or organization -* obtaining a copy of the software and accompanying documentation covered by -* this license (the “Software”) to use, reproduce, display, distribute, execute, +* Permission is hereby granted, free of charge, to any person or organization +* obtaining a copy of the software and accompanying documentation covered by +* this license (the “Software”) to use, reproduce, display, distribute, execute, * and transmit the Software, and to prepare derivative works of the Software, and * to permit third-parties to whom the Software is furnished to do so, all subject * to the following: @@ -43,11 +43,11 @@ #include #include -namespace network +namespace network { - namespace rest + namespace rest { - namespace http + namespace http { // --------------------------------------------------------------------------- @@ -58,7 +58,7 @@ namespace network // --------------------------------------------------------------------------- // Structure Declaration - // + // // --------------------------------------------------------------------------- struct HTTPHeaders @@ -81,7 +81,7 @@ namespace network /// Clears the list of HTTP headers. void clearHeaders() { m_headers = std::vector
(); } /// Helper to add a HTTP header. - void add(const std::string& name, const std::string& value) + void add(const std::string& name, const std::string& value) { //::LogDebug(LOG_REST, "HTTPHeaders::add(), header = %s, value = %s", name.c_str(), value.c_str()); for (auto& header : m_headers) { @@ -91,12 +91,12 @@ namespace network } } - m_headers.push_back(Header(name, value)); + m_headers.push_back(Header(name, value)); //for (auto header : m_headers) // ::LogDebug(LOG_REST, "HTTPHeaders::add() m_headers.header = %s, m_headers.value = %s", header.name.c_str(), header.value.c_str()); } /// Helper to add a HTTP header. - void remove(const std::string headerName) + void remove(const std::string headerName) { auto header = std::find_if(m_headers.begin(), m_headers.end(), [&](const Header& h) { return ::strtolower(h.name) == ::strtolower(headerName); diff --git a/src/network/rest/http/HTTPLexer.cpp b/src/network/rest/http/HTTPLexer.cpp index bba9f1d0..45caa999 100644 --- a/src/network/rest/http/HTTPLexer.cpp +++ b/src/network/rest/http/HTTPLexer.cpp @@ -14,9 +14,9 @@ * Copyright (c) 2003-2013 Christopher M. Kohlhoff * Copyright (C) 2023 by Bryan Biedenkapp N2PLL * -* Permission is hereby granted, free of charge, to any person or organization -* obtaining a copy of the software and accompanying documentation covered by -* this license (the “Software”) to use, reproduce, display, distribute, execute, +* Permission is hereby granted, free of charge, to any person or organization +* obtaining a copy of the software and accompanying documentation covered by +* this license (the “Software”) to use, reproduce, display, distribute, execute, * and transmit the Software, and to prepare derivative works of the Software, and * to permit third-parties to whom the Software is furnished to do so, all subject * to the following: @@ -51,7 +51,7 @@ using namespace network::rest::http; /// Initializes a new instance of the HTTPLexer class. /// /// -HTTPLexer::HTTPLexer(bool clientLexer) : +HTTPLexer::HTTPLexer(bool clientLexer) : m_headers(), m_clientLexer(clientLexer), m_state(METHOD_START) @@ -395,7 +395,7 @@ HTTPLexer::ResultType HTTPLexer::consume(HTTPPayload& req, char input) } else { return BAD; } - + default: return BAD; } diff --git a/src/network/rest/http/HTTPLexer.h b/src/network/rest/http/HTTPLexer.h index 9a805a2e..6d38119c 100644 --- a/src/network/rest/http/HTTPLexer.h +++ b/src/network/rest/http/HTTPLexer.h @@ -14,9 +14,9 @@ * Copyright (c) 2003-2013 Christopher M. Kohlhoff * Copyright (C) 2023 by Bryan Biedenkapp N2PLL * -* Permission is hereby granted, free of charge, to any person or organization -* obtaining a copy of the software and accompanying documentation covered by -* this license (the “Software”) to use, reproduce, display, distribute, execute, +* Permission is hereby granted, free of charge, to any person or organization +* obtaining a copy of the software and accompanying documentation covered by +* this license (the “Software”) to use, reproduce, display, distribute, execute, * and transmit the Software, and to prepare derivative works of the Software, and * to permit third-parties to whom the Software is furnished to do so, all subject * to the following: @@ -42,11 +42,11 @@ #include #include -namespace network +namespace network { - namespace rest + namespace rest { - namespace http + namespace http { // --------------------------------------------------------------------------- @@ -54,7 +54,7 @@ namespace network // --------------------------------------------------------------------------- struct HTTPPayload; - + // --------------------------------------------------------------------------- // Class Declaration // This class implements the lexer for incoming payloads. diff --git a/src/network/rest/http/HTTPPayload.cpp b/src/network/rest/http/HTTPPayload.cpp index 19044dad..24b666a5 100644 --- a/src/network/rest/http/HTTPPayload.cpp +++ b/src/network/rest/http/HTTPPayload.cpp @@ -14,9 +14,9 @@ * Copyright (c) 2003-2013 Christopher M. Kohlhoff * Copyright (C) 2023 by Bryan Biedenkapp N2PLL * -* Permission is hereby granted, free of charge, to any person or organization -* obtaining a copy of the software and accompanying documentation covered by -* this license (the “Software”) to use, reproduce, display, distribute, execute, +* Permission is hereby granted, free of charge, to any person or organization +* obtaining a copy of the software and accompanying documentation covered by +* this license (the “Software”) to use, reproduce, display, distribute, execute, * and transmit the Software, and to prepare derivative works of the Software, and * to permit third-parties to whom the Software is furnished to do so, all subject * to the following: @@ -404,7 +404,7 @@ HTTPPayload HTTPPayload::statusPayload(HTTPPayload::StatusType status, const std rep.content = stock_replies::to_string(status, contentType); rep.ensureDefaultHeaders(contentType); } - + return rep; } diff --git a/src/network/rest/http/HTTPPayload.h b/src/network/rest/http/HTTPPayload.h index a85cd0f8..7261464c 100644 --- a/src/network/rest/http/HTTPPayload.h +++ b/src/network/rest/http/HTTPPayload.h @@ -14,9 +14,9 @@ * Copyright (c) 2003-2013 Christopher M. Kohlhoff * Copyright (C) 2023 by Bryan Biedenkapp N2PLL * -* Permission is hereby granted, free of charge, to any person or organization -* obtaining a copy of the software and accompanying documentation covered by -* this license (the “Software”) to use, reproduce, display, distribute, execute, +* Permission is hereby granted, free of charge, to any person or organization +* obtaining a copy of the software and accompanying documentation covered by +* this license (the “Software”) to use, reproduce, display, distribute, execute, * and transmit the Software, and to prepare derivative works of the Software, and * to permit third-parties to whom the Software is furnished to do so, all subject * to the following: @@ -37,7 +37,7 @@ #if !defined(__REST_HTTP__HTTP_REPLY_H__) #define __REST_HTTP__HTTP_REPLY_H__ -#include "Defines.h" +#include "Defines.h" #include "network/json/json.h" #include "network/rest/http/HTTPHeaders.h" @@ -46,11 +46,11 @@ #include -namespace network +namespace network { - namespace rest + namespace rest { - namespace http + namespace http { // --------------------------------------------------------------------------- @@ -65,7 +65,7 @@ namespace network // --------------------------------------------------------------------------- // Structure Declaration - // This struct implements a model of a payload to be sent to a + // This struct implements a model of a payload to be sent to a // HTTP client/server. // --------------------------------------------------------------------------- diff --git a/src/network/rest/http/HTTPRequestHandler.cpp b/src/network/rest/http/HTTPRequestHandler.cpp index cb3a5dd2..73ce2dca 100644 --- a/src/network/rest/http/HTTPRequestHandler.cpp +++ b/src/network/rest/http/HTTPRequestHandler.cpp @@ -14,9 +14,9 @@ * Copyright (c) 2003-2013 Christopher M. Kohlhoff * Copyright (C) 2023 by Bryan Biedenkapp N2PLL * -* Permission is hereby granted, free of charge, to any person or organization -* obtaining a copy of the software and accompanying documentation covered by -* this license (the “Software”) to use, reproduce, display, distribute, execute, +* Permission is hereby granted, free of charge, to any person or organization +* obtaining a copy of the software and accompanying documentation covered by +* this license (the “Software”) to use, reproduce, display, distribute, execute, * and transmit the Software, and to prepare derivative works of the Software, and * to permit third-parties to whom the Software is furnished to do so, all subject * to the following: @@ -71,7 +71,7 @@ void HTTPRequestHandler::handleRequest(const HTTPPayload& request, HTTPPayload& } // request path must be absolute and not contain "..". - if (requestPath.empty() || requestPath[0] != '/' || + if (requestPath.empty() || requestPath[0] != '/' || requestPath.find("..") != std::string::npos) { reply = HTTPPayload::statusPayload(HTTPPayload::BAD_REQUEST); return; @@ -100,7 +100,7 @@ void HTTPRequestHandler::handleRequest(const HTTPPayload& request, HTTPPayload& // fill out the reply to be sent to the client reply.status = HTTPPayload::OK; - + char buf[512]; while (is.read(buf, sizeof(buf)).gcount() > 0) reply.content.append(buf, is.gcount()); @@ -144,6 +144,6 @@ bool HTTPRequestHandler::urlDecode(const std::string& in, std::string& out) out += in[i]; } } - + return true; } diff --git a/src/network/rest/http/HTTPRequestHandler.h b/src/network/rest/http/HTTPRequestHandler.h index b6e96b78..4dc4aa42 100644 --- a/src/network/rest/http/HTTPRequestHandler.h +++ b/src/network/rest/http/HTTPRequestHandler.h @@ -14,9 +14,9 @@ * Copyright (c) 2003-2013 Christopher M. Kohlhoff * Copyright (C) 2023 by Bryan Biedenkapp N2PLL * -* Permission is hereby granted, free of charge, to any person or organization -* obtaining a copy of the software and accompanying documentation covered by -* this license (the “Software”) to use, reproduce, display, distribute, execute, +* Permission is hereby granted, free of charge, to any person or organization +* obtaining a copy of the software and accompanying documentation covered by +* this license (the “Software”) to use, reproduce, display, distribute, execute, * and transmit the Software, and to prepare derivative works of the Software, and * to permit third-parties to whom the Software is furnished to do so, all subject * to the following: @@ -41,11 +41,11 @@ #include -namespace network +namespace network { - namespace rest + namespace rest { - namespace http + namespace http { // --------------------------------------------------------------------------- @@ -53,7 +53,7 @@ namespace network // --------------------------------------------------------------------------- struct HTTPPayload; - + // --------------------------------------------------------------------------- // Class Declaration // This class implements the common handler for all incoming requests. @@ -68,7 +68,7 @@ namespace network HTTPRequestHandler(const HTTPRequestHandler&) = delete; /// HTTPRequestHandler(HTTPRequestHandler&&) = default; - + /// HTTPRequestHandler& operator=(const HTTPRequestHandler&) = delete; /// diff --git a/src/network/rest/http/HTTPServer.h b/src/network/rest/http/HTTPServer.h index 1fe242ef..8966b8d7 100644 --- a/src/network/rest/http/HTTPServer.h +++ b/src/network/rest/http/HTTPServer.h @@ -14,9 +14,9 @@ * Copyright (c) 2003-2013 Christopher M. Kohlhoff * Copyright (C) 2023 by Bryan Biedenkapp N2PLL * -* Permission is hereby granted, free of charge, to any person or organization -* obtaining a copy of the software and accompanying documentation covered by -* this license (the “Software”) to use, reproduce, display, distribute, execute, +* Permission is hereby granted, free of charge, to any person or organization +* obtaining a copy of the software and accompanying documentation covered by +* this license (the “Software”) to use, reproduce, display, distribute, execute, * and transmit the Software, and to prepare derivative works of the Software, and * to permit third-parties to whom the Software is furnished to do so, all subject * to the following: @@ -49,12 +49,12 @@ #include #include #include - -namespace network + +namespace network { - namespace rest + namespace rest { - namespace http + namespace http { // --------------------------------------------------------------------------- @@ -67,10 +67,10 @@ namespace network public: /// Initializes a new instance of the HTTPServer class. explicit HTTPServer(const std::string& address, uint16_t port) : - m_ioService(), - m_acceptor(m_ioService), + m_ioService(), + m_acceptor(m_ioService), m_connectionManager(), - m_socket(m_ioService), + m_socket(m_ioService), m_requestHandler() { // open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR) @@ -82,12 +82,12 @@ namespace network m_acceptor.set_option(asio::socket_base::keep_alive(true)); m_acceptor.bind(endpoint); m_acceptor.listen(); - + accept(); } /// Initializes a copy instance of the HTTPServer class. HTTPServer(const HTTPServer&) = delete; - + /// HTTPServer& operator=(const HTTPServer&) = delete; @@ -117,7 +117,7 @@ namespace network m_acceptor.close(); m_connectionManager.stopAll(); } - + private: /// Perform an asynchronous accept operation. void accept() @@ -128,29 +128,29 @@ namespace network if (!m_acceptor.is_open()) { return; } - + if (!ec) { m_connectionManager.start(std::make_shared(std::move(m_socket), m_connectionManager, m_requestHandler)); } - + accept(); }); } - + typedef ConnectionImpl ConnectionType; typedef std::shared_ptr ConnectionTypePtr; - + asio::io_service m_ioService; asio::ip::tcp::acceptor m_acceptor; - + ServerConnectionManager m_connectionManager; - + asio::ip::tcp::socket m_socket; - + RequestHandlerType m_requestHandler; }; } // namespace http } // namespace rest } // namespace network - + #endif // __REST_HTTP__HTTP_SERVER_H__ diff --git a/src/network/rest/http/ServerConnection.h b/src/network/rest/http/ServerConnection.h index 395a08a3..837dd50b 100644 --- a/src/network/rest/http/ServerConnection.h +++ b/src/network/rest/http/ServerConnection.h @@ -14,9 +14,9 @@ * Copyright (c) 2003-2013 Christopher M. Kohlhoff * Copyright (C) 2023 by Bryan Biedenkapp N2PLL * -* Permission is hereby granted, free of charge, to any person or organization -* obtaining a copy of the software and accompanying documentation covered by -* this license (the “Software”) to use, reproduce, display, distribute, execute, +* Permission is hereby granted, free of charge, to any person or organization +* obtaining a copy of the software and accompanying documentation covered by +* this license (the “Software”) to use, reproduce, display, distribute, execute, * and transmit the Software, and to prepare derivative works of the Software, and * to permit third-parties to whom the Software is furnished to do so, all subject * to the following: @@ -37,7 +37,7 @@ #if !defined(__REST_HTTP__SERVER_CONNECTION_H__) #define __REST_HTTP__SERVER_CONNECTION_H__ -#include "Defines.h" +#include "Defines.h" #include "network/rest/http/HTTPLexer.h" #include "network/rest/http/HTTPPayload.h" #include "Utils.h" @@ -47,12 +47,12 @@ #include #include #include - -namespace network + +namespace network { - namespace rest + namespace rest { - namespace http + namespace http { // --------------------------------------------------------------------------- // Class Prototypes @@ -64,7 +64,7 @@ namespace network // Class Declaration // This class represents a single connection from a client. // --------------------------------------------------------------------------- - + template class ServerConnection : public std::enable_shared_from_this> { @@ -73,7 +73,7 @@ namespace network typedef ServerConnectionManager ConnectionManagerType; public: /// Initializes a new instance of the ServerConnection class. - explicit ServerConnection(asio::ip::tcp::socket socket, ConnectionManagerType& manager, RequestHandlerType& handler, + explicit ServerConnection(asio::ip::tcp::socket socket, ConnectionManagerType& manager, RequestHandlerType& handler, bool persistent = false) : m_socket(std::move(socket)), m_connectionManager(manager), @@ -85,19 +85,19 @@ namespace network } /// Initializes a copy instance of the ServerConnection class. ServerConnection(const ServerConnection&) = delete; - + /// ServerConnection& operator=(const ServerConnection&) = delete; /// Start the first asynchronous operation for the connection. void start() { read(); } /// Stop all asynchronous operations associated with the connection. - void stop() + void stop() { try { if (m_socket.is_open()) { - m_socket.close(); + m_socket.close(); } } catch(const std::exception&) { /* ignore */ } @@ -143,7 +143,7 @@ namespace network } }); } - + /// Perform an asynchronous write operation. void write() { @@ -169,7 +169,7 @@ namespace network asio::error_code ignored_ec; m_socket.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec); } - + if (ec != asio::error::operation_aborted) { m_connectionManager.stop(this->shared_from_this()); } @@ -193,5 +193,5 @@ namespace network } // namespace http } // namespace rest } // namespace network - + #endif // __REST_HTTP__SERVER_CONNECTION_H__ diff --git a/src/network/rest/http/ServerConnectionManager.h b/src/network/rest/http/ServerConnectionManager.h index 94a9a526..5232502c 100644 --- a/src/network/rest/http/ServerConnectionManager.h +++ b/src/network/rest/http/ServerConnectionManager.h @@ -14,9 +14,9 @@ * Copyright (c) 2003-2013 Christopher M. Kohlhoff * Copyright (C) 2023 by Bryan Biedenkapp N2PLL * -* Permission is hereby granted, free of charge, to any person or organization -* obtaining a copy of the software and accompanying documentation covered by -* this license (the “Software”) to use, reproduce, display, distribute, execute, +* Permission is hereby granted, free of charge, to any person or organization +* obtaining a copy of the software and accompanying documentation covered by +* this license (the “Software”) to use, reproduce, display, distribute, execute, * and transmit the Software, and to prepare derivative works of the Software, and * to permit third-parties to whom the Software is furnished to do so, all subject * to the following: @@ -41,21 +41,21 @@ #include #include - -namespace network + +namespace network { - namespace rest + namespace rest { - namespace http + namespace http { - + // --------------------------------------------------------------------------- // Class Declaration // Manages open connections so that they may be cleanly stopped when the server // needs to shut down. // --------------------------------------------------------------------------- - template + template class ServerConnectionManager { public: @@ -66,7 +66,7 @@ namespace network /// ServerConnectionManager& operator=(const ServerConnectionManager&) = delete; - + /// Add the specified connection to the manager and start it. void start(ConnectionPtr c) { @@ -76,7 +76,7 @@ namespace network } c->start(); } - + /// Stop the specified connection. void stop(ConnectionPtr c) { @@ -86,7 +86,7 @@ namespace network } c->stop(); } - + /// Stop all connections. void stopAll() { @@ -96,7 +96,7 @@ namespace network std::lock_guard guard(m_lock); m_connections.clear(); } - + private: std::set m_connections; std::mutex m_lock; @@ -106,4 +106,3 @@ namespace network } // namespace network #endif // __REST_HTTP__SERVER_CONNECTION_MANAGER_H__ - \ No newline at end of file diff --git a/src/nxdn/Audio.h b/src/nxdn/Audio.h index b32e1c2a..3f6b4f92 100644 --- a/src/nxdn/Audio.h +++ b/src/nxdn/Audio.h @@ -450,13 +450,13 @@ namespace nxdn 0xECDB0FU, 0xB542DAU, 0x9E5131U, 0xC7ABA5U, 0x8C38FEU, 0x97010BU, 0xDED290U, 0xA4CC7DU, 0xAD3D2EU, 0xF6B6B3U, 0xF9A540U, 0x205ED9U, 0x634EB6U, 0x5A9567U, 0x11A6D8U, 0x0B3F09U }; - const uint32_t A_TABLE[] = { + const uint32_t A_TABLE[] = { 0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U, 32U, 36U, 40U, 44U, 48U, 52U, 56U, 60U, 64U, 68U, 1U, 5U, 9U, 13U, 17U, 21U }; - const uint32_t B_TABLE[] = { + const uint32_t B_TABLE[] = { 25U, 29U, 33U, 37U, 41U, 45U, 49U, 53U, 57U, 61U, 65U, 69U, 2U, 6U, 10U, 14U, 18U, 22U, 26U, 30U, 34U, 38U, 42U }; - const uint32_t C_TABLE[] = { + const uint32_t C_TABLE[] = { 46U, 50U, 54U, 58U, 62U, 66U, 70U, 3U, 7U, 11U, 15U, 19U, 23U, 27U, 31U, 35U, 39U, 43U, 47U, 51U, 55U, 59U, 63U, 67U, 71U }; diff --git a/src/nxdn/Control.cpp b/src/nxdn/Control.cpp index 92645a35..662807f2 100644 --- a/src/nxdn/Control.cpp +++ b/src/nxdn/Control.cpp @@ -214,7 +214,7 @@ void Control::reset() /// Channel ID. /// Channel Number. /// -void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cwCallsign, const std::vector voiceChNo, +void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cwCallsign, const std::vector voiceChNo, const std::unordered_map voiceChData, uint16_t siteId, uint32_t sysId, uint8_t channelId, uint32_t channelNo, bool printOptions) { @@ -248,7 +248,7 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw LogWarning(LOG_NXDN, "Silence threshold set to zero, defaulting to %u", nxdn::MAX_NXDN_VOICE_ERRORS); m_voice->m_silenceThreshold = nxdn::MAX_NXDN_VOICE_ERRORS; } - + bool disableCompositeFlag = nxdnProtocol["disableCompositeFlag"].as(false); uint8_t serviceClass = NXDN_SIF1_VOICE_CALL_SVC | NXDN_SIF1_DATA_CALL_SVC; if (m_control) { @@ -277,7 +277,7 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw m_affiliations.setRFChData(chData); // set the grant release callback - m_affiliations.setReleaseGrantCallback([=](uint32_t chNo, uint32_t dstId, uint8_t slot) { + m_affiliations.setReleaseGrantCallback([=](uint32_t chNo, uint32_t dstId, uint8_t slot) { // callback REST API to clear TG permit for the granted TG on the specified voice channel if (m_authoritative && m_supervisor) { ::lookups::VoiceChData voiceChData = m_affiliations.getRFChData(chNo); @@ -345,15 +345,15 @@ bool Control::processFrame(uint8_t* data, uint32_t len) if (type == modem::TAG_LOST && m_rfState == RS_RF_AUDIO) { if (m_rssi != 0U) { - ::ActivityLog("NXDN", true, "transmission lost, %.1f seconds, BER: %.1f%%, RSSI: -%u/-%u/-%u dBm", + ::ActivityLog("NXDN", true, "transmission lost, %.1f seconds, BER: %.1f%%, RSSI: -%u/-%u/-%u dBm", float(m_voice->m_rfFrames) / 12.5F, float(m_voice->m_rfErrs * 100U) / float(m_voice->m_rfBits), m_minRSSI, m_maxRSSI, m_aveRSSI / m_rssiCount); } else { - ::ActivityLog("NXDN", true, "transmission lost, %.1f seconds, BER: %.1f%%", + ::ActivityLog("NXDN", true, "transmission lost, %.1f seconds, BER: %.1f%%", float(m_voice->m_rfFrames) / 12.5F, float(m_voice->m_rfErrs * 100U) / float(m_voice->m_rfBits)); } - LogMessage(LOG_RF, "NXDN, " NXDN_RTCH_MSG_TYPE_TX_REL ", total frames: %d, bits: %d, undecodable LC: %d, errors: %d, BER: %.4f%%", + LogMessage(LOG_RF, "NXDN, " NXDN_RTCH_MSG_TYPE_TX_REL ", total frames: %d, bits: %d, undecodable LC: %d, errors: %d, BER: %.4f%%", m_voice->m_rfFrames, m_voice->m_rfBits, m_voice->m_rfUndecodableLC, m_voice->m_rfErrs, float(m_voice->m_rfErrs * 100U) / float(m_voice->m_rfBits)); if (m_control) { @@ -801,12 +801,12 @@ bool Control::writeRF_ControlData() if (m_netState == RS_NET_IDLE && m_rfState == RS_RF_LISTENING) { m_trunk->writeRF_ControlData(m_ccFrameCnt, m_ccSeq, true); - + m_ccSeq++; if (m_ccSeq == maxSeq) { m_ccFrameCnt++; } - + return true; } diff --git a/src/nxdn/Control.h b/src/nxdn/Control.h index 9803faa1..db66d10b 100644 --- a/src/nxdn/Control.h +++ b/src/nxdn/Control.h @@ -58,7 +58,7 @@ namespace nxdn // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + namespace packet { class HOST_SW_API Voice; } namespace packet { class HOST_SW_API Trunk; } namespace packet { class HOST_SW_API Data; } @@ -71,7 +71,7 @@ namespace nxdn class HOST_SW_API Control { public: /// Initializes a new instance of the Control class. - Control(bool authoritative, uint32_t ran, uint32_t callHang, uint32_t queueSize, uint32_t timeout, uint32_t tgHang, + Control(bool authoritative, uint32_t ran, uint32_t callHang, uint32_t queueSize, uint32_t timeout, uint32_t tgHang, modem::Modem* modem, network::BaseNetwork* network, bool duplex, lookups::RadioIdLookup* ridLookup, lookups::TalkgroupIdLookup* tidLookup, lookups::IdenTableLookup* idenTable, lookups::RSSIInterpolator* rssiMapper, bool dumpRCCHData, bool debug, bool verbose); @@ -82,10 +82,10 @@ namespace nxdn void reset(); /// Helper to set NXDN configuration options. - void setOptions(yaml::Node& conf, bool supervisor, const std::string cwCallsign, const std::vector voiceChNo, + void setOptions(yaml::Node& conf, bool supervisor, const std::string cwCallsign, const std::vector voiceChNo, const std::unordered_map voiceChData, uint16_t siteId, uint32_t sysId, uint8_t channelId, uint32_t channelNo, bool printOptions); - + /// Gets a flag indicating whether the NXDN control channel is running. bool getCCRunning() { return m_ccRunning; } /// Sets a flag indicating whether the NXDN control channel is running. @@ -180,7 +180,7 @@ namespace nxdn Timer m_networkWatchdog; Timer m_ccPacketInterval; - + uint8_t m_ccFrameCnt; uint8_t m_ccSeq; diff --git a/src/nxdn/NXDNDefines.h b/src/nxdn/NXDNDefines.h index 57bcbe9e..066d45ba 100644 --- a/src/nxdn/NXDNDefines.h +++ b/src/nxdn/NXDNDefines.h @@ -191,7 +191,7 @@ namespace nxdn const uint8_t NXDN_LOC_CAT_GLOBAL = 0x00U; const uint8_t NXDN_LOC_CAT_LOCAL = 0x01U; const uint8_t NXDN_LOC_CAT_REGIONAL = 0x02U; - + const uint8_t NXDN_CAUSE_RSRC_NOT_AVAIL_NETWORK = 0x51U; const uint8_t NXDN_CAUSE_RSRC_NOT_AVAIL_TEMP = 0x52U; const uint8_t NXDN_CAUSE_RSRC_NOT_AVAIL_QUEUED = 0x53U; diff --git a/src/nxdn/channel/FACCH1.cpp b/src/nxdn/channel/FACCH1.cpp index af13a2e0..1fd8e50c 100644 --- a/src/nxdn/channel/FACCH1.cpp +++ b/src/nxdn/channel/FACCH1.cpp @@ -56,9 +56,9 @@ const uint32_t INTERLEAVE_TABLE[] = { 7U, 16U, 25U, 34U, 43U, 52U, 61U, 70U, 79U, 88U, 97U, 106U, 115U, 124U, 133U, 142U, 8U, 17U, 26U, 35U, 44U, 53U, 62U, 71U, 80U, 89U, 98U, 107U, 116U, 125U, 134U, 143U }; -const uint32_t PUNCTURE_LIST[] = { - 1U, 5U, 9U, 13U, 17U, 21U, 25U, 29U, 33U, 37U, - 41U, 45U, 49U, 53U, 57U, 61U, 65U, 69U, 73U, 77U, +const uint32_t PUNCTURE_LIST[] = { + 1U, 5U, 9U, 13U, 17U, 21U, 25U, 29U, 33U, 37U, + 41U, 45U, 49U, 53U, 57U, 61U, 65U, 69U, 73U, 77U, 81U, 85U, 89U, 93U, 97U, 101U, 105U, 109U, 113U, 117U, 121U, 125U, 129U, 133U, 137U, 141U, 145U, 149U, 153U, 157U, 161U, 165U, 169U, 173U, 177U, 181U, 185U, 189U }; diff --git a/src/nxdn/channel/LICH.cpp b/src/nxdn/channel/LICH.cpp index 33cf5da4..d2f434d7 100644 --- a/src/nxdn/channel/LICH.cpp +++ b/src/nxdn/channel/LICH.cpp @@ -198,7 +198,7 @@ void LICH::copy(const LICH& data) } /// -/// +/// /// /// bool LICH::getParity() const diff --git a/src/nxdn/channel/UDCH.cpp b/src/nxdn/channel/UDCH.cpp index 06239cde..35a6edc5 100644 --- a/src/nxdn/channel/UDCH.cpp +++ b/src/nxdn/channel/UDCH.cpp @@ -77,7 +77,7 @@ const uint32_t INTERLEAVE_TABLE[] = { 27U, 56U, 85U, 114U, 143U, 172U, 201U, 230U, 259U, 288U, 317U, 346U, 28U, 57U, 86U, 115U, 144U, 173U, 202U, 231U, 260U, 289U, 318U, 347U }; -const uint32_t PUNCTURE_LIST[] = { +const uint32_t PUNCTURE_LIST[] = { 3U, 11U, 17U, 25U, 31U, 39U, 45U, 53U, 59U, 67U, 73U, 81U, 87U, 95U, 101U, 109U, 115U, 123U, 129U, 137U, 143U, 151U, 157U, 165U, 171U, 179U, 185U, 193U, 199U, 207U, diff --git a/src/nxdn/edac/Convolution.h b/src/nxdn/edac/Convolution.h index 1ceebb8b..ff10d493 100644 --- a/src/nxdn/edac/Convolution.h +++ b/src/nxdn/edac/Convolution.h @@ -55,7 +55,7 @@ namespace nxdn void start(); /// uint32_t chainback(uint8_t* out, uint32_t nBits); - + /// bool decode(uint8_t s0, uint8_t s1); /// diff --git a/src/nxdn/lc/RTCH.cpp b/src/nxdn/lc/RTCH.cpp index ae630b85..1b8a606a 100644 --- a/src/nxdn/lc/RTCH.cpp +++ b/src/nxdn/lc/RTCH.cpp @@ -281,7 +281,7 @@ bool RTCH::decodeLC(const uint8_t* data) m_transmissionMode = (data[2U] & 0x07U); // Transmission Mode m_srcId = (uint16_t)((data[3U] << 8) | data[4U]) & 0xFFFFU; // Source Radio Address m_dstId = (uint16_t)((data[5U] << 8) | data[6U]) & 0xFFFFU; // Target Radio Address - + m_rsp = PacketInformation(); m_rsp.decode(m_messageType, data + 7U); // Response break; diff --git a/src/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.cpp b/src/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.cpp index a2978763..53595fa0 100644 --- a/src/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.cpp +++ b/src/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.cpp @@ -89,7 +89,7 @@ void MESSAGE_TYPE_VCALL_ASSGN::encode(uint8_t* data, uint32_t length, uint32_t o rcch[7U] = (m_grpVchNo >> 10) & 0x03U; // Channel rcch[8U] = (m_grpVchNo & 0xFFU); // ... - + rcch[10U] = (m_siteData.locId() >> 8) & 0xFFU; // Location ID rcch[11U] = (m_siteData.locId() >> 0) & 0xFFU; // ... diff --git a/src/nxdn/lc/rcch/RCCHFactory.cpp b/src/nxdn/lc/rcch/RCCHFactory.cpp index 4c28ee67..000c0a2a 100644 --- a/src/nxdn/lc/rcch/RCCHFactory.cpp +++ b/src/nxdn/lc/rcch/RCCHFactory.cpp @@ -95,7 +95,7 @@ std::unique_ptr RCCHFactory::createRCCH(const uint8_t* data, uint32_t leng return nullptr; } - return nullptr; + return nullptr; } // --------------------------------------------------------------------------- @@ -103,7 +103,7 @@ std::unique_ptr RCCHFactory::createRCCH(const uint8_t* data, uint32_t leng // --------------------------------------------------------------------------- /// -/// +/// /// /// /// diff --git a/src/nxdn/packet/Data.cpp b/src/nxdn/packet/Data.cpp index 107542bc..aad585f3 100644 --- a/src/nxdn/packet/Data.cpp +++ b/src/nxdn/packet/Data.cpp @@ -52,8 +52,8 @@ using namespace nxdn::packet; // Macros // --------------------------------------------------------------------------- -// Don't process RF frames if the network isn't in a idle state and the RF destination -// is the network destination and stop network frames from processing -- RF wants to +// Don't process RF frames if the network isn't in a idle state and the RF destination +// is the network destination and stop network frames from processing -- RF wants to // transmit on a different talkgroup #define CHECK_TRAFFIC_COLLISION(_SRC_ID, _DST_ID) \ if (m_nxdn->m_netState != RS_NET_IDLE && _DST_ID == m_nxdn->m_netLastDstId) { \ @@ -76,7 +76,7 @@ using namespace nxdn::packet; } \ } -// Don't process network frames if the destination ID's don't match and the network TG hang +// Don't process network frames if the destination ID's don't match and the network TG hang // timer is running, and don't process network frames if the RF modem isn't in a listening state #define CHECK_NET_TRAFFIC_COLLISION(_LAYER3, _SRC_ID, _DST_ID) \ if (m_nxdn->m_rfLastDstId != 0U) { \ @@ -269,7 +269,7 @@ bool Data::process(uint8_t option, uint8_t* data, uint32_t len) if (data[0U] == modem::TAG_EOT) { ::ActivityLog("NXDN", true, "RF ended RF data transmission"); - LogMessage(LOG_RF, "NXDN, " NXDN_RTCH_MSG_TYPE_TX_REL ", total frames: %d", + LogMessage(LOG_RF, "NXDN, " NXDN_RTCH_MSG_TYPE_TX_REL ", total frames: %d", m_nxdn->m_voice->m_rfFrames); m_nxdn->writeEndRF(); @@ -292,7 +292,7 @@ bool Data::processNetwork(uint8_t option, lc::RTCH& netLC, uint8_t* data, uint32 if (m_nxdn->m_netState == RS_NET_IDLE) { m_nxdn->m_queue.clear(); - + resetRF(); resetNet(); } @@ -374,7 +374,7 @@ bool Data::processNetwork(uint8_t option, lc::RTCH& netLC, uint8_t* data, uint32 if (data[0U] == modem::TAG_EOT) { ::ActivityLog("NXDN", true, "network ended RF data transmission"); - LogMessage(LOG_NET, "NXDN, " NXDN_RTCH_MSG_TYPE_TX_REL ", total frames: %d", + LogMessage(LOG_NET, "NXDN, " NXDN_RTCH_MSG_TYPE_TX_REL ", total frames: %d", m_nxdn->m_voice->m_netFrames); m_nxdn->writeEndNet(); diff --git a/src/nxdn/packet/Data.h b/src/nxdn/packet/Data.h index d0e9a66f..c7e01107 100644 --- a/src/nxdn/packet/Data.h +++ b/src/nxdn/packet/Data.h @@ -43,7 +43,7 @@ namespace nxdn // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + class HOST_SW_API Control; namespace packet diff --git a/src/nxdn/packet/Trunk.cpp b/src/nxdn/packet/Trunk.cpp index be538d63..e3cc1e76 100644 --- a/src/nxdn/packet/Trunk.cpp +++ b/src/nxdn/packet/Trunk.cpp @@ -378,7 +378,7 @@ void Trunk::writeRF_ControlData(uint8_t frameCnt, uint8_t n, bool adjSS) } switch (n) - { + { case 0: writeRF_CC_Message_Site_Info(); break; @@ -624,7 +624,7 @@ void Trunk::writeRF_Message_Deny(uint32_t srcId, uint32_t dstId, uint8_t reason, rcch->setDstId(dstId); if (m_verbose) { - LogMessage(LOG_RF, "NXDN, MSG_DENIAL (Message Denial), reason = $%02X, service = $%02X, srcId = %u, dstId = %u", + LogMessage(LOG_RF, "NXDN, MSG_DENIAL (Message Denial), reason = $%02X, service = $%02X, srcId = %u, dstId = %u", service, srcId, dstId); } diff --git a/src/nxdn/packet/Trunk.h b/src/nxdn/packet/Trunk.h index 89d5f789..ae0193b9 100644 --- a/src/nxdn/packet/Trunk.h +++ b/src/nxdn/packet/Trunk.h @@ -43,7 +43,7 @@ namespace nxdn // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + namespace packet { class HOST_SW_API Data; } namespace packet { class HOST_SW_API Voice; } class HOST_SW_API Control; diff --git a/src/nxdn/packet/Voice.cpp b/src/nxdn/packet/Voice.cpp index 0a3360ec..6756170d 100644 --- a/src/nxdn/packet/Voice.cpp +++ b/src/nxdn/packet/Voice.cpp @@ -54,8 +54,8 @@ using namespace nxdn::packet; // Macros // --------------------------------------------------------------------------- -// Don't process RF frames if the network isn't in a idle state and the RF destination -// is the network destination and stop network frames from processing -- RF wants to +// Don't process RF frames if the network isn't in a idle state and the RF destination +// is the network destination and stop network frames from processing -- RF wants to // transmit on a different talkgroup #define CHECK_TRAFFIC_COLLISION(_SRC_ID, _DST_ID) \ if (m_nxdn->m_netState != RS_NET_IDLE && _DST_ID == m_nxdn->m_netLastDstId) { \ @@ -78,7 +78,7 @@ using namespace nxdn::packet; } \ } -// Don't process network frames if the destination ID's don't match and the network TG hang +// Don't process network frames if the destination ID's don't match and the network TG hang // timer is running, and don't process network frames if the RF modem isn't in a listening state #define CHECK_NET_TRAFFIC_COLLISION(_LAYER3, _SRC_ID, _DST_ID) \ if (m_nxdn->m_rfLastDstId != 0U) { \ @@ -290,16 +290,16 @@ bool Voice::process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len) if (data[0U] == modem::TAG_EOT) { m_rfFrames++; if (m_nxdn->m_rssi != 0U) { - ::ActivityLog("NXDN", true, "RF end of transmission, %.1f seconds, BER: %.1f%%, RSSI : -%u / -%u / -%u dBm", - float(m_rfFrames) / 12.5F, float(m_rfErrs * 100U) / float(m_rfBits), m_nxdn->m_minRSSI, m_nxdn->m_maxRSSI, + ::ActivityLog("NXDN", true, "RF end of transmission, %.1f seconds, BER: %.1f%%, RSSI : -%u / -%u / -%u dBm", + float(m_rfFrames) / 12.5F, float(m_rfErrs * 100U) / float(m_rfBits), m_nxdn->m_minRSSI, m_nxdn->m_maxRSSI, m_nxdn->m_aveRSSI / m_nxdn->m_rssiCount); } else { - ::ActivityLog("NXDN", true, "RF end of transmission, %.1f seconds, BER: %.1f%%", + ::ActivityLog("NXDN", true, "RF end of transmission, %.1f seconds, BER: %.1f%%", float(m_rfFrames) / 12.5F, float(m_rfErrs * 100U) / float(m_rfBits)); } - LogMessage(LOG_RF, "NXDN, " NXDN_RTCH_MSG_TYPE_TX_REL ", total frames: %d, bits: %d, undecodable LC: %d, errors: %d, BER: %.4f%%", + LogMessage(LOG_RF, "NXDN, " NXDN_RTCH_MSG_TYPE_TX_REL ", total frames: %d, bits: %d, undecodable LC: %d, errors: %d, BER: %.4f%%", m_rfFrames, m_rfBits, m_rfUndecodableLC, m_rfErrs, float(m_rfErrs * 100U) / float(m_rfBits)); m_nxdn->writeEndRF(); @@ -309,7 +309,7 @@ bool Voice::process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len) m_rfBits = 1U; m_nxdn->m_rfTimeout.start(); m_nxdn->m_rfState = RS_RF_AUDIO; - + m_nxdn->m_minRSSI = m_nxdn->m_rssi; m_nxdn->m_maxRSSI = m_nxdn->m_rssi; m_nxdn->m_aveRSSI = m_nxdn->m_rssi; @@ -500,7 +500,7 @@ bool Voice::process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len) // regenerate the audio and interpret the FACCH1 data if (option == NXDN_LICH_STEAL_NONE) { edac::AMBEFEC ambe; - + uint32_t errors = 0U; errors += ambe.regenerateNXDN(data + 2U + NXDN_FSW_LICH_SACCH_LENGTH_BYTES + 0U); @@ -536,7 +536,7 @@ bool Voice::process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len) edac::AMBEFEC ambe; uint32_t errors = 0U; - + errors += ambe.regenerateNXDN(data + 2U + NXDN_FSW_LICH_SACCH_LENGTH_BYTES + 18U); errors += ambe.regenerateNXDN(data + 2U + NXDN_FSW_LICH_SACCH_LENGTH_BYTES + 27U); @@ -550,10 +550,10 @@ bool Voice::process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len) LogWarning(LOG_RF, "NXDN, " NXDN_RTCH_MSG_TYPE_VCALL ", exceeded lost audio threshold, filling in"); } - + m_rfErrs += errors; m_rfBits += 94U; - + if (m_verbose) { LogMessage(LOG_RF, "NXDN, " NXDN_RTCH_MSG_TYPE_VCALL ", audio, errs = %u/94 (%.1f%%)", errors, float(errors) / 0.94F); } @@ -561,7 +561,7 @@ bool Voice::process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len) edac::AMBEFEC ambe; uint32_t errors = 0U; - + errors += ambe.regenerateNXDN(data + 2U + NXDN_FSW_LICH_SACCH_LENGTH_BYTES + 0U); errors += ambe.regenerateNXDN(data + 2U + NXDN_FSW_LICH_SACCH_LENGTH_BYTES + 9U); @@ -575,7 +575,7 @@ bool Voice::process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len) LogWarning(LOG_RF, "NXDN, " NXDN_RTCH_MSG_TYPE_VCALL ", exceeded lost audio threshold, filling in"); } - + m_rfErrs += errors; m_rfBits += 94U; @@ -634,7 +634,7 @@ bool Voice::processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t if (m_nxdn->m_netState == RS_NET_IDLE) { m_nxdn->m_queue.clear(); - + resetRF(); resetNet(); } @@ -727,7 +727,7 @@ bool Voice::processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t if (data[0U] == modem::TAG_EOT) { m_netFrames++; - ::ActivityLog("NXDN", false, "network end of transmission, %.1f seconds", + ::ActivityLog("NXDN", false, "network end of transmission, %.1f seconds", float(m_netFrames) / 12.5F); LogMessage(LOG_NET, "NXDN, " NXDN_RTCH_MSG_TYPE_TX_REL ", total frames: %d", m_netFrames); @@ -909,7 +909,7 @@ bool Voice::processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t // regenerate the audio and interpret the FACCH1 data if (option == NXDN_LICH_STEAL_NONE) { edac::AMBEFEC ambe; - + uint32_t errors = 0U; errors += ambe.regenerateNXDN(data + 2U + NXDN_FSW_LICH_SACCH_LENGTH_BYTES + 0U); @@ -932,13 +932,13 @@ bool Voice::processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t edac::AMBEFEC ambe; uint32_t errors = 0U; - + errors += ambe.regenerateNXDN(data + 2U + NXDN_FSW_LICH_SACCH_LENGTH_BYTES + 18U); errors += ambe.regenerateNXDN(data + 2U + NXDN_FSW_LICH_SACCH_LENGTH_BYTES + 27U); - + m_rfErrs += errors; m_rfBits += 94U; - + if (m_verbose) { LogMessage(LOG_NET, "NXDN, " NXDN_RTCH_MSG_TYPE_VCALL ", audio, errs = %u/94 (%.1f%%)", errors, float(errors) / 0.94F); } @@ -946,10 +946,10 @@ bool Voice::processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t edac::AMBEFEC ambe; uint32_t errors = 0U; - + errors += ambe.regenerateNXDN(data + 2U + NXDN_FSW_LICH_SACCH_LENGTH_BYTES); errors += ambe.regenerateNXDN(data + 2U + NXDN_FSW_LICH_SACCH_LENGTH_BYTES + 9U); - + m_rfErrs += errors; m_rfBits += 94U; diff --git a/src/nxdn/packet/Voice.h b/src/nxdn/packet/Voice.h index e12e3689..33bd88c2 100644 --- a/src/nxdn/packet/Voice.h +++ b/src/nxdn/packet/Voice.h @@ -43,7 +43,7 @@ namespace nxdn // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + namespace packet { class HOST_SW_API Data; } class HOST_SW_API Control; diff --git a/src/p25/Control.cpp b/src/p25/Control.cpp index 7a277a45..0ed81b18 100644 --- a/src/p25/Control.cpp +++ b/src/p25/Control.cpp @@ -221,8 +221,8 @@ void Control::reset() /// Channel ID. /// Channel Number. /// -void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cwCallsign, const std::vector voiceChNo, - const std::unordered_map voiceChData, uint32_t pSuperGroup, uint32_t netId, +void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cwCallsign, const std::vector voiceChNo, + const std::unordered_map voiceChData, uint32_t pSuperGroup, uint32_t netId, uint32_t sysId, uint8_t rfssId, uint8_t siteId, uint8_t channelId, uint32_t channelNo, bool printOptions) { yaml::Node systemConf = conf["system"]; @@ -278,7 +278,7 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw LogWarning(LOG_P25, "Silence threshold set to zero, defaulting to %u", p25::MAX_P25_VOICE_ERRORS); m_voice->m_silenceThreshold = p25::MAX_P25_VOICE_ERRORS; } - + m_disableNetworkHDU = p25Protocol["disableNetworkHDU"].as(false); bool disableCompositeFlag = p25Protocol["disableCompositeFlag"].as(false); @@ -321,7 +321,7 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw m_affiliations.setRFChData(chData); // set the grant release callback - m_affiliations.setReleaseGrantCallback([=](uint32_t chNo, uint32_t dstId, uint8_t slot) { + m_affiliations.setReleaseGrantCallback([=](uint32_t chNo, uint32_t dstId, uint8_t slot) { // callback REST API to clear TG permit for the granted TG on the specified voice channel if (m_authoritative && m_supervisor) { ::lookups::VoiceChData voiceChData = m_affiliations.getRFChData(chNo); diff --git a/src/p25/Control.h b/src/p25/Control.h index f8bcbfd6..8b34b801 100644 --- a/src/p25/Control.h +++ b/src/p25/Control.h @@ -57,7 +57,7 @@ namespace p25 // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + namespace packet { class HOST_SW_API Voice; } namespace dfsi { namespace packet { class HOST_SW_API DFSIVoice; } } namespace packet { class HOST_SW_API Data; } @@ -84,10 +84,10 @@ namespace p25 void reset(); /// Helper to set P25 configuration options. - void setOptions(yaml::Node& conf, bool supervisor, const std::string cwCallsign, const std::vector voiceChNo, - const std::unordered_map voiceChData, uint32_t pSuperGroup, uint32_t netId, + void setOptions(yaml::Node& conf, bool supervisor, const std::string cwCallsign, const std::vector voiceChNo, + const std::unordered_map voiceChData, uint32_t pSuperGroup, uint32_t netId, uint32_t sysId, uint8_t rfssId, uint8_t siteId, uint8_t channelId, uint32_t channelNo, bool printOptions); - + /// Gets a flag indicating whether the P25 control channel is running. bool getCCRunning() { return m_ccRunning; } /// Sets a flag indicating whether the P25 control channel is running. @@ -197,7 +197,7 @@ namespace p25 uint32_t m_hangCount; uint32_t m_tduPreambleCount; - + uint8_t m_ccFrameCnt; uint8_t m_ccSeq; diff --git a/src/p25/data/DataBlock.cpp b/src/p25/data/DataBlock.cpp index cf337af8..4f9a9f51 100644 --- a/src/p25/data/DataBlock.cpp +++ b/src/p25/data/DataBlock.cpp @@ -113,7 +113,7 @@ bool DataBlock::decode(const uint8_t* data, const DataHeader header) // if this is extended addressing and the first block decode the SAP and LLId if (m_headerSap == PDU_SAP_EXT_ADDR && m_serialNo == 0U) { - count = P25_PDU_CONFIRMED_DATA_LENGTH_BYTES - 4U; + count = P25_PDU_CONFIRMED_DATA_LENGTH_BYTES - 4U; m_sap = buffer[5U] & 0x3FU; // Service Access Point m_llId = (buffer[2U] << 16) + (buffer[3U] << 8) + buffer[4U]; // Logical Link ID @@ -275,7 +275,7 @@ uint32_t DataBlock::getData(uint8_t* buffer) const if (m_fmt == PDU_FMT_CONFIRMED) { ::memcpy(buffer, m_data, P25_PDU_CONFIRMED_DATA_LENGTH_BYTES); return P25_PDU_CONFIRMED_DATA_LENGTH_BYTES; - } + } else if (m_fmt == PDU_FMT_UNCONFIRMED || m_fmt == PDU_FMT_RSP || m_fmt == PDU_FMT_AMBT) { ::memcpy(buffer, m_data, P25_PDU_UNCONFIRMED_LENGTH_BYTES); return P25_PDU_UNCONFIRMED_LENGTH_BYTES; diff --git a/src/p25/data/DataHeader.cpp b/src/p25/data/DataHeader.cpp index a359f4e7..856aa0a5 100644 --- a/src/p25/data/DataHeader.cpp +++ b/src/p25/data/DataHeader.cpp @@ -280,7 +280,7 @@ void DataHeader::reset() m_rspClass = PDU_ACK_CLASS_NACK; m_rspType = PDU_ACK_TYPE_NACK_ILLEGAL; m_rspStatus = 0U; - + m_ambtOpcode = 0U; m_ambtField8 = 0U; m_ambtField9 = 0U; diff --git a/src/p25/dfsi/LC.cpp b/src/p25/dfsi/LC.cpp index 0909c1e5..b5afa5d9 100644 --- a/src/p25/dfsi/LC.cpp +++ b/src/p25/dfsi/LC.cpp @@ -551,7 +551,7 @@ bool LC::decodeLDU2(const uint8_t* data, uint8_t* imbe) case P25_DFSI_LDU2_VOICE12: { m_mi[0U] = data[1U]; // Message Indicator - m_mi[1U] = data[2U]; + m_mi[1U] = data[2U]; m_mi[2U] = data[3U]; ::memcpy(imbe, data + 5U, P25_RAW_IMBE_LENGTH_BYTES); // IMBE } @@ -559,7 +559,7 @@ bool LC::decodeLDU2(const uint8_t* data, uint8_t* imbe) case P25_DFSI_LDU2_VOICE13: { m_mi[3U] = data[1U]; // Message Indicator - m_mi[4U] = data[2U]; + m_mi[4U] = data[2U]; m_mi[5U] = data[3U]; ::memcpy(imbe, data + 5U, P25_RAW_IMBE_LENGTH_BYTES); // IMBE } @@ -567,7 +567,7 @@ bool LC::decodeLDU2(const uint8_t* data, uint8_t* imbe) case P25_DFSI_LDU2_VOICE14: { m_mi[6U] = data[1U]; // Message Indicator - m_mi[7U] = data[2U]; + m_mi[7U] = data[2U]; m_mi[8U] = data[3U]; m_control->setMI(m_mi); ::memcpy(imbe, data + 5U, P25_RAW_IMBE_LENGTH_BYTES); // IMBE diff --git a/src/p25/dfsi/packet/DFSITrunk.cpp b/src/p25/dfsi/packet/DFSITrunk.cpp index 0f7ccc6b..b78cafff 100644 --- a/src/p25/dfsi/packet/DFSITrunk.cpp +++ b/src/p25/dfsi/packet/DFSITrunk.cpp @@ -224,7 +224,7 @@ void DFSITrunk::writeRF_DFSI_Start(uint8_t type) { uint8_t buffer[P25_DFSI_SS_FRAME_LENGTH_BYTES + 2U]; ::memset(buffer, 0x00U, P25_DFSI_SS_FRAME_LENGTH_BYTES + 2U); - + // Generate Start/Stop m_rfDFSILC.setFrameType(P25_DFSI_START_STOP); m_rfDFSILC.setStartStop(P25_DFSI_START_FLAG); @@ -247,7 +247,7 @@ void DFSITrunk::writeRF_DSFI_Stop(uint8_t type) { uint8_t buffer[P25_DFSI_SS_FRAME_LENGTH_BYTES + 2U]; ::memset(buffer, 0x00U, P25_DFSI_SS_FRAME_LENGTH_BYTES + 2U); - + // Generate Start/Stop m_rfDFSILC.setFrameType(P25_DFSI_START_STOP); m_rfDFSILC.setStartStop(P25_DFSI_STOP_FLAG); diff --git a/src/p25/dfsi/packet/DFSITrunk.h b/src/p25/dfsi/packet/DFSITrunk.h index 696472ef..b7393233 100644 --- a/src/p25/dfsi/packet/DFSITrunk.h +++ b/src/p25/dfsi/packet/DFSITrunk.h @@ -36,7 +36,7 @@ namespace p25 // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + namespace packet { class HOST_SW_API Trunk; } class HOST_SW_API Control; diff --git a/src/p25/dfsi/packet/DFSIVoice.cpp b/src/p25/dfsi/packet/DFSIVoice.cpp index d4be64d3..5f247aa2 100644 --- a/src/p25/dfsi/packet/DFSIVoice.cpp +++ b/src/p25/dfsi/packet/DFSIVoice.cpp @@ -595,16 +595,16 @@ bool DFSIVoice::process(uint8_t* data, uint32_t len) if (m_p25->m_rfState == RS_RF_AUDIO) { if (m_p25->m_rssi != 0U) { - ::ActivityLog("P25", true, "RF end of transmission, %.1f seconds, BER: %.1f%%, RSSI : -%u / -%u / -%u dBm", - float(m_rfFrames) / 5.56F, float(m_rfErrs * 100U) / float(m_rfBits), m_p25->m_minRSSI, m_p25->m_maxRSSI, + ::ActivityLog("P25", true, "RF end of transmission, %.1f seconds, BER: %.1f%%, RSSI : -%u / -%u / -%u dBm", + float(m_rfFrames) / 5.56F, float(m_rfErrs * 100U) / float(m_rfBits), m_p25->m_minRSSI, m_p25->m_maxRSSI, m_p25->m_aveRSSI / m_p25->m_rssiCount); } else { - ::ActivityLog("P25", true, "RF end of transmission, %.1f seconds, BER: %.1f%%", + ::ActivityLog("P25", true, "RF end of transmission, %.1f seconds, BER: %.1f%%", float(m_rfFrames) / 5.56F, float(m_rfErrs * 100U) / float(m_rfBits)); } - LogMessage(LOG_RF, P25_TDU_STR " DFSI, total frames: %d, bits: %d, undecodable LC: %d, errors: %d, BER: %.4f%%", + LogMessage(LOG_RF, P25_TDU_STR " DFSI, total frames: %d, bits: %d, undecodable LC: %d, errors: %d, BER: %.4f%%", m_rfFrames, m_rfBits, m_rfUndecodableLC, m_rfErrs, float(m_rfErrs * 100U) / float(m_rfBits)); if (m_p25->m_dedicatedControl) { @@ -1127,10 +1127,10 @@ void DFSIVoice::writeNet_LDU1() // Generate Voice Frame m_netDFSILC.setFrameType(i); m_netDFSILC.encodeLDU1(buffer + 2U, m_netLDU1 + n); - + buffer[0U] = modem::TAG_DATA; buffer[1U] = 0x00U; - + m_p25->addFrame(buffer, len + 2U, true); } diff --git a/src/p25/dfsi/packet/DFSIVoice.h b/src/p25/dfsi/packet/DFSIVoice.h index f501a253..fd286620 100644 --- a/src/p25/dfsi/packet/DFSIVoice.h +++ b/src/p25/dfsi/packet/DFSIVoice.h @@ -41,7 +41,7 @@ namespace p25 // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + namespace packet { class HOST_SW_API Voice; } class HOST_SW_API Control; diff --git a/src/p25/lc/AMBT.h b/src/p25/lc/AMBT.h index c537b87d..91194424 100644 --- a/src/p25/lc/AMBT.h +++ b/src/p25/lc/AMBT.h @@ -54,7 +54,7 @@ namespace p25 virtual bool decode(const uint8_t* data, bool rawTSBK = false); /// Encode a trunking signalling block. virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false); - + protected: /// Internal helper to convert TSBK bytes to a 64-bit long value. static ulong64_t toValue(const data::DataHeader dataHeader, const uint8_t* pduUserData); diff --git a/src/p25/lc/LC.cpp b/src/p25/lc/LC.cpp index 09ff55fb..57e5fe64 100644 --- a/src/p25/lc/LC.cpp +++ b/src/p25/lc/LC.cpp @@ -445,7 +445,7 @@ void LC::encodeLDU2(uint8_t* data) // encode RS (24,16,9) FEC m_rs.encode24169(rs); - + #if DEBUG_P25_LDU2 Utils::dump(2U, "LC::encodeLDU2(), LDU2 RS", rs, P25_LDU_LC_LENGTH_BYTES); #endif @@ -572,7 +572,7 @@ bool LC::decodeLC(const uint8_t* rs) m_protect = (rs[0U] & 0x80U) == 0x80U; // Protect Flag m_lco = rs[0U] & 0x3FU; // LCO - + m_mfId = rs[1U]; // Mfg Id. // Motorola P25 vendor opcodes (these are just detected for passthru) diff --git a/src/p25/lc/TDULC.h b/src/p25/lc/TDULC.h index be0594fc..7547e264 100644 --- a/src/p25/lc/TDULC.h +++ b/src/p25/lc/TDULC.h @@ -43,7 +43,7 @@ namespace p25 // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + class HOST_SW_API LC; class HOST_SW_API TSBK; diff --git a/src/p25/lc/TSBK.cpp b/src/p25/lc/TSBK.cpp index 31adf050..4ab9b99a 100644 --- a/src/p25/lc/TSBK.cpp +++ b/src/p25/lc/TSBK.cpp @@ -99,7 +99,7 @@ TSBK::TSBK() : m_service(0U), m_response(P25_RSP_ACCEPT), m_netId(P25_WACN_STD_DEFAULT), - m_sysId(P25_SID_STD_DEFAULT), + m_sysId(P25_SID_STD_DEFAULT), m_emergency(false), m_encrypted(false), m_priority(4U), diff --git a/src/p25/lc/TSBK.h b/src/p25/lc/TSBK.h index b8b1c3ed..a9cb6838 100644 --- a/src/p25/lc/TSBK.h +++ b/src/p25/lc/TSBK.h @@ -71,7 +71,7 @@ namespace p25 TSBK(); /// Finalizes a instance of the TSBK class. virtual ~TSBK(); - + /// Decode a trunking signalling block. virtual bool decode(const uint8_t* data, bool rawTSBK = false) = 0; /// Encode a trunking signalling block. diff --git a/src/p25/lc/tdulc/LC_GROUP.cpp b/src/p25/lc/tdulc/LC_GROUP.cpp index 5f2e8269..dfe9f43e 100644 --- a/src/p25/lc/tdulc/LC_GROUP.cpp +++ b/src/p25/lc/tdulc/LC_GROUP.cpp @@ -64,7 +64,7 @@ bool LC_GROUP::decode(const uint8_t* data) return false; ulong64_t rsValue = TDULC::toValue(rs); - + m_mfId = rs[1U]; // Mfg Id. m_group = true; m_emergency = (rs[2U] & 0x80U) == 0x80U; // Emergency Flag diff --git a/src/p25/lc/tdulc/LC_PRIVATE.cpp b/src/p25/lc/tdulc/LC_PRIVATE.cpp index 8be79281..469b8f50 100644 --- a/src/p25/lc/tdulc/LC_PRIVATE.cpp +++ b/src/p25/lc/tdulc/LC_PRIVATE.cpp @@ -64,7 +64,7 @@ bool LC_PRIVATE::decode(const uint8_t* data) return false; ulong64_t rsValue = TDULC::toValue(rs); - + m_mfId = rs[1U]; // Mfg Id. m_group = false; m_emergency = (rs[2U] & 0x80U) == 0x80U; // Emergency Flag diff --git a/src/p25/lc/tdulc/LC_TEL_INT_VCH_USER.cpp b/src/p25/lc/tdulc/LC_TEL_INT_VCH_USER.cpp index 7e4c6d83..3d226392 100644 --- a/src/p25/lc/tdulc/LC_TEL_INT_VCH_USER.cpp +++ b/src/p25/lc/tdulc/LC_TEL_INT_VCH_USER.cpp @@ -64,7 +64,7 @@ bool LC_TEL_INT_VCH_USER::decode(const uint8_t* data) return false; ulong64_t rsValue = TDULC::toValue(rs); - + m_emergency = (rs[2U] & 0x80U) == 0x80U; // Emergency Flag m_encrypted = (rs[2U] & 0x40U) == 0x40U; // Encryption Flag m_priority = (rs[2U] & 0x07U); // Priority diff --git a/src/p25/lc/tdulc/TDULCFactory.cpp b/src/p25/lc/tdulc/TDULCFactory.cpp index d31b525a..3b6a2260 100644 --- a/src/p25/lc/tdulc/TDULCFactory.cpp +++ b/src/p25/lc/tdulc/TDULCFactory.cpp @@ -110,7 +110,7 @@ std::unique_ptr TDULCFactory::createTDULC(const uint8_t* data) break; } - return nullptr; + return nullptr; } // --------------------------------------------------------------------------- @@ -118,7 +118,7 @@ std::unique_ptr TDULCFactory::createTDULC(const uint8_t* data) // --------------------------------------------------------------------------- /// -/// +/// /// /// /// diff --git a/src/p25/lc/tsbk/IOSP_ACK_RSP.cpp b/src/p25/lc/tsbk/IOSP_ACK_RSP.cpp index 27aa4042..363ec02d 100644 --- a/src/p25/lc/tsbk/IOSP_ACK_RSP.cpp +++ b/src/p25/lc/tsbk/IOSP_ACK_RSP.cpp @@ -65,11 +65,11 @@ bool IOSP_ACK_RSP::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_aivFlag = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Additional Info. Flag m_service = (uint8_t)((tsbkValue >> 56) & 0x3FU); // Service Type m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address - m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address + m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address return true; } diff --git a/src/p25/lc/tsbk/IOSP_CALL_ALRT.cpp b/src/p25/lc/tsbk/IOSP_CALL_ALRT.cpp index db27dc04..3de109df 100644 --- a/src/p25/lc/tsbk/IOSP_CALL_ALRT.cpp +++ b/src/p25/lc/tsbk/IOSP_CALL_ALRT.cpp @@ -65,7 +65,7 @@ bool IOSP_CALL_ALRT::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/p25/lc/tsbk/IOSP_EXT_FNCT.h b/src/p25/lc/tsbk/IOSP_EXT_FNCT.h index 4a96d962..c95c4022 100644 --- a/src/p25/lc/tsbk/IOSP_EXT_FNCT.h +++ b/src/p25/lc/tsbk/IOSP_EXT_FNCT.h @@ -50,7 +50,7 @@ namespace p25 virtual bool decode(const uint8_t* data, bool rawTSBK = false); /// Encode a trunking signalling block. virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false); - + public: /// Extended function opcode. __PROPERTY(uint32_t, extendedFunction, ExtendedFunction); diff --git a/src/p25/lc/tsbk/IOSP_GRP_AFF.cpp b/src/p25/lc/tsbk/IOSP_GRP_AFF.cpp index e4571d65..e80b8b5b 100644 --- a/src/p25/lc/tsbk/IOSP_GRP_AFF.cpp +++ b/src/p25/lc/tsbk/IOSP_GRP_AFF.cpp @@ -66,10 +66,10 @@ bool IOSP_GRP_AFF::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_sysId = (uint32_t)((tsbkValue >> 40) & 0xFFFU); // System ID m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFU); // Talkgroup Address - m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address + m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address return true; } diff --git a/src/p25/lc/tsbk/IOSP_GRP_AFF.h b/src/p25/lc/tsbk/IOSP_GRP_AFF.h index 68075fa3..beeb3173 100644 --- a/src/p25/lc/tsbk/IOSP_GRP_AFF.h +++ b/src/p25/lc/tsbk/IOSP_GRP_AFF.h @@ -50,7 +50,7 @@ namespace p25 virtual bool decode(const uint8_t* data, bool rawTSBK = false); /// Encode a trunking signalling block. virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false); - + public: /// Announcement group. __PROPERTY(uint32_t, announceGroup, AnnounceGroup); diff --git a/src/p25/lc/tsbk/IOSP_GRP_VCH.cpp b/src/p25/lc/tsbk/IOSP_GRP_VCH.cpp index 449451f4..87d86e1a 100644 --- a/src/p25/lc/tsbk/IOSP_GRP_VCH.cpp +++ b/src/p25/lc/tsbk/IOSP_GRP_VCH.cpp @@ -65,7 +65,7 @@ bool IOSP_GRP_VCH::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_emergency = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Emergency Flag m_encrypted = (((tsbkValue >> 56) & 0xFFU) & 0x40U) == 0x40U; // Encryption Flag m_priority = (((tsbkValue >> 56) & 0xFFU) & 0x07U); // Priority diff --git a/src/p25/lc/tsbk/IOSP_MSG_UPDT.cpp b/src/p25/lc/tsbk/IOSP_MSG_UPDT.cpp index 90d52ce5..26e57ddb 100644 --- a/src/p25/lc/tsbk/IOSP_MSG_UPDT.cpp +++ b/src/p25/lc/tsbk/IOSP_MSG_UPDT.cpp @@ -66,7 +66,7 @@ bool IOSP_MSG_UPDT::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_messageValue = (uint8_t)((tsbkValue >> 56) & 0xFFU); // Message Value m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/p25/lc/tsbk/IOSP_RAD_MON.cpp b/src/p25/lc/tsbk/IOSP_RAD_MON.cpp index 00b93154..a507dd82 100644 --- a/src/p25/lc/tsbk/IOSP_RAD_MON.cpp +++ b/src/p25/lc/tsbk/IOSP_RAD_MON.cpp @@ -67,7 +67,7 @@ bool IOSP_RAD_MON::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_txMult = (uint8_t)((tsbkValue >> 48) & 0x3U); // TX Multiplier m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/p25/lc/tsbk/IOSP_RAD_MON.h b/src/p25/lc/tsbk/IOSP_RAD_MON.h index 12e07021..111cc260 100644 --- a/src/p25/lc/tsbk/IOSP_RAD_MON.h +++ b/src/p25/lc/tsbk/IOSP_RAD_MON.h @@ -56,7 +56,7 @@ namespace p25 /// Radio Unit Monitor. __PROPERTY(uint8_t, txMult, TxMult); - __COPY(IOSP_RAD_MON); + __COPY(IOSP_RAD_MON); }; } // namespace tsbk } // namespace lc diff --git a/src/p25/lc/tsbk/IOSP_STS_UPDT.cpp b/src/p25/lc/tsbk/IOSP_STS_UPDT.cpp index d79a61ef..864d1f39 100644 --- a/src/p25/lc/tsbk/IOSP_STS_UPDT.cpp +++ b/src/p25/lc/tsbk/IOSP_STS_UPDT.cpp @@ -66,7 +66,7 @@ bool IOSP_STS_UPDT::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_statusValue = (uint8_t)((tsbkValue >> 56) & 0xFFU); // Status Value m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/p25/lc/tsbk/IOSP_UU_ANS.cpp b/src/p25/lc/tsbk/IOSP_UU_ANS.cpp index 4b0657d5..c290341d 100644 --- a/src/p25/lc/tsbk/IOSP_UU_ANS.cpp +++ b/src/p25/lc/tsbk/IOSP_UU_ANS.cpp @@ -65,7 +65,7 @@ bool IOSP_UU_ANS::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_emergency = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Emergency Flag m_encrypted = (((tsbkValue >> 56) & 0xFFU) & 0x40U) == 0x40U; // Encryption Flag m_priority = (((tsbkValue >> 56) & 0xFFU) & 0x07U); // Priority diff --git a/src/p25/lc/tsbk/IOSP_UU_VCH.cpp b/src/p25/lc/tsbk/IOSP_UU_VCH.cpp index 188640ce..f32247a5 100644 --- a/src/p25/lc/tsbk/IOSP_UU_VCH.cpp +++ b/src/p25/lc/tsbk/IOSP_UU_VCH.cpp @@ -65,7 +65,7 @@ bool IOSP_UU_VCH::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_emergency = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Emergency Flag m_encrypted = (((tsbkValue >> 56) & 0xFFU) & 0x40U) == 0x40U; // Encryption Flag m_priority = (((tsbkValue >> 56) & 0xFFU) & 0x07U); // Priority diff --git a/src/p25/lc/tsbk/IOSP_U_REG.cpp b/src/p25/lc/tsbk/IOSP_U_REG.cpp index 30887fe1..31a732fd 100644 --- a/src/p25/lc/tsbk/IOSP_U_REG.cpp +++ b/src/p25/lc/tsbk/IOSP_U_REG.cpp @@ -65,7 +65,7 @@ bool IOSP_U_REG::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_netId = (uint32_t)((tsbkValue >> 36) & 0xFFFFFU); // Network ID m_sysId = (uint32_t)((tsbkValue >> 24) & 0xFFFU); // System ID m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/p25/lc/tsbk/ISP_AUTH_FNE_RST.cpp b/src/p25/lc/tsbk/ISP_AUTH_FNE_RST.cpp index 4f5078d9..398146b9 100644 --- a/src/p25/lc/tsbk/ISP_AUTH_FNE_RST.cpp +++ b/src/p25/lc/tsbk/ISP_AUTH_FNE_RST.cpp @@ -67,7 +67,7 @@ bool ISP_AUTH_FNE_RST::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_authSuccess = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Authentication Success Flag m_authStandalone = (((tsbkValue >> 56) & 0xFFU) & 0x01U) == 0x01U; // Authentication Standalone Flag m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/p25/lc/tsbk/ISP_AUTH_RESP.cpp b/src/p25/lc/tsbk/ISP_AUTH_RESP.cpp index 704af97b..ce1a7f79 100644 --- a/src/p25/lc/tsbk/ISP_AUTH_RESP.cpp +++ b/src/p25/lc/tsbk/ISP_AUTH_RESP.cpp @@ -81,7 +81,7 @@ bool ISP_AUTH_RESP::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_aivFlag = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Additional Info. Flag m_service = (uint8_t)((tsbkValue >> 56) & 0x3FU); // Service Type m_response = (uint8_t)((tsbkValue >> 48) & 0xFFU); // Reason diff --git a/src/p25/lc/tsbk/ISP_AUTH_RESP.h b/src/p25/lc/tsbk/ISP_AUTH_RESP.h index cdbcafee..b8685c22 100644 --- a/src/p25/lc/tsbk/ISP_AUTH_RESP.h +++ b/src/p25/lc/tsbk/ISP_AUTH_RESP.h @@ -51,7 +51,7 @@ namespace p25 virtual bool decode(const uint8_t* data, bool rawTSBK = false); /// Encode a trunking signalling block. virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false); - + /** Authentication data */ /// Gets the authentication result. void getAuthRes(uint8_t* res) const; diff --git a/src/p25/lc/tsbk/ISP_AUTH_SU_DMD.cpp b/src/p25/lc/tsbk/ISP_AUTH_SU_DMD.cpp index 0dc3881e..e26cc249 100644 --- a/src/p25/lc/tsbk/ISP_AUTH_SU_DMD.cpp +++ b/src/p25/lc/tsbk/ISP_AUTH_SU_DMD.cpp @@ -65,7 +65,7 @@ bool ISP_AUTH_SU_DMD::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address return true; diff --git a/src/p25/lc/tsbk/ISP_CAN_SRV_REQ.cpp b/src/p25/lc/tsbk/ISP_CAN_SRV_REQ.cpp index e488e898..c4af1dbc 100644 --- a/src/p25/lc/tsbk/ISP_CAN_SRV_REQ.cpp +++ b/src/p25/lc/tsbk/ISP_CAN_SRV_REQ.cpp @@ -65,7 +65,7 @@ bool ISP_CAN_SRV_REQ::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_aivFlag = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Additional Info. Flag m_service = (uint8_t)((tsbkValue >> 56) & 0x3FU); // Service Type m_response = (uint8_t)((tsbkValue >> 48) & 0xFFU); // Reason diff --git a/src/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.cpp b/src/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.cpp index bb696479..d8545419 100644 --- a/src/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.cpp +++ b/src/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.cpp @@ -66,7 +66,7 @@ bool ISP_GRP_AFF_Q_RSP::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_announceGroup = (uint32_t)((tsbkValue >> 40) & 0xFFFFU); // Announcement Group Address m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFU); // Talkgroup Address m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.h b/src/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.h index e67c3532..5e6a8a01 100644 --- a/src/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.h +++ b/src/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.h @@ -49,7 +49,7 @@ namespace p25 virtual bool decode(const uint8_t* data, bool rawTSBK = false); /// Encode a trunking signalling block. virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false); - + public: /// Announcement group. __PROPERTY(uint32_t, announceGroup, AnnounceGroup); diff --git a/src/p25/lc/tsbk/ISP_LOC_REG_REQ.cpp b/src/p25/lc/tsbk/ISP_LOC_REG_REQ.cpp index a3757545..36cddc87 100644 --- a/src/p25/lc/tsbk/ISP_LOC_REG_REQ.cpp +++ b/src/p25/lc/tsbk/ISP_LOC_REG_REQ.cpp @@ -66,7 +66,7 @@ bool ISP_LOC_REG_REQ::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_lra = (uint8_t)((tsbkValue >> 40) & 0xFFU); // LRA m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFU); // Talkgroup Address m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/p25/lc/tsbk/ISP_SNDCP_CH_REQ.cpp b/src/p25/lc/tsbk/ISP_SNDCP_CH_REQ.cpp index 4b91d5ef..5729db1e 100644 --- a/src/p25/lc/tsbk/ISP_SNDCP_CH_REQ.cpp +++ b/src/p25/lc/tsbk/ISP_SNDCP_CH_REQ.cpp @@ -67,7 +67,7 @@ bool ISP_SNDCP_CH_REQ::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_dataServiceOptions = (uint8_t)((tsbkValue >> 56) & 0xFFU); // Data Service Options m_dataAccessControl = (uint32_t)((tsbkValue >> 40) & 0xFFFFFFFFU); // Data Access Control m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/p25/lc/tsbk/ISP_U_DEREG_REQ.cpp b/src/p25/lc/tsbk/ISP_U_DEREG_REQ.cpp index b24b5fe7..f2bcbefe 100644 --- a/src/p25/lc/tsbk/ISP_U_DEREG_REQ.cpp +++ b/src/p25/lc/tsbk/ISP_U_DEREG_REQ.cpp @@ -65,7 +65,7 @@ bool ISP_U_DEREG_REQ::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_netId = (uint32_t)((tsbkValue >> 36) & 0xFFFFFU); // Network ID m_sysId = (uint32_t)((tsbkValue >> 24) & 0xFFFU); // System ID m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/p25/lc/tsbk/MBT_IOSP_EXT_FNCT.h b/src/p25/lc/tsbk/MBT_IOSP_EXT_FNCT.h index 5941fe28..42aed45c 100644 --- a/src/p25/lc/tsbk/MBT_IOSP_EXT_FNCT.h +++ b/src/p25/lc/tsbk/MBT_IOSP_EXT_FNCT.h @@ -50,7 +50,7 @@ namespace p25 virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks); /// Encode a alternate trunking signalling block. virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData); - + public: /// Extended function opcode. __PROPERTY(uint32_t, extendedFunction, ExtendedFunction); diff --git a/src/p25/lc/tsbk/MBT_OSP_ADJ_STS_BCAST.h b/src/p25/lc/tsbk/MBT_OSP_ADJ_STS_BCAST.h index 6949a359..5f42221f 100644 --- a/src/p25/lc/tsbk/MBT_OSP_ADJ_STS_BCAST.h +++ b/src/p25/lc/tsbk/MBT_OSP_ADJ_STS_BCAST.h @@ -49,7 +49,7 @@ namespace p25 virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks); /// Encode a alternate trunking signalling block. virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData); - + public: /** Adjacent Site Data */ /// Adjacent site CFVA flags. diff --git a/src/p25/lc/tsbk/OSP_ADJ_STS_BCAST.cpp b/src/p25/lc/tsbk/OSP_ADJ_STS_BCAST.cpp index c16e4415..b3c7a5bf 100644 --- a/src/p25/lc/tsbk/OSP_ADJ_STS_BCAST.cpp +++ b/src/p25/lc/tsbk/OSP_ADJ_STS_BCAST.cpp @@ -77,7 +77,7 @@ bool OSP_ADJ_STS_BCAST::decode(const uint8_t* data, bool rawTSBK) m_adjSiteId = (uint8_t)((tsbkValue >> 24) & 0xFFU); // Site ID m_adjChannelId = (uint8_t)((tsbkValue >> 20) & 0xFU); // Site Channel ID m_adjChannelNo = (uint32_t)((tsbkValue >> 8) & 0xFFFU); // Site Channel Number - m_adjServiceClass = (uint8_t)(tsbkValue & 0xFFU); // Site Service Class + m_adjServiceClass = (uint8_t)(tsbkValue & 0xFFU); // Site Service Class return true; } diff --git a/src/p25/lc/tsbk/OSP_ADJ_STS_BCAST.h b/src/p25/lc/tsbk/OSP_ADJ_STS_BCAST.h index beb6cd13..1074f8c2 100644 --- a/src/p25/lc/tsbk/OSP_ADJ_STS_BCAST.h +++ b/src/p25/lc/tsbk/OSP_ADJ_STS_BCAST.h @@ -49,7 +49,7 @@ namespace p25 virtual bool decode(const uint8_t* data, bool rawTSBK = false); /// Encode a trunking signalling block. virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false); - + public: /** Adjacent Site Data */ /// Adjacent site CFVA flags. diff --git a/src/p25/lc/tsbk/OSP_AUTH_FNE_RESP.h b/src/p25/lc/tsbk/OSP_AUTH_FNE_RESP.h index b6683ef5..8753edae 100644 --- a/src/p25/lc/tsbk/OSP_AUTH_FNE_RESP.h +++ b/src/p25/lc/tsbk/OSP_AUTH_FNE_RESP.h @@ -51,7 +51,7 @@ namespace p25 virtual bool decode(const uint8_t* data, bool rawTSBK = false); /// Encode a trunking signalling block. virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false); - + /** Authentication data */ /// Sets the authentication result. void setAuthRes(const uint8_t* res); diff --git a/src/p25/lc/tsbk/OSP_DENY_RSP.cpp b/src/p25/lc/tsbk/OSP_DENY_RSP.cpp index 2822d51a..7b280500 100644 --- a/src/p25/lc/tsbk/OSP_DENY_RSP.cpp +++ b/src/p25/lc/tsbk/OSP_DENY_RSP.cpp @@ -65,7 +65,7 @@ bool OSP_DENY_RSP::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_aivFlag = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Additional Info. Flag m_service = (uint8_t)((tsbkValue >> 56) & 0x3FU); // Service Type m_response = (uint8_t)((tsbkValue >> 48) & 0xFFU); // Reason diff --git a/src/p25/lc/tsbk/OSP_DVM_GIT_HASH.cpp b/src/p25/lc/tsbk/OSP_DVM_GIT_HASH.cpp index 5d84b3b3..2fbad9bb 100644 --- a/src/p25/lc/tsbk/OSP_DVM_GIT_HASH.cpp +++ b/src/p25/lc/tsbk/OSP_DVM_GIT_HASH.cpp @@ -60,7 +60,7 @@ bool OSP_DVM_GIT_HASH::decode(const uint8_t* data, bool rawTSBK) assert(data != NULL); /* stub */ - + return true; } diff --git a/src/p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.cpp b/src/p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.cpp index accf1c0f..b29b71c4 100644 --- a/src/p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.cpp +++ b/src/p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.cpp @@ -66,11 +66,11 @@ bool OSP_DVM_LC_CALL_TERM::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_grpVchId = ((tsbkValue >> 52) & 0x0FU); // Channel ID m_grpVchNo = ((tsbkValue >> 40) & 0xFFFU); // Channel Number m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFU); // Target Radio Address - m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address + m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address return true; } diff --git a/src/p25/lc/tsbk/OSP_MOT_CC_BSI.cpp b/src/p25/lc/tsbk/OSP_MOT_CC_BSI.cpp index 9b17adf1..a1223a06 100644 --- a/src/p25/lc/tsbk/OSP_MOT_CC_BSI.cpp +++ b/src/p25/lc/tsbk/OSP_MOT_CC_BSI.cpp @@ -59,7 +59,7 @@ bool OSP_MOT_CC_BSI::decode(const uint8_t* data, bool rawTSBK) assert(data != NULL); /* stub */ - + return true; } diff --git a/src/p25/lc/tsbk/OSP_MOT_GRG_ADD.cpp b/src/p25/lc/tsbk/OSP_MOT_GRG_ADD.cpp index 4f5782c5..12d1ee14 100644 --- a/src/p25/lc/tsbk/OSP_MOT_GRG_ADD.cpp +++ b/src/p25/lc/tsbk/OSP_MOT_GRG_ADD.cpp @@ -58,7 +58,7 @@ bool OSP_MOT_GRG_ADD::decode(const uint8_t* data, bool rawTSBK) assert(data != NULL); /* stub */ - + return true; } diff --git a/src/p25/lc/tsbk/OSP_MOT_GRG_DEL.cpp b/src/p25/lc/tsbk/OSP_MOT_GRG_DEL.cpp index 818f6ddd..48399144 100644 --- a/src/p25/lc/tsbk/OSP_MOT_GRG_DEL.cpp +++ b/src/p25/lc/tsbk/OSP_MOT_GRG_DEL.cpp @@ -58,7 +58,7 @@ bool OSP_MOT_GRG_DEL::decode(const uint8_t* data, bool rawTSBK) assert(data != NULL); /* stub */ - + return true; } diff --git a/src/p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.cpp b/src/p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.cpp index 806def87..9282a67f 100644 --- a/src/p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.cpp +++ b/src/p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.cpp @@ -58,7 +58,7 @@ bool OSP_MOT_GRG_VCH_GRANT::decode(const uint8_t* data, bool rawTSBK) assert(data != NULL); /* stub */ - + return true; } diff --git a/src/p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.cpp b/src/p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.cpp index 35ffeebd..e409d4ab 100644 --- a/src/p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.cpp +++ b/src/p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.cpp @@ -58,7 +58,7 @@ bool OSP_MOT_GRG_VCH_UPD::decode(const uint8_t* data, bool rawTSBK) assert(data != NULL); /* stub */ - + return true; } diff --git a/src/p25/lc/tsbk/OSP_MOT_PSH_CCH.cpp b/src/p25/lc/tsbk/OSP_MOT_PSH_CCH.cpp index a763e344..6313a384 100644 --- a/src/p25/lc/tsbk/OSP_MOT_PSH_CCH.cpp +++ b/src/p25/lc/tsbk/OSP_MOT_PSH_CCH.cpp @@ -59,7 +59,7 @@ bool OSP_MOT_PSH_CCH::decode(const uint8_t* data, bool rawTSBK) assert(data != NULL); /* stub */ - + return true; } diff --git a/src/p25/lc/tsbk/OSP_NET_STS_BCAST.cpp b/src/p25/lc/tsbk/OSP_NET_STS_BCAST.cpp index f75aeae4..d5e39c9e 100644 --- a/src/p25/lc/tsbk/OSP_NET_STS_BCAST.cpp +++ b/src/p25/lc/tsbk/OSP_NET_STS_BCAST.cpp @@ -58,7 +58,7 @@ bool OSP_NET_STS_BCAST::decode(const uint8_t* data, bool rawTSBK) assert(data != NULL); /* stub */ - + return true; } diff --git a/src/p25/lc/tsbk/OSP_QUE_RSP.cpp b/src/p25/lc/tsbk/OSP_QUE_RSP.cpp index 57ea4d18..573de838 100644 --- a/src/p25/lc/tsbk/OSP_QUE_RSP.cpp +++ b/src/p25/lc/tsbk/OSP_QUE_RSP.cpp @@ -65,7 +65,7 @@ bool OSP_QUE_RSP::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_aivFlag = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Additional Info. Flag m_service = (uint8_t)((tsbkValue >> 56) & 0x3FU); // Service Type m_response = (uint8_t)((tsbkValue >> 48) & 0xFFU); // Reason diff --git a/src/p25/lc/tsbk/OSP_RFSS_STS_BCAST.cpp b/src/p25/lc/tsbk/OSP_RFSS_STS_BCAST.cpp index ef65eedd..ee589903 100644 --- a/src/p25/lc/tsbk/OSP_RFSS_STS_BCAST.cpp +++ b/src/p25/lc/tsbk/OSP_RFSS_STS_BCAST.cpp @@ -58,7 +58,7 @@ bool OSP_RFSS_STS_BCAST::decode(const uint8_t* data, bool rawTSBK) assert(data != NULL); /* stub */ - + return true; } diff --git a/src/p25/lc/tsbk/OSP_SNDCP_CH_GNT.h b/src/p25/lc/tsbk/OSP_SNDCP_CH_GNT.h index 0f86a0b8..6a102e96 100644 --- a/src/p25/lc/tsbk/OSP_SNDCP_CH_GNT.h +++ b/src/p25/lc/tsbk/OSP_SNDCP_CH_GNT.h @@ -54,7 +54,7 @@ namespace p25 /// SNDCP Data Service Options __PROPERTY(uint8_t, dataServiceOptions, DataServiceOptions); /// SNDCP grant channel number. - __PROPERTY(uint32_t, dataChannelNo, DataChnNo); + __PROPERTY(uint32_t, dataChannelNo, DataChnNo); __COPY(OSP_SNDCP_CH_GNT); }; diff --git a/src/p25/lc/tsbk/OSP_SYNC_BCAST.cpp b/src/p25/lc/tsbk/OSP_SYNC_BCAST.cpp index 10335478..5f823a80 100644 --- a/src/p25/lc/tsbk/OSP_SYNC_BCAST.cpp +++ b/src/p25/lc/tsbk/OSP_SYNC_BCAST.cpp @@ -61,7 +61,7 @@ bool OSP_SYNC_BCAST::decode(const uint8_t* data, bool rawTSBK) assert(data != NULL); /* stub */ - + return true; } @@ -117,7 +117,7 @@ void OSP_SYNC_BCAST::encode(uint8_t* data, bool rawTSBK, bool noTrellis) tsbkValue = (tsbkValue << 7) + (tmY & 0x7FU); // Number of Years Past 2000 tsbkValue = (tsbkValue << 4) + (tmM & 0x0FU); // Month tsbkValue = (tsbkValue << 5) + (local_tm.tm_mday & 0x1FU); // Day of Month - + // Time tsbkValue = (tsbkValue << 5) + (local_tm.tm_hour & 0x1FU); // Hour tsbkValue = (tsbkValue << 6) + (local_tm.tm_min & 0x3FU); // Minute diff --git a/src/p25/lc/tsbk/OSP_SYS_SRV_BCAST.cpp b/src/p25/lc/tsbk/OSP_SYS_SRV_BCAST.cpp index e6ef4326..c6c8158e 100644 --- a/src/p25/lc/tsbk/OSP_SYS_SRV_BCAST.cpp +++ b/src/p25/lc/tsbk/OSP_SYS_SRV_BCAST.cpp @@ -58,7 +58,7 @@ bool OSP_SYS_SRV_BCAST::decode(const uint8_t* data, bool rawTSBK) assert(data != NULL); /* stub */ - + return true; } diff --git a/src/p25/lc/tsbk/OSP_TIME_DATE_ANN.cpp b/src/p25/lc/tsbk/OSP_TIME_DATE_ANN.cpp index 88856032..992c4e06 100644 --- a/src/p25/lc/tsbk/OSP_TIME_DATE_ANN.cpp +++ b/src/p25/lc/tsbk/OSP_TIME_DATE_ANN.cpp @@ -61,7 +61,7 @@ bool OSP_TIME_DATE_ANN::decode(const uint8_t* data, bool rawTSBK) assert(data != NULL); /* stub */ - + return true; } @@ -90,7 +90,7 @@ void OSP_TIME_DATE_ANN::encode(uint8_t* data, bool rawTSBK, bool noTrellis) tmS |= 59U; } else { tmS |= i; - } + } #if DEBUG_P25_TSBK LogDebug(LOG_P25, "TSBK_OSP_TIME_DATE_ANN, tmM = %u / %u, tmY = %u / %u", local_tm.tm_mon, tmM, local_tm.tm_year, tmY); diff --git a/src/p25/lc/tsbk/OSP_TSBK_RAW.h b/src/p25/lc/tsbk/OSP_TSBK_RAW.h index f84a0824..1432d66d 100644 --- a/src/p25/lc/tsbk/OSP_TSBK_RAW.h +++ b/src/p25/lc/tsbk/OSP_TSBK_RAW.h @@ -54,7 +54,7 @@ namespace p25 /// Sets the TSBK to encode. void setTSBK(const uint8_t* tsbk); - + private: uint8_t* m_tsbk; }; diff --git a/src/p25/lc/tsbk/OSP_U_DEREG_ACK.cpp b/src/p25/lc/tsbk/OSP_U_DEREG_ACK.cpp index 7fa61c1c..e1833735 100644 --- a/src/p25/lc/tsbk/OSP_U_DEREG_ACK.cpp +++ b/src/p25/lc/tsbk/OSP_U_DEREG_ACK.cpp @@ -65,7 +65,7 @@ bool OSP_U_DEREG_ACK::decode(const uint8_t* data, bool rawTSBK) return false; ulong64_t tsbkValue = TSBK::toValue(tsbk); - + m_netId = (uint32_t)((tsbkValue >> 36) & 0xFFFFFU); // Network ID m_sysId = (uint32_t)((tsbkValue >> 24) & 0xFFFU); // System ID m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address diff --git a/src/p25/lc/tsbk/TSBKFactory.cpp b/src/p25/lc/tsbk/TSBKFactory.cpp index 5625d5f0..11e84118 100644 --- a/src/p25/lc/tsbk/TSBKFactory.cpp +++ b/src/p25/lc/tsbk/TSBKFactory.cpp @@ -238,7 +238,7 @@ std::unique_ptr TSBKFactory::createTSBK(const uint8_t* data, bool rawTSBK) break; } - return nullptr; + return nullptr; } /// @@ -323,9 +323,9 @@ std::unique_ptr TSBKFactory::createAMBT(const data::DataHeader dataHeader, default: LogError(LOG_P25, "TSBKFactory::createAMBT(), unknown TSBK LCO value, mfId = $%02X, lco = $%02X", mfId, lco); break; - } + } - return nullptr; + return nullptr; } // --------------------------------------------------------------------------- @@ -333,7 +333,7 @@ std::unique_ptr TSBKFactory::createAMBT(const data::DataHeader dataHeader, // --------------------------------------------------------------------------- /// -/// +/// /// /// /// @@ -352,7 +352,7 @@ std::unique_ptr TSBKFactory::decode(TSBK* tsbk, const uint8_t* data, bool } /// -/// +/// /// /// /// diff --git a/src/p25/lookups/P25AffiliationLookup.h b/src/p25/lookups/P25AffiliationLookup.h index 03fc9673..fccbe775 100644 --- a/src/p25/lookups/P25AffiliationLookup.h +++ b/src/p25/lookups/P25AffiliationLookup.h @@ -34,7 +34,7 @@ namespace p25 // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + class HOST_SW_API Control; namespace lookups diff --git a/src/p25/packet/Data.cpp b/src/p25/packet/Data.cpp index 28b3809d..84c893fa 100644 --- a/src/p25/packet/Data.cpp +++ b/src/p25/packet/Data.cpp @@ -106,7 +106,7 @@ bool Data::process(uint8_t* data, uint32_t len) m_rfPDUCount = 0U; m_rfPDUBits = 0U; - ::memset(m_rfPDU, 0x00U, P25_MAX_PDU_COUNT * P25_LDU_FRAME_LENGTH_BYTES + 2U); + ::memset(m_rfPDU, 0x00U, P25_MAX_PDU_COUNT * P25_LDU_FRAME_LENGTH_BYTES + 2U); m_p25->m_rfState = RS_RF_DATA; @@ -143,7 +143,7 @@ bool Data::process(uint8_t* data, uint32_t len) if (m_verbose) { LogMessage(LOG_RF, P25_PDU_STR ", ack = %u, outbound = %u, fmt = $%02X, mfId = $%02X, sap = $%02X, fullMessage = %u, blocksToFollow = %u, padCount = %u, n = %u, seqNo = %u, lastFragment = %u, hdrOffset = %u", - m_rfDataHeader.getAckNeeded(), m_rfDataHeader.getOutbound(), m_rfDataHeader.getFormat(), m_rfDataHeader.getMFId(), m_rfDataHeader.getSAP(), m_rfDataHeader.getFullMessage(), + m_rfDataHeader.getAckNeeded(), m_rfDataHeader.getOutbound(), m_rfDataHeader.getFormat(), m_rfDataHeader.getMFId(), m_rfDataHeader.getSAP(), m_rfDataHeader.getFullMessage(), m_rfDataHeader.getBlocksToFollow(), m_rfDataHeader.getPadCount(), m_rfDataHeader.getNs(), m_rfDataHeader.getFSN(), m_rfDataHeader.getLastFragment(), m_rfDataHeader.getHeaderOffset()); } @@ -329,7 +329,7 @@ bool Data::process(uint8_t* data, uint32_t len) case PDU_SAP_TRUNK_CTRL: { if (m_verbose) { - LogMessage(LOG_RF, P25_PDU_STR ", PDU_SAP_TRUNK_CTRL (Alternate MBT Packet), lco = $%02X, blocksToFollow = %u", + LogMessage(LOG_RF, P25_PDU_STR ", PDU_SAP_TRUNK_CTRL (Alternate MBT Packet), lco = $%02X, blocksToFollow = %u", m_rfDataHeader.getAMBTOpcode(), m_rfDataHeader.getBlocksToFollow()); } @@ -758,7 +758,7 @@ void Data::writeNet_PDU_Buffered() m_netSecondHeader.encode(block); Utils::setBitRange(block, data, offset, P25_PDU_FEC_LENGTH_BITS); - + offset += P25_PDU_FEC_LENGTH_BITS; blocksToFollow--; } @@ -808,7 +808,7 @@ void Data::writeRF_PDU_Buffered() m_rfSecondHeader.encode(block); Utils::setBitRange(block, data, offset, P25_PDU_FEC_LENGTH_BITS); - + offset += P25_PDU_FEC_LENGTH_BITS; blocksToFollow--; } diff --git a/src/p25/packet/Data.h b/src/p25/packet/Data.h index 6b877316..38a9a625 100644 --- a/src/p25/packet/Data.h +++ b/src/p25/packet/Data.h @@ -49,7 +49,7 @@ namespace p25 // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + class HOST_SW_API Control; namespace packet { class HOST_SW_API Trunk; } diff --git a/src/p25/packet/Trunk.cpp b/src/p25/packet/Trunk.cpp index 0fd62144..4f541229 100644 --- a/src/p25/packet/Trunk.cpp +++ b/src/p25/packet/Trunk.cpp @@ -2069,7 +2069,7 @@ void Trunk::queueRF_TSBK_Ctrl(uint8_t lco) if (m_debug) { LogMessage(LOG_RF , P25_TSDU_STR ", TSBK_OSP_SYNC_BCAST (Synchronization Broadcast)"); } - + // transmit sync broadcast std::unique_ptr osp = new_unique(OSP_SYNC_BCAST); osp->setMicroslotCount(m_microslotCount); @@ -2082,7 +2082,7 @@ void Trunk::queueRF_TSBK_Ctrl(uint8_t lco) if (m_debug) { LogMessage(LOG_RF , P25_TSDU_STR ", TSBK_OSP_TIME_DATE_ANN (Time and Date Announcement)"); } - + // transmit time/date announcement std::unique_ptr osp = new_unique(OSP_TIME_DATE_ANN); tsbk = std::move(osp); diff --git a/src/p25/packet/Voice.cpp b/src/p25/packet/Voice.cpp index f4f7fdfd..5c738e65 100644 --- a/src/p25/packet/Voice.cpp +++ b/src/p25/packet/Voice.cpp @@ -181,7 +181,7 @@ bool Voice::process(uint8_t* data, uint32_t len) LogWarning(LOG_RF, "Traffic collision detect, preempting existing network traffic to new RF traffic, rfDstId = %u, netDstId = %u", lc.getDstId(), m_p25->m_netLastDstId); resetNet(); - + if (m_p25->m_duplex) { m_p25->writeRF_TDU(true); } @@ -200,7 +200,7 @@ bool Voice::process(uint8_t* data, uint32_t len) return true; } else if (duid == P25_DUID_LDU1) { - + // prevent two LDUs of the same type from being sent consecutively if (m_lastDUID == P25_DUID_LDU1) { return false; @@ -368,7 +368,7 @@ bool Voice::process(uint8_t* data, uint32_t len) return false; } } - } + } if (!m_p25->m_trunk->writeRF_TSDU_Grant(srcId, dstId, serviceOptions, group)) { return false; @@ -573,7 +573,7 @@ bool Voice::process(uint8_t* data, uint32_t len) } } else if (duid == P25_DUID_LDU2) { - + // prevent two LDUs of the same type from being sent consecutively if (m_lastDUID == P25_DUID_LDU2) { return false; @@ -672,7 +672,7 @@ bool Voice::process(uint8_t* data, uint32_t len) } if (m_verbose) { - LogMessage(LOG_RF, P25_LDU2_STR ", audio, algo = $%02X, kid = $%04X, errs = %u/1233 (%.1f%%)", + LogMessage(LOG_RF, P25_LDU2_STR ", audio, algo = $%02X, kid = $%04X, errs = %u/1233 (%.1f%%)", m_rfLC.getAlgId(), m_rfLC.getKId(), errors, float(errors) / 12.33F); } @@ -703,16 +703,16 @@ bool Voice::process(uint8_t* data, uint32_t len) if (m_p25->m_rfState == RS_RF_AUDIO) { if (m_p25->m_rssi != 0U) { - ::ActivityLog("P25", true, "RF end of transmission, %.1f seconds, BER: %.1f%%, RSSI : -%u / -%u / -%u dBm", - float(m_rfFrames) / 5.56F, float(m_rfErrs * 100U) / float(m_rfBits), m_p25->m_minRSSI, m_p25->m_maxRSSI, + ::ActivityLog("P25", true, "RF end of transmission, %.1f seconds, BER: %.1f%%, RSSI : -%u / -%u / -%u dBm", + float(m_rfFrames) / 5.56F, float(m_rfErrs * 100U) / float(m_rfBits), m_p25->m_minRSSI, m_p25->m_maxRSSI, m_p25->m_aveRSSI / m_p25->m_rssiCount); } else { - ::ActivityLog("P25", true, "RF end of transmission, %.1f seconds, BER: %.1f%%", + ::ActivityLog("P25", true, "RF end of transmission, %.1f seconds, BER: %.1f%%", float(m_rfFrames) / 5.56F, float(m_rfErrs * 100U) / float(m_rfBits)); } - LogMessage(LOG_RF, P25_TDU_STR ", total frames: %d, bits: %d, undecodable LC: %d, errors: %d, BER: %.4f%%", + LogMessage(LOG_RF, P25_TDU_STR ", total frames: %d, bits: %d, undecodable LC: %d, errors: %d, BER: %.4f%%", m_rfFrames, m_rfBits, m_rfUndecodableLC, m_rfErrs, float(m_rfErrs * 100U) / float(m_rfBits)); if (m_p25->m_dedicatedControl) { @@ -804,10 +804,10 @@ bool Voice::processNetwork(uint8_t* data, uint32_t len, lc::LC& control, data::L lc::LC control = lc::LC(*m_dfsiLC.control()); m_p25->m_affiliations.touchGrant(control.getDstId()); } - + if (m_p25->m_dedicatedControl && !m_p25->m_voiceOnControl) { return true; - } + } if (m_p25->m_netState == RS_NET_IDLE) { // are we interrupting a running CC? @@ -863,22 +863,22 @@ bool Voice::processNetwork(uint8_t* data, uint32_t len, lc::LC& control, data::L m_dfsiLC.setFrameType(dfsi::P25_DFSI_LDU2_VOICE18); m_dfsiLC.decodeLDU2(data + count, m_netLDU2 + 204U); count += 16U; - + if (m_p25->m_control) { lc::LC control = lc::LC(*m_dfsiLC.control()); m_p25->m_affiliations.touchGrant(control.getDstId()); } - + if (m_p25->m_dedicatedControl && !m_p25->m_voiceOnControl) { return true; - } + } if (m_p25->m_netState == RS_NET_IDLE) { if (!m_p25->m_voiceOnControl) { m_p25->m_modem->clearP25Data(); } m_p25->m_queue.clear(); - + resetRF(); resetNet(); @@ -1072,7 +1072,7 @@ void Voice::writeNet_TDU() } if (m_netFrames > 0) { - ::ActivityLog("P25", false, "network end of transmission, %.1f seconds, %u%% packet loss", + ::ActivityLog("P25", false, "network end of transmission, %.1f seconds, %u%% packet loss", float(m_netFrames) / 50.0F, (m_netLost * 100U) / m_netFrames); } else { @@ -1428,9 +1428,9 @@ void Voice::writeNet_LDU2() { lc::LC control = lc::LC(*m_dfsiLC.control()); data::LowSpeedData lsd = data::LowSpeedData(*m_dfsiLC.lsd()); - + uint32_t dstId = control.getDstId(); - + // don't process network frames if this modem isn't authoritative if (!m_p25->m_authoritative && m_p25->m_permittedDstId != dstId) { LogWarning(LOG_NET, "[NON-AUTHORITATIVE] Ignoring network traffic (LDU2), destination not permitted!"); diff --git a/src/p25/packet/Voice.h b/src/p25/packet/Voice.h index fee84788..d32c0469 100644 --- a/src/p25/packet/Voice.h +++ b/src/p25/packet/Voice.h @@ -47,7 +47,7 @@ namespace p25 // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- - + namespace packet { class HOST_SW_API Trunk; } class HOST_SW_API Control; diff --git a/src/remote/RESTClient.cpp b/src/remote/RESTClient.cpp index 7bf282ae..4b6b9858 100644 --- a/src/remote/RESTClient.cpp +++ b/src/remote/RESTClient.cpp @@ -279,7 +279,7 @@ int RESTClient::send(const std::string& address, uint32_t port, const std::strin } return ERRNO_INTERNAL_ERROR; } - + return ret; } @@ -288,7 +288,7 @@ int RESTClient::send(const std::string& address, uint32_t port, const std::strin // --------------------------------------------------------------------------- /// -/// +/// /// /// /// @@ -299,12 +299,12 @@ void RESTClient::responseHandler(const HTTPPayload& request, HTTPPayload& reply) } /// -/// +/// /// bool RESTClient::wait() { m_responseAvailable = false; - + int timeout = 500; while (!m_responseAvailable && timeout > 0) { timeout--; diff --git a/src/remote/RESTClientMain.cpp b/src/remote/RESTClientMain.cpp index 0d68b174..6751cb5c 100644 --- a/src/remote/RESTClientMain.cpp +++ b/src/remote/RESTClientMain.cpp @@ -501,7 +501,7 @@ int main(int argc, char** argv) else if (rcom == RCD_DMR_DEBUG) { if (argCnt < 2U) { retCode = client->send(HTTP_GET, GET_DMR_DEBUG_BASE, json::object()); - } + } else { uint8_t debug = getArgUInt8(args, 0U); uint8_t verbose = getArgUInt8(args, 1U); @@ -511,12 +511,12 @@ int main(int argc, char** argv) else if (rcom == RCD_DMR_DUMP_CSBK) { if (argCnt < 1U) { retCode = client->send(HTTP_GET, GET_DMR_DUMP_CSBK_BASE, json::object()); - } + } else { uint8_t verbose = getArgUInt8(args, 0U); retCode = client->send(HTTP_GET, GET_DMR_DUMP_CSBK_BASE + std::to_string(verbose), json::object()); } - } + } else if (rcom == RCD_DMR_RID_PAGE && argCnt >= 2U) { json::object req = json::object(); req["command"].set(std::string(RID_CMD_PAGE)); @@ -574,7 +574,7 @@ int main(int argc, char** argv) else if (rcom == RCD_P25_DEBUG) { if (argCnt < 2U) { retCode = client->send(HTTP_GET, GET_P25_DEBUG_BASE, json::object()); - } + } else { uint8_t debug = getArgUInt8(args, 0U); uint8_t verbose = getArgUInt8(args, 1U); @@ -584,7 +584,7 @@ int main(int argc, char** argv) else if (rcom == RCD_P25_DUMP_TSBK) { if (argCnt < 1U) { retCode = client->send(HTTP_GET, GET_P25_DUMP_TSBK_BASE, json::object()); - } + } else { uint8_t verbose = getArgUInt8(args, 0U); retCode = client->send(HTTP_GET, GET_P25_DUMP_TSBK_BASE + std::to_string(verbose), json::object()); @@ -673,7 +673,7 @@ int main(int argc, char** argv) else if (rcom == RCD_NXDN_DEBUG) { if (argCnt < 2U) { retCode = client->send(HTTP_GET, GET_NXDN_DEBUG_BASE, json::object()); - } + } else { uint8_t debug = getArgUInt8(args, 0U); uint8_t verbose = getArgUInt8(args, 1U); @@ -683,12 +683,12 @@ int main(int argc, char** argv) else if (rcom == RCD_NXDN_DUMP_RCCH) { if (argCnt < 1U) { retCode = client->send(HTTP_GET, GET_NXDN_DUMP_RCCH_BASE, json::object()); - } + } else { uint8_t verbose = getArgUInt8(args, 0U); retCode = client->send(HTTP_GET, GET_NXDN_DUMP_RCCH_BASE + std::to_string(verbose), json::object()); } - } + } else if (rcom == RCD_NXDN_CC_DEDICATED) { retCode = client->send(HTTP_GET, GET_NXDN_CC_DEDICATED, json::object()); } diff --git a/src/yaml/Yaml.cpp b/src/yaml/Yaml.cpp index 59488560..ea51a4d0 100644 --- a/src/yaml/Yaml.cpp +++ b/src/yaml/Yaml.cpp @@ -169,7 +169,7 @@ namespace yaml // --------------------------------------------------------------------------- // Class Declaration - // + // // --------------------------------------------------------------------------- class TypeImp { @@ -223,7 +223,7 @@ namespace yaml // --------------------------------------------------------------------------- // Class Declaration - // + // // --------------------------------------------------------------------------- class SequenceImp : public TypeImp { @@ -360,7 +360,7 @@ namespace yaml // --------------------------------------------------------------------------- // Class Declaration - // + // // --------------------------------------------------------------------------- class MapImp : public TypeImp { @@ -460,7 +460,7 @@ namespace yaml // --------------------------------------------------------------------------- // Class Declaration - // + // // --------------------------------------------------------------------------- class ScalarImp : public TypeImp { @@ -548,7 +548,7 @@ namespace yaml // --------------------------------------------------------------------------- // Class Declaration - // + // // --------------------------------------------------------------------------- class NodeImp { @@ -621,7 +621,7 @@ namespace yaml // --------------------------------------------------------------------------- // Class Declaration - // + // // --------------------------------------------------------------------------- class IteratorImp { @@ -653,7 +653,7 @@ namespace yaml // --------------------------------------------------------------------------- // Class Declaration - // + // // --------------------------------------------------------------------------- class SequenceIteratorImp : public IteratorImp { @@ -701,7 +701,7 @@ namespace yaml // --------------------------------------------------------------------------- // Class Declaration - // + // // --------------------------------------------------------------------------- class MapIteratorImp : public IteratorImp { @@ -749,7 +749,7 @@ namespace yaml // --------------------------------------------------------------------------- // Class Declaration - // + // // --------------------------------------------------------------------------- class SequenceConstIteratorImp : public IteratorImp { @@ -797,7 +797,7 @@ namespace yaml // --------------------------------------------------------------------------- // Class Declaration - // + // // --------------------------------------------------------------------------- class MapConstIteratorImp : public IteratorImp { @@ -1139,7 +1139,7 @@ namespace yaml bool ConstIterator::operator == (const ConstIterator& it) { if (m_Type != it.m_Type) { - return false; + return false; } switch (m_Type) { @@ -1261,7 +1261,7 @@ namespace yaml } /// - /// Insert sequence item at given index. Converts node to sequence type if needed. + /// Insert sequence item at given index. Converts node to sequence type if needed. /// Adding new item to end of sequence if index is larger than sequence size. /// /// @@ -1480,7 +1480,7 @@ namespace yaml // Reader implementations // --------------------------------------------------------------------------- // Class Declaration - // + // // --------------------------------------------------------------------------- class ReaderLine { @@ -2544,7 +2544,7 @@ namespace yaml // --------------------------------------------------------------------------- // Global Functions // --------------------------------------------------------------------------- - + std::string ExceptionMessage(const std::string& message, ReaderLine& line) { return message + std::string(" Line ") + std::to_string(line.No) + std::string(": ") + line.Data; diff --git a/src/yaml/Yaml.h b/src/yaml/Yaml.h index 5f3a2849..1303b55b 100644 --- a/src/yaml/Yaml.h +++ b/src/yaml/Yaml.h @@ -200,7 +200,7 @@ namespace yaml // Class Declaration // Internal exception class. // --------------------------------------------------------------------------- - + class HOST_SW_API InternalException : public Exception { public: /// Initializes a new instance of the InternalException class. @@ -382,7 +382,7 @@ namespace yaml size_t size() const; // Sequence operators - /// Insert sequence item at given index. Converts node to sequence type if needed. + /// Insert sequence item at given index. Converts node to sequence type if needed. /// Adding new item to end of sequence if index is larger than sequence size. Node& insert(const size_t index); /// Add new sequence index to back. Converts node to sequence type if needed.