diff --git a/CMakeLists.txt b/CMakeLists.txt index 980957d1..91d4a33f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,7 +179,7 @@ execute_process(COMMAND git describe --abbrev=8 --always WORKING_DIRECTORY ${CMA add_definitions(-D__GIT_VER__="${GIT_VER}") add_definitions(-D__GIT_VER_HASH__="${GIT_VER_HASH}") -project(dvmcore) +project(dvm) include(src/CMakeLists.txt) if (ENABLE_TESTS) diff --git a/src/common/Defines.h b/src/common/Defines.h index e651dd46..0fc0c6b6 100644 --- a/src/common/Defines.h +++ b/src/common/Defines.h @@ -31,8 +31,7 @@ #if !defined(__COMMON_DEFINES_H__) #define __COMMON_DEFINES_H__ -#include - +#include #include #include #include diff --git a/src/common/Log.cpp b/src/common/Log.cpp index 61a1df16..318fae4c 100644 --- a/src/common/Log.cpp +++ b/src/common/Log.cpp @@ -70,7 +70,7 @@ bool g_disableTimeDisplay = false; static struct tm m_tm; -static std::ostream m_outStream{std::cerr.rdbuf()}; +static std::ostream m_outStream { std::cerr.rdbuf() }; static char LEVELS[] = " DMIWEF"; diff --git a/src/common/StopWatch.cpp b/src/common/StopWatch.cpp index f3488548..36af1df9 100644 --- a/src/common/StopWatch.cpp +++ b/src/common/StopWatch.cpp @@ -80,7 +80,7 @@ ulong64_t StopWatch::start() } /// -/// Gets the elpased time since the stopwatch started. +/// Gets the elapsed time since the stopwatch started. /// /// uint32_t StopWatch::elapsed() diff --git a/src/common/StopWatch.h b/src/common/StopWatch.h index 89f977a3..ccd37622 100644 --- a/src/common/StopWatch.h +++ b/src/common/StopWatch.h @@ -51,7 +51,7 @@ public: /// Starts the stopwatch. ulong64_t start(); - /// Gets the elpased time since the stopwatch started. + /// Gets the elapsed time since the stopwatch started. uint32_t elapsed(); private: diff --git a/src/common/Thread.cpp b/src/common/Thread.cpp index 8053a783..1bc059a6 100644 --- a/src/common/Thread.cpp +++ b/src/common/Thread.cpp @@ -30,7 +30,6 @@ */ #include "Thread.h" -#include #include #include @@ -51,10 +50,7 @@ Thread::Thread() : /// /// Finalizes a instance of the Thread class. /// -Thread::~Thread() -{ - /* stub */ -} +Thread::~Thread() = default; /// /// Starts the thread execution. diff --git a/src/common/ThreadFunc.h b/src/common/ThreadFunc.h index 5f181d47..63d30b97 100644 --- a/src/common/ThreadFunc.h +++ b/src/common/ThreadFunc.h @@ -50,7 +50,7 @@ public: } /// User-defined function to run for the thread main. - virtual void entry() + void entry() override { if (m_entry != nullptr) m_entry(); diff --git a/src/common/Timer.cpp b/src/common/Timer.cpp index 9de3f107..05fe907a 100644 --- a/src/common/Timer.cpp +++ b/src/common/Timer.cpp @@ -74,10 +74,7 @@ Timer::Timer(uint32_t ticksPerSec, uint32_t secs, uint32_t msecs) : /// /// Finalizes a instance of the Timer class. /// -Timer::~Timer() -{ - /* stub */ -} +Timer::~Timer() = default; /// /// Sets the timeout for the timer. diff --git a/src/common/Timer.h b/src/common/Timer.h index b088b966..198b808f 100644 --- a/src/common/Timer.h +++ b/src/common/Timer.h @@ -57,7 +57,7 @@ public: /// Gets the currently remaining time for the timer. /// Amount of time remaining before the timeout. - uint32_t getRemaining() + uint32_t getRemaining() const { if (m_timeout == 0U || m_timer == 0U) return 0U; @@ -70,14 +70,14 @@ public: /// Flag indicating whether the timer is running. /// True, if the timer is still running, otherwise false. - bool isRunning() + bool isRunning() const { return m_timer > 0U; } /// Flag indicating whether the timer is paused. /// True, if the timer is paused, otherwise false. - bool isPaused() + bool isPaused() const { return m_paused; } @@ -121,7 +121,7 @@ public: /// Flag indicating whether or not the timer has reached timeout and expired. /// True, if the timer is expired, otherwise false. - bool hasExpired() + bool hasExpired() const { if (m_timeout == 0U || m_timer == 0U) return false; diff --git a/src/common/Utils.h b/src/common/Utils.h index 9d58fed2..36def8a1 100644 --- a/src/common/Utils.h +++ b/src/common/Utils.h @@ -171,8 +171,6 @@ inline std::string strtoupper(const std::string value) { ((buffer[offset + 0U] << 8) & 0xFF00U) | \ ((buffer[offset + 1U] << 0) & 0x00FFU); -#define new_unique(type, ...) std::unique_ptr(new type(__VA_ARGS__)) - /// Unique uint8_t array. typedef std::unique_ptr UInt8Array; diff --git a/src/common/dmr/SlotType.cpp b/src/common/dmr/SlotType.cpp index 54ef03e3..723202fc 100644 --- a/src/common/dmr/SlotType.cpp +++ b/src/common/dmr/SlotType.cpp @@ -52,10 +52,7 @@ SlotType::SlotType() : /// /// Finalizes a instance of the SlotType class. /// -SlotType::~SlotType() -{ - /* stub */ -} +SlotType::~SlotType() = default; /// /// Decodes DMR slot type. diff --git a/src/common/dmr/acl/AccessControl.cpp b/src/common/dmr/acl/AccessControl.cpp index a4d2924c..19386a21 100644 --- a/src/common/dmr/acl/AccessControl.cpp +++ b/src/common/dmr/acl/AccessControl.cpp @@ -30,14 +30,9 @@ */ #include "Defines.h" #include "dmr/acl/AccessControl.h" -#include "Log.h" using namespace dmr::acl; -#include -#include -#include - // --------------------------------------------------------------------------- // Static Class Members // --------------------------------------------------------------------------- @@ -64,7 +59,7 @@ void AccessControl::init(RadioIdLookup* ridLookup, TalkgroupRulesLookup* tidLook bool AccessControl::validateSrcId(uint32_t id) { // check if RID ACLs are enabled - if (m_ridLookup->getACL() == false) { + if (!m_ridLookup->getACL()) { RadioId rid = m_ridLookup->find(id); if (!rid.radioDefault() && !rid.radioEnabled()) { return false; @@ -94,7 +89,7 @@ bool AccessControl::validateTGId(uint32_t slotNo, uint32_t id) return false; // check if TID ACLs are enabled - if (m_tidLookup->getACL() == false) { + if (!m_tidLookup->getACL()) { return true; } diff --git a/src/common/dmr/data/Data.cpp b/src/common/dmr/data/Data.cpp index 9220a9c9..855bb3f8 100644 --- a/src/common/dmr/data/Data.cpp +++ b/src/common/dmr/data/Data.cpp @@ -25,12 +25,10 @@ #include "Defines.h" #include "dmr/DMRDefines.h" #include "dmr/data/Data.h" -#include "Utils.h" using namespace dmr::data; using namespace dmr; -#include #include #include diff --git a/src/common/dmr/data/DataHeader.cpp b/src/common/dmr/data/DataHeader.cpp index 19f42a89..3177c32f 100644 --- a/src/common/dmr/data/DataHeader.cpp +++ b/src/common/dmr/data/DataHeader.cpp @@ -33,14 +33,12 @@ #include "dmr/DMRDefines.h" #include "dmr/data/DataHeader.h" #include "edac/BPTC19696.h" -#include "edac/RS129.h" #include "edac/CRC.h" #include "Utils.h" using namespace dmr::data; using namespace dmr; -#include #include #include diff --git a/src/common/dmr/data/EMB.cpp b/src/common/dmr/data/EMB.cpp index 4caafd71..64c2f942 100644 --- a/src/common/dmr/data/EMB.cpp +++ b/src/common/dmr/data/EMB.cpp @@ -55,10 +55,7 @@ EMB::EMB() : /// /// Finalizes a instance of the EMB class. /// -EMB::~EMB() -{ - /* stub */ -} +EMB::~EMB() = default; /// /// Decodes DMR embedded signalling data. diff --git a/src/common/dmr/data/EmbeddedData.cpp b/src/common/dmr/data/EmbeddedData.cpp index c6a7e525..dac5da82 100644 --- a/src/common/dmr/data/EmbeddedData.cpp +++ b/src/common/dmr/data/EmbeddedData.cpp @@ -37,9 +37,9 @@ using namespace dmr::data; using namespace dmr; -#include #include #include +#include // --------------------------------------------------------------------------- // Public Class Members @@ -85,49 +85,49 @@ bool EmbeddedData::addData(const uint8_t* data, uint8_t lcss) Utils::byteToBitsBE(data[17U], rawData + 24U); Utils::byteToBitsBE(data[18U], rawData + 32U); - // Is this the first block of a 4 block embedded LC ? + // is this the first block of a 4 block embedded LC ? if (lcss == 1U) { for (uint32_t a = 0U; a < 32U; a++) m_raw[a] = rawData[a + 4U]; - // Show we are ready for the next LC block + // show we are ready for the next LC block m_state = LCS_FIRST; m_valid = false; return false; } - // Is this the 2nd block of a 4 block embedded LC ? + // is this the 2nd block of a 4 block embedded LC ? if (lcss == 3U && m_state == LCS_FIRST) { for (uint32_t a = 0U; a < 32U; a++) m_raw[a + 32U] = rawData[a + 4U]; - // Show we are ready for the next LC block + // show we are ready for the next LC block m_state = LCS_SECOND; return false; } - // Is this the 3rd block of a 4 block embedded LC ? + // is this the 3rd block of a 4 block embedded LC ? if (lcss == 3U && m_state == LCS_SECOND) { for (uint32_t a = 0U; a < 32U; a++) m_raw[a + 64U] = rawData[a + 4U]; - // Show we are ready for the final LC block + // show we are ready for the final LC block m_state = LCS_THIRD; return false; } - // Is this the final block of a 4 block embedded LC ? + // is this the final block of a 4 block embedded LC ? if (lcss == 2U && m_state == LCS_THIRD) { for (uint32_t a = 0U; a < 32U; a++) m_raw[a + 96U] = rawData[a + 4U]; - // Show that we're not ready for any more data + // show that we're not ready for any more data m_state = LCS_NONE; - // Process the complete data block + // process the complete data block decodeEmbeddedData(); if (m_valid) encodeEmbeddedData(); @@ -188,7 +188,9 @@ uint8_t EmbeddedData::getData(uint8_t* data, uint8_t n) const } } -/// Sets link control data. +/// +/// Sets link control data. +/// /// void EmbeddedData::setLC(const lc::LC& lc) { @@ -200,7 +202,9 @@ void EmbeddedData::setLC(const lc::LC& lc) encodeEmbeddedData(); } -/// Gets link control data. +/// +/// Gets link control data. +/// /// std::unique_ptr EmbeddedData::getLC() const { @@ -210,7 +214,7 @@ std::unique_ptr EmbeddedData::getLC() const if (m_FLCO != FLCO_GROUP && m_FLCO != FLCO_PRIVATE) return nullptr; - return std::unique_ptr(new lc::LC(m_data)); + return std::make_unique(m_data); } /// @@ -256,7 +260,7 @@ void EmbeddedData::reset() /// void EmbeddedData::decodeEmbeddedData() { - // The data is unpacked downwards in columns + // the data is unpacked downwards in columns bool data[128U]; ::memset(data, 0x00U, 128U * sizeof(bool)); @@ -274,14 +278,14 @@ void EmbeddedData::decodeEmbeddedData() return; } - // Check the parity bits + // check the parity bits for (uint32_t a = 0U; a < 16U; a++) { bool parity = data[a + 0U] ^ data[a + 16U] ^ data[a + 32U] ^ data[a + 48U] ^ data[a + 64U] ^ data[a + 80U] ^ data[a + 96U] ^ data[a + 112U]; if (parity) return; } - // We have passed the Hamming check so extract the actual payload + // we have passed the Hamming check so extract the actual payload b = 0U; for (uint32_t a = 0U; a < 11U; a++, b++) m_data[b] = data[a]; @@ -298,7 +302,7 @@ void EmbeddedData::decodeEmbeddedData() for (uint32_t a = 96U; a < 106U; a++, b++) m_data[b] = data[a]; - // Extract the 5 bit CRC + // extract the 5 bit CRC uint32_t crc = 0U; if (data[42]) crc += 16U; if (data[58]) crc += 8U; @@ -306,13 +310,13 @@ void EmbeddedData::decodeEmbeddedData() if (data[90]) crc += 2U; if (data[106]) crc += 1U; - // Now CRC check this + // now CRC check this if (!edac::CRC::checkFiveBit(m_data, crc)) return; m_valid = true; - // Extract the FLCO + // extract the FLCO uint8_t flco; Utils::bitsToByteBE(m_data + 0U, flco); m_FLCO = flco & 0x3FU; @@ -355,11 +359,11 @@ void EmbeddedData::encodeEmbeddedData() for (uint32_t a = 0U; a < 112U; a += 16U) edac::Hamming::encode16114(data + a); - // Add the parity bits for each column + // add the parity bits for each column for (uint32_t a = 0U; a < 16U; a++) data[a + 112U] = data[a + 0U] ^ data[a + 16U] ^ data[a + 32U] ^ data[a + 48U] ^ data[a + 64U] ^ data[a + 80U] ^ data[a + 96U]; - // The data is packed downwards in columns + // the data is packed downwards in columns b = 0U; for (uint32_t a = 0U; a < 128U; a++) { m_raw[a] = data[b]; diff --git a/src/common/dmr/data/EmbeddedData.h b/src/common/dmr/data/EmbeddedData.h index fac92c83..c36f0805 100644 --- a/src/common/dmr/data/EmbeddedData.h +++ b/src/common/dmr/data/EmbeddedData.h @@ -70,7 +70,7 @@ namespace dmr /// Gets link control data. std::unique_ptr getLC() const; - /// Get raw embeded data buffer. + /// Get raw embedded data buffer. bool getRawData(uint8_t* data) const; /// Helper to reset data values to defaults. diff --git a/src/common/dmr/lc/CSBK.cpp b/src/common/dmr/lc/CSBK.cpp index ac7b9a42..932d93a1 100644 --- a/src/common/dmr/lc/CSBK.cpp +++ b/src/common/dmr/lc/CSBK.cpp @@ -38,7 +38,6 @@ using namespace dmr::lc; using namespace dmr; -#include #include // --------------------------------------------------------------------------- @@ -97,10 +96,7 @@ CSBK::CSBK() : /// /// Finalizes a instance of the CSBK class. /// -CSBK::~CSBK() -{ - /* stub */ -} +CSBK::~CSBK() = default; /// /// Returns a string that represents the current CSBK. diff --git a/src/common/dmr/lc/CSBK.h b/src/common/dmr/lc/CSBK.h index 47d9550c..73083a9e 100644 --- a/src/common/dmr/lc/CSBK.h +++ b/src/common/dmr/lc/CSBK.h @@ -63,7 +63,7 @@ namespace dmr virtual std::string toString(); /// Regenerate a DMR CSBK without decoding. - /// This is because the DMR archeticture allows fall-thru of unsupported CSBKs. + /// This is because the DMR architecture allows fall-thru of unsupported CSBKs. static bool regenerate(uint8_t* data, uint8_t dataType); /// Gets the flag indicating verbose log output. diff --git a/src/common/dmr/lc/FullLC.cpp b/src/common/dmr/lc/FullLC.cpp index 715af474..ef3c6ec1 100644 --- a/src/common/dmr/lc/FullLC.cpp +++ b/src/common/dmr/lc/FullLC.cpp @@ -35,13 +35,12 @@ #include "edac/RS129.h" #include "edac/CRC.h" #include "Log.h" -#include "Utils.h" using namespace dmr::lc; using namespace dmr; -#include #include +#include // --------------------------------------------------------------------------- // Public Class Members @@ -59,10 +58,7 @@ FullLC::FullLC() : /// /// Finalizes a instance of the FullLC class. /// -FullLC::~FullLC() -{ - /* stub */ -} +FullLC::~FullLC() = default; /// /// Decode DMR full-link control data. @@ -100,7 +96,7 @@ std::unique_ptr FullLC::decode(const uint8_t* data, uint8_t type) if (!edac::RS129::check(lcData)) return nullptr; - return std::unique_ptr(new LC(lcData)); + return std::make_unique(lcData); } /// @@ -170,7 +166,7 @@ std::unique_ptr FullLC::decodePI(const uint8_t* data) lcData[11U] ^= PI_HEADER_CRC_MASK[1U]; } - return std::unique_ptr(new PrivacyLC(lcData)); + return std::make_unique(lcData); } /// diff --git a/src/common/dmr/lc/LC.cpp b/src/common/dmr/lc/LC.cpp index 8bdfee2b..520e302e 100644 --- a/src/common/dmr/lc/LC.cpp +++ b/src/common/dmr/lc/LC.cpp @@ -36,7 +36,6 @@ using namespace dmr::lc; using namespace dmr; -#include #include // --------------------------------------------------------------------------- @@ -171,10 +170,7 @@ LC::LC() : /// /// Finalizes a instance of the LC class. /// -LC::~LC() -{ - /* stub */ -} +LC::~LC() = default; /// /// diff --git a/src/common/dmr/lc/ShortLC.cpp b/src/common/dmr/lc/ShortLC.cpp index b1eb2866..56d4e04c 100644 --- a/src/common/dmr/lc/ShortLC.cpp +++ b/src/common/dmr/lc/ShortLC.cpp @@ -74,18 +74,18 @@ bool ShortLC::decode(const uint8_t* in, uint8_t* out) assert(in != nullptr); assert(out != nullptr); - // Get the raw binary + // get the raw binary decodeExtractBinary(in); - // Deinterleave + // deinterleave decodeDeInterleave(); - // Error check + // error check bool ret = decodeErrorCheck(); if (!ret) return false; - // Extract Data + // extract Data decodeExtractData(out); return true; @@ -101,16 +101,16 @@ void ShortLC::encode(const uint8_t* in, uint8_t* out) assert(in != nullptr); assert(out != nullptr); - // Extract Data + // extract Data encodeExtractData(in); - // Error check + // error check encodeErrorCheck(); - // Deinterleave + // interleave encodeInterleave(); - // Get the raw binary + // get the raw binary encodeExtractBinary(out); } @@ -146,9 +146,9 @@ void ShortLC::decodeDeInterleave() m_deInterData[i] = false; for (uint32_t a = 0U; a < 67U; a++) { - // Calculate the interleave sequence + // calculate the interleave sequence uint32_t interleaveSequence = (a * 4U) % 67U; - // Shuffle the data + // shuffle the data m_deInterData[a] = m_rawData[interleaveSequence]; } @@ -161,12 +161,12 @@ void ShortLC::decodeDeInterleave() /// bool ShortLC::decodeErrorCheck() { - // Run through each of the 3 rows containing data + // run through each of the 3 rows containing data edac::Hamming::decode17123(m_deInterData + 0U); edac::Hamming::decode17123(m_deInterData + 17U); edac::Hamming::decode17123(m_deInterData + 34U); - // Run through each of the 17 columns + // run through each of the 17 columns for (uint32_t c = 0U; c < 17U; c++) { bool bit = m_deInterData[c + 0U] ^ m_deInterData[c + 17U] ^ m_deInterData[c + 34U]; if (bit != m_deInterData[c + 51U]) @@ -240,12 +240,12 @@ void ShortLC::encodeExtractData(const uint8_t* in) const /// void ShortLC::encodeErrorCheck() { - // Run through each of the 3 rows containing data + // run through each of the 3 rows containing data edac::Hamming::encode17123(m_deInterData + 0U); edac::Hamming::encode17123(m_deInterData + 17U); edac::Hamming::encode17123(m_deInterData + 34U); - // Run through each of the 17 columns + // run through each of the 17 columns for (uint32_t c = 0U; c < 17U; c++) m_deInterData[c + 51U] = m_deInterData[c + 0U] ^ m_deInterData[c + 17U] ^ m_deInterData[c + 34U]; } @@ -259,10 +259,10 @@ void ShortLC::encodeInterleave() m_rawData[i] = false; for (uint32_t a = 0U; a < 67U; a++) { - // Calculate the interleave sequence + // calculate the interleave sequence uint32_t interleaveSequence = (a * 4U) % 67U; - // Unshuffle the data + // unshuffle the data m_rawData[interleaveSequence] = m_deInterData[a]; } diff --git a/src/common/dmr/lc/csbk/CSBKFactory.cpp b/src/common/dmr/lc/csbk/CSBKFactory.cpp index 74d3a9d5..581e6951 100644 --- a/src/common/dmr/lc/csbk/CSBKFactory.cpp +++ b/src/common/dmr/lc/csbk/CSBKFactory.cpp @@ -43,18 +43,12 @@ using namespace dmr; /// /// Initializes a new instance of the CSBKFactory class. /// -CSBKFactory::CSBKFactory() -{ - /* stub */ -} +CSBKFactory::CSBKFactory() = default; /// /// Finalizes a instance of CSBKFactory class. /// -CSBKFactory::~CSBKFactory() -{ - /* stub */ -} +CSBKFactory::~CSBKFactory() = default; /// /// Create an instance of a CSBK. diff --git a/src/common/dmr/lc/csbk/CSBK_ACK_RSP.cpp b/src/common/dmr/lc/csbk/CSBK_ACK_RSP.cpp index a2f77faf..c061980d 100644 --- a/src/common/dmr/lc/csbk/CSBK_ACK_RSP.cpp +++ b/src/common/dmr/lc/csbk/CSBK_ACK_RSP.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_ACK_RSP.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ CSBK_ACK_RSP::CSBK_ACK_RSP() : CSBK() /// True, if CSBK was decoded, otherwise false. bool CSBK_ACK_RSP::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t csbk[DMR_CSBK_LENGTH_BYTES]; ::memset(csbk, 0x00U, DMR_CSBK_LENGTH_BYTES); @@ -79,7 +76,7 @@ bool CSBK_ACK_RSP::decode(const uint8_t* data) /// void CSBK_ACK_RSP::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/common/dmr/lc/csbk/CSBK_ACK_RSP.h b/src/common/dmr/lc/csbk/CSBK_ACK_RSP.h index 266c69db..74199560 100644 --- a/src/common/dmr/lc/csbk/CSBK_ACK_RSP.h +++ b/src/common/dmr/lc/csbk/CSBK_ACK_RSP.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; }; } // namespace csbk } // namespace lc diff --git a/src/common/dmr/lc/csbk/CSBK_ALOHA.cpp b/src/common/dmr/lc/csbk/CSBK_ALOHA.cpp index f4ceb425..13bb42f9 100644 --- a/src/common/dmr/lc/csbk/CSBK_ALOHA.cpp +++ b/src/common/dmr/lc/csbk/CSBK_ALOHA.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_ALOHA.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -58,7 +55,7 @@ CSBK_ALOHA::CSBK_ALOHA() : CSBK(), /// True, if CSBK was decoded, otherwise false. bool CSBK_ALOHA::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -71,7 +68,7 @@ bool CSBK_ALOHA::decode(const uint8_t* data) /// void CSBK_ALOHA::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/common/dmr/lc/csbk/CSBK_ALOHA.h b/src/common/dmr/lc/csbk/CSBK_ALOHA.h index 66e2d00a..33194206 100644 --- a/src/common/dmr/lc/csbk/CSBK_ALOHA.h +++ b/src/common/dmr/lc/csbk/CSBK_ALOHA.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; public: /// Aloha Site Time Slot Synchronization. diff --git a/src/common/dmr/lc/csbk/CSBK_BROADCAST.cpp b/src/common/dmr/lc/csbk/CSBK_BROADCAST.cpp index 684aa797..98c4786c 100644 --- a/src/common/dmr/lc/csbk/CSBK_BROADCAST.cpp +++ b/src/common/dmr/lc/csbk/CSBK_BROADCAST.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_BROADCAST.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -59,7 +56,7 @@ CSBK_BROADCAST::CSBK_BROADCAST() : CSBK(), /// True, if CSBK was decoded, otherwise false. bool CSBK_BROADCAST::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -72,7 +69,7 @@ bool CSBK_BROADCAST::decode(const uint8_t* data) /// void CSBK_BROADCAST::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; @@ -83,7 +80,7 @@ void CSBK_BROADCAST::encode(uint8_t* data) switch (m_anncType) { case BCAST_ANNC_ANN_WD_TSCC: - // Broadcast Parms 1 + // Broadcast Params 1 csbkValue = (csbkValue << 4) + 0U; // Reserved csbkValue = (csbkValue << 4) + (m_colorCode & 0x0FU); // Color Code 1 csbkValue = (csbkValue << 4) + (m_colorCode & 0x0FU); // Color Code 2 @@ -94,7 +91,7 @@ void CSBK_BROADCAST::encode(uint8_t* data) csbkValue = (csbkValue << 4) + (m_backoffNo & 0x0FU); // Backoff Number csbkValue = (csbkValue << 16) + m_siteData.systemIdentity(); // Site Identity - // Broadcast Parms 2 + // Broadcast Params 2 csbkValue = (csbkValue << 12) + (m_logicalCh1 & 0xFFFU); // Logical Channel 1 csbkValue = (csbkValue << 12) + (m_logicalCh2 & 0xFFFU); // Logical Channel 2 break; @@ -136,17 +133,17 @@ void CSBK_BROADCAST::encode(uint8_t* data) } break; case BCAST_ANNC_SITE_PARMS: - // Broadcast Parms 1 - csbkValue = (csbkValue << 14) + m_siteData.systemIdentity(true); // Site Identity (Broadcast Parms 1) + // Broadcast Params 1 + csbkValue = (csbkValue << 14) + m_siteData.systemIdentity(true); // Site Identity (Broadcast Params 1) csbkValue = (csbkValue << 1) + ((m_siteData.requireReg()) ? 1U : 0U); // Require Registration csbkValue = (csbkValue << 4) + (m_backoffNo & 0x0FU); // Backoff Number csbkValue = (csbkValue << 16) + m_siteData.systemIdentity(); // Site Identity - // Broadcast Parms 2 + // Broadcast Params 2 csbkValue = (csbkValue << 1) + 0U; // Roaming TG Subscription/Attach csbkValue = (csbkValue << 1) + ((m_hibernating) ? 1U : 0U); // TSCC Hibernating - csbkValue = (csbkValue << 22) + 0U; // Broadcast Parms 2 (Reserved) + csbkValue = (csbkValue << 22) + 0U; // Broadcast Params 2 (Reserved) break; } diff --git a/src/common/dmr/lc/csbk/CSBK_BROADCAST.h b/src/common/dmr/lc/csbk/CSBK_BROADCAST.h index 37a72b3a..836bbfa6 100644 --- a/src/common/dmr/lc/csbk/CSBK_BROADCAST.h +++ b/src/common/dmr/lc/csbk/CSBK_BROADCAST.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; public: /// Broadcast Announcment Type. diff --git a/src/common/dmr/lc/csbk/CSBK_BSDWNACT.cpp b/src/common/dmr/lc/csbk/CSBK_BSDWNACT.cpp index 64b0b7fb..0c959744 100644 --- a/src/common/dmr/lc/csbk/CSBK_BSDWNACT.cpp +++ b/src/common/dmr/lc/csbk/CSBK_BSDWNACT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_BSDWNACT.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ CSBK_BSDWNACT::CSBK_BSDWNACT() : CSBK(), /// True, if CSBK was decoded, otherwise false. bool CSBK_BSDWNACT::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t csbk[DMR_CSBK_LENGTH_BYTES]; ::memset(csbk, 0x00U, DMR_CSBK_LENGTH_BYTES); @@ -78,7 +75,7 @@ bool CSBK_BSDWNACT::decode(const uint8_t* data) /// void CSBK_BSDWNACT::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ } diff --git a/src/common/dmr/lc/csbk/CSBK_BSDWNACT.h b/src/common/dmr/lc/csbk/CSBK_BSDWNACT.h index 8ea8599f..bb671979 100644 --- a/src/common/dmr/lc/csbk/CSBK_BSDWNACT.h +++ b/src/common/dmr/lc/csbk/CSBK_BSDWNACT.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; public: /// Base Station ID. diff --git a/src/common/dmr/lc/csbk/CSBK_CALL_ALRT.cpp b/src/common/dmr/lc/csbk/CSBK_CALL_ALRT.cpp index 48ed389a..1e6fb25e 100644 --- a/src/common/dmr/lc/csbk/CSBK_CALL_ALRT.cpp +++ b/src/common/dmr/lc/csbk/CSBK_CALL_ALRT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_CALL_ALRT.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ CSBK_CALL_ALRT::CSBK_CALL_ALRT() : CSBK() /// True, if CSBK was decoded, otherwise false. bool CSBK_CALL_ALRT::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t csbk[DMR_CSBK_LENGTH_BYTES]; ::memset(csbk, 0x00U, DMR_CSBK_LENGTH_BYTES); @@ -79,7 +76,7 @@ bool CSBK_CALL_ALRT::decode(const uint8_t* data) /// void CSBK_CALL_ALRT::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/common/dmr/lc/csbk/CSBK_CALL_ALRT.h b/src/common/dmr/lc/csbk/CSBK_CALL_ALRT.h index 6872a54e..d71f7b1e 100644 --- a/src/common/dmr/lc/csbk/CSBK_CALL_ALRT.h +++ b/src/common/dmr/lc/csbk/CSBK_CALL_ALRT.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; }; } // namespace csbk } // namespace lc diff --git a/src/common/dmr/lc/csbk/CSBK_EXT_FNCT.cpp b/src/common/dmr/lc/csbk/CSBK_EXT_FNCT.cpp index 6119acf1..9e41fc82 100644 --- a/src/common/dmr/lc/csbk/CSBK_EXT_FNCT.cpp +++ b/src/common/dmr/lc/csbk/CSBK_EXT_FNCT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_EXT_FNCT.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -56,7 +53,7 @@ CSBK_EXT_FNCT::CSBK_EXT_FNCT() : CSBK(), /// True, if CSBK was decoded, otherwise false. bool CSBK_EXT_FNCT::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t csbk[DMR_CSBK_LENGTH_BYTES]; ::memset(csbk, 0x00U, DMR_CSBK_LENGTH_BYTES); @@ -81,7 +78,7 @@ bool CSBK_EXT_FNCT::decode(const uint8_t* data) /// void CSBK_EXT_FNCT::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/common/dmr/lc/csbk/CSBK_EXT_FNCT.h b/src/common/dmr/lc/csbk/CSBK_EXT_FNCT.h index 86e3f881..df94b964 100644 --- a/src/common/dmr/lc/csbk/CSBK_EXT_FNCT.h +++ b/src/common/dmr/lc/csbk/CSBK_EXT_FNCT.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; public: /// Extended function opcode. diff --git a/src/common/dmr/lc/csbk/CSBK_MAINT.cpp b/src/common/dmr/lc/csbk/CSBK_MAINT.cpp index 58b1be98..ea266295 100644 --- a/src/common/dmr/lc/csbk/CSBK_MAINT.cpp +++ b/src/common/dmr/lc/csbk/CSBK_MAINT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_MAINT.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ CSBK_MAINT::CSBK_MAINT() : CSBK(), /// True, if CSBK was decoded, otherwise false. bool CSBK_MAINT::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t csbk[DMR_CSBK_LENGTH_BYTES]; ::memset(csbk, 0x00U, DMR_CSBK_LENGTH_BYTES); @@ -79,7 +76,7 @@ bool CSBK_MAINT::decode(const uint8_t* data) /// void CSBK_MAINT::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/common/dmr/lc/csbk/CSBK_MAINT.h b/src/common/dmr/lc/csbk/CSBK_MAINT.h index 70633840..b4880917 100644 --- a/src/common/dmr/lc/csbk/CSBK_MAINT.h +++ b/src/common/dmr/lc/csbk/CSBK_MAINT.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; public: /// Maintainence Kind. diff --git a/src/common/dmr/lc/csbk/CSBK_NACK_RSP.cpp b/src/common/dmr/lc/csbk/CSBK_NACK_RSP.cpp index 398d4c13..5939702b 100644 --- a/src/common/dmr/lc/csbk/CSBK_NACK_RSP.cpp +++ b/src/common/dmr/lc/csbk/CSBK_NACK_RSP.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_NACK_RSP.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ CSBK_NACK_RSP::CSBK_NACK_RSP() : CSBK(), /// True, if CSBK was decoded, otherwise false. bool CSBK_NACK_RSP::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t csbk[DMR_CSBK_LENGTH_BYTES]; ::memset(csbk, 0x00U, DMR_CSBK_LENGTH_BYTES); @@ -81,7 +78,7 @@ bool CSBK_NACK_RSP::decode(const uint8_t* data) /// void CSBK_NACK_RSP::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/common/dmr/lc/csbk/CSBK_NACK_RSP.h b/src/common/dmr/lc/csbk/CSBK_NACK_RSP.h index 41c00b73..7fbba672 100644 --- a/src/common/dmr/lc/csbk/CSBK_NACK_RSP.h +++ b/src/common/dmr/lc/csbk/CSBK_NACK_RSP.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; public: /// Service Kind. diff --git a/src/common/dmr/lc/csbk/CSBK_PD_GRANT.cpp b/src/common/dmr/lc/csbk/CSBK_PD_GRANT.cpp index 2d1fc41f..fb81e393 100644 --- a/src/common/dmr/lc/csbk/CSBK_PD_GRANT.cpp +++ b/src/common/dmr/lc/csbk/CSBK_PD_GRANT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_PD_GRANT.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ CSBK_PD_GRANT::CSBK_PD_GRANT() : CSBK() /// True, if CSBK was decoded, otherwise false. bool CSBK_PD_GRANT::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -67,7 +64,7 @@ bool CSBK_PD_GRANT::decode(const uint8_t* data) /// void CSBK_PD_GRANT::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/common/dmr/lc/csbk/CSBK_PD_GRANT.h b/src/common/dmr/lc/csbk/CSBK_PD_GRANT.h index cc727386..1405a3ee 100644 --- a/src/common/dmr/lc/csbk/CSBK_PD_GRANT.h +++ b/src/common/dmr/lc/csbk/CSBK_PD_GRANT.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; }; } // namespace csbk } // namespace lc diff --git a/src/common/dmr/lc/csbk/CSBK_PRECCSBK.cpp b/src/common/dmr/lc/csbk/CSBK_PRECCSBK.cpp index 44f82acc..f2170f72 100644 --- a/src/common/dmr/lc/csbk/CSBK_PRECCSBK.cpp +++ b/src/common/dmr/lc/csbk/CSBK_PRECCSBK.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_PRECCSBK.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ CSBK_PRECCSBK::CSBK_PRECCSBK() : CSBK() /// True, if CSBK was decoded, otherwise false. bool CSBK_PRECCSBK::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t csbk[DMR_CSBK_LENGTH_BYTES]; ::memset(csbk, 0x00U, DMR_CSBK_LENGTH_BYTES); @@ -80,7 +77,7 @@ bool CSBK_PRECCSBK::decode(const uint8_t* data) /// void CSBK_PRECCSBK::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ } diff --git a/src/common/dmr/lc/csbk/CSBK_PRECCSBK.h b/src/common/dmr/lc/csbk/CSBK_PRECCSBK.h index 92e85aa5..7d71be75 100644 --- a/src/common/dmr/lc/csbk/CSBK_PRECCSBK.h +++ b/src/common/dmr/lc/csbk/CSBK_PRECCSBK.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; }; } // namespace csbk } // namespace lc diff --git a/src/common/dmr/lc/csbk/CSBK_PV_GRANT.cpp b/src/common/dmr/lc/csbk/CSBK_PV_GRANT.cpp index 1ddf8698..98e8273d 100644 --- a/src/common/dmr/lc/csbk/CSBK_PV_GRANT.cpp +++ b/src/common/dmr/lc/csbk/CSBK_PV_GRANT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_PV_GRANT.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ CSBK_PV_GRANT::CSBK_PV_GRANT() : CSBK() /// True, if CSBK was decoded, otherwise false. bool CSBK_PV_GRANT::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -67,7 +64,7 @@ bool CSBK_PV_GRANT::decode(const uint8_t* data) /// void CSBK_PV_GRANT::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/common/dmr/lc/csbk/CSBK_PV_GRANT.h b/src/common/dmr/lc/csbk/CSBK_PV_GRANT.h index b8f75094..f333d077 100644 --- a/src/common/dmr/lc/csbk/CSBK_PV_GRANT.h +++ b/src/common/dmr/lc/csbk/CSBK_PV_GRANT.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; }; } // namespace csbk } // namespace lc diff --git a/src/common/dmr/lc/csbk/CSBK_P_CLEAR.cpp b/src/common/dmr/lc/csbk/CSBK_P_CLEAR.cpp index bd055629..5146ef8d 100644 --- a/src/common/dmr/lc/csbk/CSBK_P_CLEAR.cpp +++ b/src/common/dmr/lc/csbk/CSBK_P_CLEAR.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_P_CLEAR.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ CSBK_P_CLEAR::CSBK_P_CLEAR() : CSBK() /// True, if CSBK was decoded, otherwise false. bool CSBK_P_CLEAR::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -67,7 +64,7 @@ bool CSBK_P_CLEAR::decode(const uint8_t* data) /// void CSBK_P_CLEAR::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/common/dmr/lc/csbk/CSBK_P_CLEAR.h b/src/common/dmr/lc/csbk/CSBK_P_CLEAR.h index a57fc081..bcd10e02 100644 --- a/src/common/dmr/lc/csbk/CSBK_P_CLEAR.h +++ b/src/common/dmr/lc/csbk/CSBK_P_CLEAR.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; }; } // namespace csbk } // namespace lc diff --git a/src/common/dmr/lc/csbk/CSBK_P_GRANT.cpp b/src/common/dmr/lc/csbk/CSBK_P_GRANT.cpp index 83c304df..0ba5fc19 100644 --- a/src/common/dmr/lc/csbk/CSBK_P_GRANT.cpp +++ b/src/common/dmr/lc/csbk/CSBK_P_GRANT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_P_GRANT.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ CSBK_P_GRANT::CSBK_P_GRANT() : CSBK() /// True, if CSBK was decoded, otherwise false. bool CSBK_P_GRANT::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -67,7 +64,7 @@ bool CSBK_P_GRANT::decode(const uint8_t* data) /// void CSBK_P_GRANT::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/common/dmr/lc/csbk/CSBK_P_GRANT.h b/src/common/dmr/lc/csbk/CSBK_P_GRANT.h index aa8bfb0b..c11617d6 100644 --- a/src/common/dmr/lc/csbk/CSBK_P_GRANT.h +++ b/src/common/dmr/lc/csbk/CSBK_P_GRANT.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; }; } // namespace csbk } // namespace lc diff --git a/src/common/dmr/lc/csbk/CSBK_RAND.cpp b/src/common/dmr/lc/csbk/CSBK_RAND.cpp index 4e1034e0..f7ff3bb5 100644 --- a/src/common/dmr/lc/csbk/CSBK_RAND.cpp +++ b/src/common/dmr/lc/csbk/CSBK_RAND.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_RAND.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -57,7 +54,7 @@ CSBK_RAND::CSBK_RAND() : CSBK(), /// True, if CSBK was decoded, otherwise false. bool CSBK_RAND::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t csbk[DMR_CSBK_LENGTH_BYTES]; ::memset(csbk, 0x00U, DMR_CSBK_LENGTH_BYTES); @@ -84,7 +81,7 @@ bool CSBK_RAND::decode(const uint8_t* data) /// void CSBK_RAND::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/common/dmr/lc/csbk/CSBK_RAND.h b/src/common/dmr/lc/csbk/CSBK_RAND.h index b28b7684..d12f41ba 100644 --- a/src/common/dmr/lc/csbk/CSBK_RAND.h +++ b/src/common/dmr/lc/csbk/CSBK_RAND.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; public: /// Service Options. diff --git a/src/common/dmr/lc/csbk/CSBK_RAW.cpp b/src/common/dmr/lc/csbk/CSBK_RAW.cpp index 92651992..f2f63524 100644 --- a/src/common/dmr/lc/csbk/CSBK_RAW.cpp +++ b/src/common/dmr/lc/csbk/CSBK_RAW.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_RAW.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -65,7 +62,7 @@ CSBK_RAW::~CSBK_RAW() /// True, if CSBK was decoded, otherwise false. bool CSBK_RAW::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -78,8 +75,8 @@ bool CSBK_RAW::decode(const uint8_t* data) /// void CSBK_RAW::encode(uint8_t* data) { - assert(data != NULL); - assert(m_csbk != NULL); + assert(data != nullptr); + assert(m_csbk != nullptr); /* stub */ @@ -92,7 +89,7 @@ void CSBK_RAW::encode(uint8_t* data) /// void CSBK_RAW::setCSBK(const uint8_t* csbk) { - assert(csbk != NULL); + assert(csbk != nullptr); m_CSBKO = csbk[0U] & 0x3FU; // CSBKO m_lastBlock = (csbk[0U] & 0x80U) == 0x80U; // Last Block Marker diff --git a/src/common/dmr/lc/csbk/CSBK_TD_GRANT.cpp b/src/common/dmr/lc/csbk/CSBK_TD_GRANT.cpp index 68bd5f41..b0ae53a5 100644 --- a/src/common/dmr/lc/csbk/CSBK_TD_GRANT.cpp +++ b/src/common/dmr/lc/csbk/CSBK_TD_GRANT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_TD_GRANT.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ CSBK_TD_GRANT::CSBK_TD_GRANT() : CSBK() /// True, if CSBK was decoded, otherwise false. bool CSBK_TD_GRANT::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -67,7 +64,7 @@ bool CSBK_TD_GRANT::decode(const uint8_t* data) /// void CSBK_TD_GRANT::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/common/dmr/lc/csbk/CSBK_TD_GRANT.h b/src/common/dmr/lc/csbk/CSBK_TD_GRANT.h index a837c888..dec6b393 100644 --- a/src/common/dmr/lc/csbk/CSBK_TD_GRANT.h +++ b/src/common/dmr/lc/csbk/CSBK_TD_GRANT.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; }; } // namespace csbk } // namespace lc diff --git a/src/common/dmr/lc/csbk/CSBK_TV_GRANT.cpp b/src/common/dmr/lc/csbk/CSBK_TV_GRANT.cpp index 61f269a5..bb7cdb89 100644 --- a/src/common/dmr/lc/csbk/CSBK_TV_GRANT.cpp +++ b/src/common/dmr/lc/csbk/CSBK_TV_GRANT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_TV_GRANT.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ CSBK_TV_GRANT::CSBK_TV_GRANT() : CSBK(), /// True, if CSBK was decoded, otherwise false. bool CSBK_TV_GRANT::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -68,7 +65,7 @@ bool CSBK_TV_GRANT::decode(const uint8_t* data) /// void CSBK_TV_GRANT::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/common/dmr/lc/csbk/CSBK_TV_GRANT.h b/src/common/dmr/lc/csbk/CSBK_TV_GRANT.h index 9ba5b4f4..a1c3b843 100644 --- a/src/common/dmr/lc/csbk/CSBK_TV_GRANT.h +++ b/src/common/dmr/lc/csbk/CSBK_TV_GRANT.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; public: /// Flag indicating whether the grant is a late entry. diff --git a/src/common/dmr/lc/csbk/CSBK_UU_ANS_RSP.cpp b/src/common/dmr/lc/csbk/CSBK_UU_ANS_RSP.cpp index 791e7038..78fd5bae 100644 --- a/src/common/dmr/lc/csbk/CSBK_UU_ANS_RSP.cpp +++ b/src/common/dmr/lc/csbk/CSBK_UU_ANS_RSP.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_UU_ANS_RSP.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ CSBK_UU_ANS_RSP::CSBK_UU_ANS_RSP() : CSBK() /// True, if CSBK was decoded, otherwise false. bool CSBK_UU_ANS_RSP::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t csbk[DMR_CSBK_LENGTH_BYTES]; ::memset(csbk, 0x00U, DMR_CSBK_LENGTH_BYTES); @@ -77,7 +74,7 @@ bool CSBK_UU_ANS_RSP::decode(const uint8_t* data) /// void CSBK_UU_ANS_RSP::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ } diff --git a/src/common/dmr/lc/csbk/CSBK_UU_ANS_RSP.h b/src/common/dmr/lc/csbk/CSBK_UU_ANS_RSP.h index 34dbbef5..92b12fed 100644 --- a/src/common/dmr/lc/csbk/CSBK_UU_ANS_RSP.h +++ b/src/common/dmr/lc/csbk/CSBK_UU_ANS_RSP.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; }; } // namespace csbk } // namespace lc diff --git a/src/common/dmr/lc/csbk/CSBK_UU_V_REQ.cpp b/src/common/dmr/lc/csbk/CSBK_UU_V_REQ.cpp index 967a5052..73f8fa32 100644 --- a/src/common/dmr/lc/csbk/CSBK_UU_V_REQ.cpp +++ b/src/common/dmr/lc/csbk/CSBK_UU_V_REQ.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "dmr/lc/csbk/CSBK_UU_V_REQ.h" -#include "Log.h" -#include "Utils.h" using namespace dmr::lc::csbk; using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ CSBK_UU_V_REQ::CSBK_UU_V_REQ() : CSBK() /// True, if CSBK was decoded, otherwise false. bool CSBK_UU_V_REQ::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t csbk[DMR_CSBK_LENGTH_BYTES]; ::memset(csbk, 0x00U, DMR_CSBK_LENGTH_BYTES); @@ -77,7 +74,7 @@ bool CSBK_UU_V_REQ::decode(const uint8_t* data) /// void CSBK_UU_V_REQ::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ } diff --git a/src/common/dmr/lc/csbk/CSBK_UU_V_REQ.h b/src/common/dmr/lc/csbk/CSBK_UU_V_REQ.h index 6417cda4..f2c64164 100644 --- a/src/common/dmr/lc/csbk/CSBK_UU_V_REQ.h +++ b/src/common/dmr/lc/csbk/CSBK_UU_V_REQ.h @@ -51,7 +51,7 @@ namespace dmr void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; }; } // namespace csbk } // namespace lc diff --git a/src/common/edac/AMBEFEC.cpp b/src/common/edac/AMBEFEC.cpp index 1a0eb5af..547349ae 100644 --- a/src/common/edac/AMBEFEC.cpp +++ b/src/common/edac/AMBEFEC.cpp @@ -48,21 +48,15 @@ using namespace edac; /// /// Initializes a new instance of the AMBEFEC class. /// -AMBEFEC::AMBEFEC() -{ - /* stub */ -} +AMBEFEC::AMBEFEC() = default; /// /// Finalizes a instance of the AMBEFEC class. /// -AMBEFEC::~AMBEFEC() -{ - /* stub */ -} +AMBEFEC::~AMBEFEC() = default; /// -/// Regnerates the DMR AMBE FEC for the input bytes. +/// Regenerates the DMR AMBE FEC for the input bytes. /// /// /// Count of errors. diff --git a/src/common/edac/AMBEFEC.h b/src/common/edac/AMBEFEC.h index 93fcba90..b338ba22 100644 --- a/src/common/edac/AMBEFEC.h +++ b/src/common/edac/AMBEFEC.h @@ -471,7 +471,7 @@ namespace edac // --------------------------------------------------------------------------- // Class Declaration - // Implements routines to regenerate DMR/IMBE data using forward error + // Implements routines to regenerate AMBE/IMBE data using forward error // correction. // --------------------------------------------------------------------------- diff --git a/src/common/edac/BCH.cpp b/src/common/edac/BCH.cpp index 916de305..2e56ea3e 100644 --- a/src/common/edac/BCH.cpp +++ b/src/common/edac/BCH.cpp @@ -109,18 +109,12 @@ const int g[] = { /// /// Initializes a new instance of the BCH class. /// -BCH::BCH() -{ - /* stub */ -} +BCH::BCH() = default; /// /// Finalizes a instance of the BCH class. /// -BCH::~BCH() -{ - /* stub */ -} +BCH::~BCH() = default; /// /// Encodes input data with BCH. @@ -151,7 +145,7 @@ void BCH::encode(uint8_t* nid) /// /// /// -/// Compute redundacy bb[], the coefficients of b(x). The redundancy +/// Compute redundancy bb[], the coefficients of b(x). The redundancy /// polynomial b(x) is the remainder after dividing x^(length-k)*data(x) /// by the generator polynomial g(x). /// diff --git a/src/common/edac/BCH.h b/src/common/edac/BCH.h index 647213df..9d0c63fe 100644 --- a/src/common/edac/BCH.h +++ b/src/common/edac/BCH.h @@ -36,7 +36,7 @@ namespace edac { // --------------------------------------------------------------------------- // Class Declaration - // Implements Bose�Chaudhuri�Hocquenghem codes for protecting P25 NID + // Implements Bose/Chaudhuri/Hocquenghem codes for protecting P25 NID // data. // --------------------------------------------------------------------------- diff --git a/src/common/edac/BPTC19696.cpp b/src/common/edac/BPTC19696.cpp index d9074f31..54386755 100644 --- a/src/common/edac/BPTC19696.cpp +++ b/src/common/edac/BPTC19696.cpp @@ -35,9 +35,7 @@ using namespace edac; -#include #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -73,16 +71,16 @@ void BPTC19696::decode(const uint8_t* in, uint8_t* out) assert(in != nullptr); assert(out != nullptr); - // Get the raw binary + // get the raw binary decodeExtractBinary(in); - // Deinterleave + // deinterleave decodeDeInterleave(); - // Error check + // error check decodeErrorCheck(); - // Extract Data + // extract Data decodeExtractData(out); } @@ -96,16 +94,16 @@ void BPTC19696::encode(const uint8_t* in, uint8_t* out) assert(in != nullptr); assert(out != nullptr); - // Extract Data + // extract Data encodeExtractData(in); - // Error check + // error check encodeErrorCheck(); - // Deinterleave + // interleave encodeInterleave(); - // Get the raw binary + // get the raw binary encodeExtractBinary(out); } @@ -119,7 +117,7 @@ void BPTC19696::encode(const uint8_t* in, uint8_t* out) /// void BPTC19696::decodeExtractBinary(const uint8_t* in) { - // First block + // first block Utils::byteToBitsBE(in[0U], m_rawData + 0U); Utils::byteToBitsBE(in[1U], m_rawData + 8U); Utils::byteToBitsBE(in[2U], m_rawData + 16U); @@ -134,13 +132,13 @@ void BPTC19696::decodeExtractBinary(const uint8_t* in) Utils::byteToBitsBE(in[11U], m_rawData + 88U); Utils::byteToBitsBE(in[12U], m_rawData + 96U); - // Handle the two bits + // handle the two bits bool bits[8U]; Utils::byteToBitsBE(in[20U], bits); m_rawData[98U] = bits[6U]; m_rawData[99U] = bits[7U]; - // Second block + // second block Utils::byteToBitsBE(in[21U], m_rawData + 100U); Utils::byteToBitsBE(in[22U], m_rawData + 108U); Utils::byteToBitsBE(in[23U], m_rawData + 116U); @@ -163,11 +161,11 @@ void BPTC19696::decodeDeInterleave() for (uint32_t i = 0U; i < 196U; i++) m_deInterData[i] = false; - // The first bit is R(3) which is not used so can be ignored + // the first bit is R(3) which is not used so can be ignored for (uint32_t a = 0U; a < 196U; a++) { - // Calculate the interleave sequence + // calculate the interleave sequence uint32_t interleaveSequence = (a * 181U) % 196U; - // Shuffle the data + // shuffle the data m_deInterData[a] = m_rawData[interleaveSequence]; } } @@ -182,7 +180,7 @@ void BPTC19696::decodeErrorCheck() do { fixing = false; - // Run through each of the 15 columns + // run through each of the 15 columns bool col[13U]; for (uint32_t c = 0U; c < 15U; c++) { uint32_t pos = c + 1U; @@ -202,7 +200,7 @@ void BPTC19696::decodeErrorCheck() } } - // Run through each of the 9 rows containing data + // run through each of the 9 rows containing data for (uint32_t r = 0U; r < 9U; r++) { uint32_t pos = (r * 15U) + 1U; if (Hamming::decode15113_2(m_deInterData + pos)) @@ -319,13 +317,13 @@ void BPTC19696::encodeExtractData(const uint8_t* in) const /// void BPTC19696::encodeErrorCheck() { - // Run through each of the 9 rows containing data + // run through each of the 9 rows containing data for (uint32_t r = 0U; r < 9U; r++) { uint32_t pos = (r * 15U) + 1U; Hamming::encode15113_2(m_deInterData + pos); } - // Run through each of the 15 columns + // run through each of the 15 columns bool col[13U]; for (uint32_t c = 0U; c < 15U; c++) { uint32_t pos = c + 1U; @@ -352,11 +350,11 @@ void BPTC19696::encodeInterleave() for (uint32_t i = 0U; i < 196U; i++) m_rawData[i] = false; - // The first bit is R(3) which is not used so can be ignored + // the first bit is R(3) which is not used so can be ignored for (uint32_t a = 0U; a < 196U; a++) { - // Calculate the interleave sequence + // calculate the interleave sequence uint32_t interleaveSequence = (a * 181U) % 196U; - // Unshuffle the data + // unshuffle the data m_rawData[interleaveSequence] = m_deInterData[a]; } } @@ -367,7 +365,7 @@ void BPTC19696::encodeInterleave() /// void BPTC19696::encodeExtractBinary(uint8_t* data) { - // First block + // first block Utils::bitsToByteBE(m_rawData + 0U, data[0U]); Utils::bitsToByteBE(m_rawData + 8U, data[1U]); Utils::bitsToByteBE(m_rawData + 16U, data[2U]); @@ -381,13 +379,13 @@ void BPTC19696::encodeExtractBinary(uint8_t* data) Utils::bitsToByteBE(m_rawData + 80U, data[10U]); Utils::bitsToByteBE(m_rawData + 88U, data[11U]); - // Handle the two bits + // handle the two bits uint8_t byte; Utils::bitsToByteBE(m_rawData + 96U, byte); data[12U] = (data[12U] & 0x3FU) | ((byte >> 0) & 0xC0U); data[20U] = (data[20U] & 0xFCU) | ((byte >> 4) & 0x03U); - // Second block + // second block Utils::bitsToByteBE(m_rawData + 100U, data[21U]); Utils::bitsToByteBE(m_rawData + 108U, data[22U]); Utils::bitsToByteBE(m_rawData + 116U, data[23U]); diff --git a/src/common/edac/CRC.cpp b/src/common/edac/CRC.cpp index 5b8f3e60..8fc11709 100644 --- a/src/common/edac/CRC.cpp +++ b/src/common/edac/CRC.cpp @@ -35,10 +35,7 @@ using namespace edac; -#include -#include #include -#include // --------------------------------------------------------------------------- // Constants diff --git a/src/common/edac/Golay2087.cpp b/src/common/edac/Golay2087.cpp index 7f420430..a8616c04 100644 --- a/src/common/edac/Golay2087.cpp +++ b/src/common/edac/Golay2087.cpp @@ -226,7 +226,7 @@ const uint32_t DECODING_TABLE_1987[] = { #define X18 0x00040000 /* vector representation of X^{18} */ #define X11 0x00000800 /* vector representation of X^{11} */ #define MASK8 0xfffff800 /* auxiliary vector for testing */ -#define GENPOL 0x00000c75 /* generator polinomial, g(x) */ +#define GENPOL 0x00000c75 /* generator polynomial, g(x) */ // --------------------------------------------------------------------------- // Static Class Members @@ -278,7 +278,7 @@ void Golay2087::encode(uint8_t* data) /// Compute the syndrome corresponding to the given pattern, i.e., the /// remainder after dividing the pattern (when considering it as the vector /// representation of a polynomial) by the generator polynomial, GENPOL. -/// In the program this pattern has several meanings: (1) pattern = infomation +/// In the program this pattern has several meanings: (1) pattern = information /// bits, when constructing the encoding table; (2) pattern = error pattern, /// when constructing the decoding table; and (3) pattern = received vector, to /// obtain its syndrome in decoding. diff --git a/src/common/edac/Golay24128.cpp b/src/common/edac/Golay24128.cpp index 6c0b1e96..0defade8 100644 --- a/src/common/edac/Golay24128.cpp +++ b/src/common/edac/Golay24128.cpp @@ -35,7 +35,6 @@ using namespace edac; -#include #include // --------------------------------------------------------------------------- @@ -1076,7 +1075,7 @@ static const uint32_t DECODING_TABLE_23127[] = { #define X22 0x00400000 /* vector representation of X^{22} */ #define X11 0x00000800 /* vector representation of X^{11} */ #define MASK12 0xfffff800 /* auxiliary vector for testing */ -#define GENPOL 0x00000c75 /* generator polinomial, g(x) */ +#define GENPOL 0x00000c75 /* generator polynomial, g(x) */ // --------------------------------------------------------------------------- // Static Class Members @@ -1287,7 +1286,7 @@ void Golay24128::encode24128(uint8_t* data, const uint8_t* raw, uint32_t msglen) /// Compute the syndrome corresponding to the given pattern, i.e., the /// remainder after dividing the pattern (when considering it as the vector /// representation of a polynomial) by the generator polynomial, GENPOL. -/// In the program this pattern has several meanings: (1) pattern = infomation +/// In the program this pattern has several meanings: (1) pattern = information /// bits, when constructing the encoding table; (2) pattern = error pattern, /// when constructing the decoding table; and (3) pattern = received vector, to /// obtain its syndrome in decoding. diff --git a/src/common/edac/QR1676.cpp b/src/common/edac/QR1676.cpp index 82d76ec6..f5a78afc 100644 --- a/src/common/edac/QR1676.cpp +++ b/src/common/edac/QR1676.cpp @@ -32,7 +32,6 @@ using namespace edac; -#include #include // --------------------------------------------------------------------------- @@ -79,7 +78,7 @@ const uint32_t DECODING_TABLE_1576[] = { #define X14 0x00004000 /* vector representation of X^{14} */ #define X8 0x00000100 /* vector representation of X^{8} */ #define MASK7 0xffffff00 /* auxiliary vector for testing */ -#define GENPOL 0x00000139 /* generator polinomial, g(x) */ +#define GENPOL 0x00000139 /* generator polynomial, g(x) */ // --------------------------------------------------------------------------- // Static Class Members @@ -130,7 +129,7 @@ void QR1676::encode(uint8_t* data) /// Compute the syndrome corresponding to the given pattern, i.e., the /// remainder after dividing the pattern (when considering it as the vector /// representation of a polynomial) by the generator polynomial, GENPOL. -/// In the program this pattern has several meanings: (1) pattern = infomation +/// In the program this pattern has several meanings: (1) pattern = information /// bits, when constructing the encoding table; (2) pattern = error pattern, /// when constructing the decoding table; and (3) pattern = received vector, to /// obtain its syndrome in decoding. diff --git a/src/common/edac/RS129.cpp b/src/common/edac/RS129.cpp index fd4081d0..58db6181 100644 --- a/src/common/edac/RS129.cpp +++ b/src/common/edac/RS129.cpp @@ -32,9 +32,7 @@ using namespace edac; -#include #include -#include // --------------------------------------------------------------------------- // Constants diff --git a/src/common/edac/RS634717.cpp b/src/common/edac/RS634717.cpp index 91361ec2..d2ca2059 100755 --- a/src/common/edac/RS634717.cpp +++ b/src/common/edac/RS634717.cpp @@ -36,9 +36,7 @@ using namespace edac; -#include #include -#include #include // --------------------------------------------------------------------------- @@ -145,18 +143,12 @@ RS6355 rs24169; // 8 bit / 4 bit corrections max / 2 bytes total /// /// Initializes a new instance of the RS634717 class. /// -RS634717::RS634717() -{ - /* stub */ -} +RS634717::RS634717() = default; /// /// Finalizes a instance of the RS634717 class. /// -RS634717::~RS634717() -{ - /* stub */ -} +RS634717::~RS634717() = default; /// /// Decode RS (24,12,13) FEC. diff --git a/src/common/edac/SHA256.cpp b/src/common/edac/SHA256.cpp index a9cb285d..09c8e014 100644 --- a/src/common/edac/SHA256.cpp +++ b/src/common/edac/SHA256.cpp @@ -33,7 +33,6 @@ using namespace edac; -#include #include #include @@ -114,7 +113,7 @@ static inline void set_uint32(uint8_t* cp, uint32_t v) /// /// /// Takes a pointer to a 256 bit block of data (eight 32 bit ints) and -/// intializes it to the start constants of the SHA256 algorithm. This +/// initializes it to the start constants of the SHA256 algorithm. This /// must be called before using hash in the call to sha256_hash /// SHA256::SHA256() : @@ -332,7 +331,7 @@ void SHA256::processBytes(const uint8_t* buffer, uint32_t len) } /// -/// Process the remaining bytes in the bufferand put result from context +/// Process the remaining bytes in the buffer and put result from context /// in first 32 bytes following buffer. The result is always in little /// endian byte order, so that a byte - wise output yields to the wanted /// ASCII representation of the message digest. diff --git a/src/common/edac/SHA256.h b/src/common/edac/SHA256.h index 888743e9..377e9093 100644 --- a/src/common/edac/SHA256.h +++ b/src/common/edac/SHA256.h @@ -67,7 +67,7 @@ namespace edac /// that LEN is a multiple of 64. void processBytes(const uint8_t* buffer, uint32_t len); - /// Process the remaining bytes in the bufferand put result from context in first 32 + /// Process the remaining bytes in the buffer and put result from context in first 32 /// bytes following buffer. The result is always in little endian byte order, so that a byte-wise /// output yields to the wanted ASCII representation of the message digest. uint8_t* finish(uint8_t* buffer); diff --git a/src/common/edac/Trellis.cpp b/src/common/edac/Trellis.cpp index 12d11662..7d4bb804 100644 --- a/src/common/edac/Trellis.cpp +++ b/src/common/edac/Trellis.cpp @@ -30,7 +30,6 @@ using namespace edac; -#include #include // --------------------------------------------------------------------------- @@ -66,18 +65,12 @@ const uint8_t ENCODE_TABLE_12[] = { /// /// Initializes a new instance of the Trellis class. /// -Trellis::Trellis() -{ - /* stub */ -} +Trellis::Trellis() = default; /// /// Finalizes a instance of the Trellis class. /// -Trellis::~Trellis() -{ - /* stub */ -} +Trellis::~Trellis() = default; /// /// Decodes 3/4 rate Trellis. diff --git a/src/common/edac/rs/RS.h b/src/common/edac/rs/RS.h index 6495794c..29af9258 100755 --- a/src/common/edac/rs/RS.h +++ b/src/common/edac/rs/RS.h @@ -140,9 +140,9 @@ namespace edac virtual int load() const = 0; /// Initializes a new instance of the reed_solomon_base class. - reed_solomon_base() { /* stub */ } + reed_solomon_base() = default; /// Finalizes a instance of the reed_solomon_base class. - virtual ~reed_solomon_base() { /* stub */ } + virtual ~reed_solomon_base() = default; /// virtual std::ostream &output(std::ostream &lhs) const { return lhs << "RS(" << this->size() << "," << this->load() << ")"; } @@ -378,7 +378,7 @@ namespace edac } /// Finalizes a instance of the reed_solomon_tabs class. - virtual ~reed_solomon_tabs() { /* stub */ } + ~reed_solomon_tabs() override = default; // // modnn -- modulo replacement for galois field arithmetics, optionally w/ table acceleration @@ -415,7 +415,6 @@ namespace edac } }; - // --------------------------------------------------------------------------- // Class Declaration // Reed-Solomon codec. @@ -509,7 +508,7 @@ namespace edac } } /// Finalizes a instance of the reed_solomon class. - virtual ~reed_solomon() { /* stub */ } + virtual ~reed_solomon() = default; /// A data element's bits. virtual size_t datum() const { return DATUM; } @@ -743,7 +742,6 @@ namespace edac return corrects; } - int encode(const TYP* data, int len, TYP* parity) const { // Check length parameter for validity diff --git a/src/common/lookups/AffiliationLookup.cpp b/src/common/lookups/AffiliationLookup.cpp index 0fbc84a5..f1c49c47 100644 --- a/src/common/lookups/AffiliationLookup.cpp +++ b/src/common/lookups/AffiliationLookup.cpp @@ -28,11 +28,6 @@ using namespace lookups; -#include -#include -#include -#include - // --------------------------------------------------------------------------- // Public Class Members // --------------------------------------------------------------------------- diff --git a/src/common/lookups/AffiliationLookup.h b/src/common/lookups/AffiliationLookup.h index 8385b839..4d83f9d6 100644 --- a/src/common/lookups/AffiliationLookup.h +++ b/src/common/lookups/AffiliationLookup.h @@ -87,9 +87,9 @@ namespace lookups } /// Helper to determine if the channel identity is valid. - bool isValidChId() { return m_chId != 0U; } + bool isValidChId() const { return m_chId != 0U; } /// Helper to determine if the channel is valid. - bool isValidCh() { return m_chNo != 0U; } + bool isValidCh() const { return m_chNo != 0U; } public: /// Voice Channel Identity. diff --git a/src/common/lookups/IdenTableLookup.cpp b/src/common/lookups/IdenTableLookup.cpp index 28536580..b4a6be28 100644 --- a/src/common/lookups/IdenTableLookup.cpp +++ b/src/common/lookups/IdenTableLookup.cpp @@ -25,14 +25,10 @@ */ #include "lookups/IdenTableLookup.h" #include "Log.h" -#include "Timer.h" using namespace lookups; -#include #include -#include -#include #include #include #include @@ -51,14 +47,6 @@ IdenTableLookup::IdenTableLookup(const std::string& filename, uint32_t reloadTim /* stub */ } -/// -/// Finalizes a instance of the IdenTableLookup class. -/// -IdenTableLookup::~IdenTableLookup() -{ - /* stub */ -} - /// /// Finds a table entry in this lookup table. /// @@ -116,7 +104,7 @@ std::vector IdenTableLookup::list() /// True, if lookup table was loaded, otherwise false. bool IdenTableLookup::load() { - if (m_filename.length() <= 0) { + if (m_filename.empty()) { return false; } diff --git a/src/common/lookups/IdenTableLookup.h b/src/common/lookups/IdenTableLookup.h index 28473d76..724a62af 100644 --- a/src/common/lookups/IdenTableLookup.h +++ b/src/common/lookups/IdenTableLookup.h @@ -42,7 +42,7 @@ namespace lookups class HOST_SW_API IdenTable { public: - /// Initializes a new insatnce of the IdenTable class. + /// Initializes a new instance of the IdenTable class. IdenTable() : m_channelId(0U), m_baseFrequency(0U), @@ -52,7 +52,7 @@ namespace lookups { /* stub */ } - /// Initializes a new insatnce of the IdenTable class. + /// Initializes a new instance of the IdenTable class. /// /// /// @@ -107,18 +107,16 @@ namespace lookups public: /// Initializes a new instance of the IdenTableLookup class. IdenTableLookup(const std::string& filename, uint32_t reloadTime); - /// Finalizes a instance of the IdenTableLookup class. - virtual ~IdenTableLookup(); /// Finds a table entry in this lookup table. - virtual IdenTable find(uint32_t id); + IdenTable find(uint32_t id) override; /// Returns the list of entries in this lookup table. std::vector list(); protected: /// Loads the table from the passed lookup table file. /// True, if lookup table was loaded, otherwise false. - virtual bool load(); + bool load() override; }; } // namespace lookups diff --git a/src/common/lookups/LookupTable.h b/src/common/lookups/LookupTable.h index e972feef..8a2ea309 100644 --- a/src/common/lookups/LookupTable.h +++ b/src/common/lookups/LookupTable.h @@ -26,10 +26,6 @@ #if !defined(__LOOKUP_TABLE_H__) #define __LOOKUP_TABLE_H__ -#if _MSC_VER > 1910 -#pragma warning(disable : 4834) // [[nodiscard]] warning -- we don't care about this here -#endif - #include "common/Defines.h" #include "common/Thread.h" #include "common/Timer.h" @@ -59,18 +55,14 @@ namespace lookups Thread(), m_filename(filename), m_reloadTime(reloadTime), - m_table() - { - /* stub */ - } - /// Finalizes a instance of the LookupTable class. - virtual ~LookupTable() + m_table(), + m_stop(false) { /* stub */ } /// - virtual void entry() + void entry() override { if (m_reloadTime == 0U) { return; @@ -161,8 +153,6 @@ namespace lookups std::mutex m_mutex; bool m_stop; - bool m_acl; - /// Loads the table from the passed lookup table file. /// True, if lookup table was loaded, otherwise false. virtual bool load() = 0; diff --git a/src/common/lookups/RSSIInterpolator.cpp b/src/common/lookups/RSSIInterpolator.cpp index 060165ff..621eb007 100644 --- a/src/common/lookups/RSSIInterpolator.cpp +++ b/src/common/lookups/RSSIInterpolator.cpp @@ -35,7 +35,6 @@ using namespace lookups; #include #include #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -94,7 +93,7 @@ bool RSSIInterpolator::load(const std::string& filename) } /// -/// Interoplates the given raw RSSI value with the lookup map. +/// Interpolates the given raw RSSI value with the lookup map. /// /// Raw RSSI value from modem DSP. /// Interpolated RSSI value. diff --git a/src/common/lookups/RSSIInterpolator.h b/src/common/lookups/RSSIInterpolator.h index 1b7f56e9..c7d7fbce 100644 --- a/src/common/lookups/RSSIInterpolator.h +++ b/src/common/lookups/RSSIInterpolator.h @@ -53,7 +53,7 @@ namespace lookups /// Loads the table from the passed RSSI mapping file. bool load(const std::string& filename); - /// Interoplates the given raw RSSI value with the lookup map. + /// Interpolates the given raw RSSI value with the lookup map. int interpolate(uint16_t raw) const; private: diff --git a/src/common/lookups/RadioIdLookup.cpp b/src/common/lookups/RadioIdLookup.cpp index f6821c8f..055502e5 100644 --- a/src/common/lookups/RadioIdLookup.cpp +++ b/src/common/lookups/RadioIdLookup.cpp @@ -31,14 +31,10 @@ #include "lookups/RadioIdLookup.h" #include "p25/P25Defines.h" #include "Log.h" -#include "Timer.h" using namespace lookups; -#include #include -#include -#include #include #include #include @@ -59,14 +55,6 @@ RadioIdLookup::RadioIdLookup(const std::string& filename, uint32_t reloadTime, b /* stub */ } -/// -/// Finalizes a instance of the RadioIdLookup class. -/// -RadioIdLookup::~RadioIdLookup() -{ - /* stub */ -} - /// /// Toggles the specified radio ID enabled or disabled. /// @@ -75,7 +63,7 @@ RadioIdLookup::~RadioIdLookup() void RadioIdLookup::toggleEntry(uint32_t id, bool enabled) { RadioId rid = find(id); - if (rid.radioEnabled() == false && rid.radioDefault() == true) { + if (!rid.radioEnabled() && rid.radioDefault()) { if (enabled) { LogMessage(LOG_HOST, "Added enabled RID %u to RID ACL table", id); } @@ -84,7 +72,7 @@ void RadioIdLookup::toggleEntry(uint32_t id, bool enabled) } } - if (rid.radioEnabled() == false && rid.radioDefault() == false) { + if (!rid.radioEnabled() && !rid.radioDefault()) { if (enabled) { LogMessage(LOG_HOST, "Enabled RID %u in RID ACL table", id); } @@ -171,7 +159,7 @@ bool RadioIdLookup::getACL() /// True, if lookup table was loaded, otherwise false. bool RadioIdLookup::load() { - if (m_filename.length() <= 0) { + if (m_filename.empty()) { return false; } diff --git a/src/common/lookups/RadioIdLookup.h b/src/common/lookups/RadioIdLookup.h index e48d0fae..45980952 100644 --- a/src/common/lookups/RadioIdLookup.h +++ b/src/common/lookups/RadioIdLookup.h @@ -46,14 +46,14 @@ namespace lookups class HOST_SW_API RadioId { public: - /// Initializes a new insatnce of the RadioId class. + /// Initializes a new instance of the RadioId class. RadioId() : m_radioEnabled(false), m_radioDefault(false) { /* stub */ } - /// Initializes a new insatnce of the RadioId class. + /// Initializes a new instance of the RadioId class. /// /// RadioId(bool radioEnabled, bool radioDefault) : @@ -100,8 +100,6 @@ namespace lookups public: /// Initializes a new instance of the RadioIdLookup class. RadioIdLookup(const std::string& filename, uint32_t reloadTime, bool ridAcl); - /// Finalizes a instance of the RadioIdLookup class. - virtual ~RadioIdLookup(); /// Toggles the specified radio ID enabled or disabled. void toggleEntry(uint32_t id, bool enabled); @@ -109,7 +107,7 @@ namespace lookups /// Adds a new entry to the lookup table by the specified unique ID. void addEntry(uint32_t id, bool enabled); /// Finds a table entry in this lookup table. - virtual RadioId find(uint32_t id); + RadioId find(uint32_t id) override; /// Flag indicating whether radio ID access control is enabled or not. bool getACL(); @@ -119,7 +117,7 @@ namespace lookups /// Loads the table from the passed lookup table file. /// True, if lookup table was loaded, otherwise false. - virtual bool load(); + bool load() override; }; } // namespace lookups diff --git a/src/common/lookups/TalkgroupRulesLookup.cpp b/src/common/lookups/TalkgroupRulesLookup.cpp index 7943bf26..fb9de9d8 100644 --- a/src/common/lookups/TalkgroupRulesLookup.cpp +++ b/src/common/lookups/TalkgroupRulesLookup.cpp @@ -29,13 +29,8 @@ using namespace lookups; -#include -#include -#include -#include #include #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -62,10 +57,7 @@ TalkgroupRulesLookup::TalkgroupRulesLookup(const std::string& filename, uint32_t /// /// Finalizes a instance of the TalkgroupRulesLookup class. /// -TalkgroupRulesLookup::~TalkgroupRulesLookup() -{ - /* stub */ -} +TalkgroupRulesLookup::~TalkgroupRulesLookup() = default; /// /// diff --git a/src/common/lookups/TalkgroupRulesLookup.h b/src/common/lookups/TalkgroupRulesLookup.h index 19530ade..0e49aa6f 100644 --- a/src/common/lookups/TalkgroupRulesLookup.h +++ b/src/common/lookups/TalkgroupRulesLookup.h @@ -44,14 +44,14 @@ namespace lookups class HOST_SW_API TalkgroupRuleGroupVoiceSource { public: - /// Initializes a new insatnce of the TalkgroupRuleGroupVoiceSource class. + /// Initializes a new instance of the TalkgroupRuleGroupVoiceSource class. TalkgroupRuleGroupVoiceSource() : m_tgId(0U), m_tgSlot(0U) { /* stub */ } - /// Initializes a new insatnce of the TalkgroupRuleGroupVoiceSource class. + /// Initializes a new instance of the TalkgroupRuleGroupVoiceSource class. /// TalkgroupRuleGroupVoiceSource(yaml::Node& node) : TalkgroupRuleGroupVoiceSource() @@ -61,7 +61,7 @@ namespace lookups } /// Equals operator. Copies this TalkgroupRuleGroupVoiceSource to another TalkgroupRuleGroupVoiceSource. - virtual TalkgroupRuleGroupVoiceSource& operator=(const TalkgroupRuleGroupVoiceSource& data) + virtual TalkgroupRuleGroupVoiceSource& operator= (const TalkgroupRuleGroupVoiceSource& data) { if (this != &data) { m_tgId = data.m_tgId; @@ -85,7 +85,7 @@ namespace lookups class HOST_SW_API TalkgroupRuleRewrite { public: - /// Initializes a new insatnce of the TalkgroupRuleRewrite class. + /// Initializes a new instance of the TalkgroupRuleRewrite class. TalkgroupRuleRewrite() : m_peerId(0U), m_tgId(0U), @@ -93,7 +93,7 @@ namespace lookups { /* stub */ } - /// Initializes a new insatnce of the TalkgroupRuleRewrite class. + /// Initializes a new instance of the TalkgroupRuleRewrite class. /// TalkgroupRuleRewrite(yaml::Node& node) : TalkgroupRuleRewrite() @@ -104,7 +104,7 @@ namespace lookups } /// Equals operator. Copies this TalkgroupRuleRewrite to another TalkgroupRuleRewrite. - virtual TalkgroupRuleRewrite& operator=(const TalkgroupRuleRewrite& data) + virtual TalkgroupRuleRewrite& operator= (const TalkgroupRuleRewrite& data) { if (this != &data) { m_peerId = data.m_peerId; @@ -131,7 +131,7 @@ namespace lookups class HOST_SW_API TalkgroupRuleConfig { public: - /// Initializes a new insatnce of the TalkgroupRuleConfig class. + /// Initializes a new instance of the TalkgroupRuleConfig class. TalkgroupRuleConfig() : m_active(false), m_parrot(false), @@ -141,7 +141,7 @@ namespace lookups { /* stub */ } - /// Initializes a new insatnce of the TalkgroupRuleConfig class. + /// Initializes a new instance of the TalkgroupRuleConfig class. /// TalkgroupRuleConfig(yaml::Node& node) : TalkgroupRuleConfig() @@ -175,7 +175,7 @@ namespace lookups } /// Equals operator. Copies this TalkgroupRuleConfig to another TalkgroupRuleConfig. - virtual TalkgroupRuleConfig& operator=(const TalkgroupRuleConfig& data) + virtual TalkgroupRuleConfig& operator= (const TalkgroupRuleConfig& data) { if (this != &data) { m_active = data.m_active; @@ -207,7 +207,7 @@ namespace lookups class HOST_SW_API TalkgroupRuleGroupVoice { public: - /// Initializes a new insatnce of the TalkgroupRuleGroupVoice class. + /// Initializes a new instance of the TalkgroupRuleGroupVoice class. TalkgroupRuleGroupVoice() : m_name(), m_config(), @@ -215,7 +215,7 @@ namespace lookups { /* stub */ } - /// Initializes a new insatnce of the TalkgroupRuleGroupVoice class. + /// Initializes a new instance of the TalkgroupRuleGroupVoice class. /// TalkgroupRuleGroupVoice(yaml::Node& node) : TalkgroupRuleGroupVoice() @@ -226,7 +226,7 @@ namespace lookups } /// Equals operator. Copies this TalkgroupRuleGroupVoice to another TalkgroupRuleGroupVoice. - virtual TalkgroupRuleGroupVoice& operator=(const TalkgroupRuleGroupVoice& data) + virtual TalkgroupRuleGroupVoice& operator= (const TalkgroupRuleGroupVoice& data) { if (this != &data) { m_name = data.m_name; @@ -265,10 +265,10 @@ namespace lookups /// Initializes a new instance of the TalkgroupRulesLookup class. TalkgroupRulesLookup(const std::string& filename, uint32_t reloadTime, bool acl); /// Finalizes a instance of the TalkgroupRulesLookup class. - virtual ~TalkgroupRulesLookup(); + ~TalkgroupRulesLookup() override; /// - void entry(); + void entry() override; /// Stops and unloads this lookup table. void stop(); diff --git a/src/common/network/BaseNetwork.cpp b/src/common/network/BaseNetwork.cpp index 5e061e26..91e26430 100644 --- a/src/common/network/BaseNetwork.cpp +++ b/src/common/network/BaseNetwork.cpp @@ -33,17 +33,13 @@ #include "common/nxdn/NXDNDefines.h" #include "common/p25/dfsi/DFSIDefines.h" #include "common/p25/dfsi/LC.h" -#include "edac/SHA256.h" #include "network/BaseNetwork.h" -#include "Log.h" #include "Utils.h" using namespace network; using namespace network::frame; -#include #include -#include // --------------------------------------------------------------------------- // Public Class Members diff --git a/src/common/network/FrameQueue.cpp b/src/common/network/FrameQueue.cpp index 0923cabc..2b7513bd 100644 --- a/src/common/network/FrameQueue.cpp +++ b/src/common/network/FrameQueue.cpp @@ -36,9 +36,7 @@ using namespace network; using namespace network::frame; -#include #include -#include #include // --------------------------------------------------------------------------- @@ -57,14 +55,6 @@ FrameQueue::FrameQueue(UDPSocket* socket, uint32_t peerId, bool debug) : RawFram assert(peerId < 999999999U); } -/// -/// Finalizes a instance of the FrameQueue class. -/// -FrameQueue::~FrameQueue() -{ - /* stub */ -} - /// /// Read message from the received UDP packet. /// diff --git a/src/common/network/FrameQueue.h b/src/common/network/FrameQueue.h index ba8c4d87..68172cfc 100644 --- a/src/common/network/FrameQueue.h +++ b/src/common/network/FrameQueue.h @@ -52,8 +52,6 @@ namespace network public: /// Initializes a new instance of the FrameQueue class. FrameQueue(UDPSocket* socket, uint32_t peerId, bool debug); - /// Finalizes a instance of the FrameQueue class. - virtual ~FrameQueue(); /// Read message from the received UDP packet. UInt8Array read(int& messageLength, sockaddr_storage& address, uint32_t& addrLen, diff --git a/src/common/network/RTPExtensionHeader.cpp b/src/common/network/RTPExtensionHeader.cpp index 8e01f146..ab9e1877 100644 --- a/src/common/network/RTPExtensionHeader.cpp +++ b/src/common/network/RTPExtensionHeader.cpp @@ -46,10 +46,7 @@ RTPExtensionHeader::RTPExtensionHeader() : /// /// Finalizes a instance of the RTPExtensionHeader class. /// -RTPExtensionHeader::~RTPExtensionHeader() -{ - /* stub */ -} +RTPExtensionHeader::~RTPExtensionHeader() = default; /// /// Decode a RTP header. diff --git a/src/common/network/RTPFNEHeader.cpp b/src/common/network/RTPFNEHeader.cpp index 6ce5025e..c2a909d5 100644 --- a/src/common/network/RTPFNEHeader.cpp +++ b/src/common/network/RTPFNEHeader.cpp @@ -50,12 +50,9 @@ RTPFNEHeader::RTPFNEHeader() : } /// -/// Finalizes a instance of the RTPExtensionHeader class. +/// Finalizes a instance of the RTPFNEHeader class. /// -RTPFNEHeader::~RTPFNEHeader() -{ - /* stub */ -} +RTPFNEHeader::~RTPFNEHeader() = default; /// /// Decode a RTP header. diff --git a/src/common/network/RTPFNEHeader.h b/src/common/network/RTPFNEHeader.h index 6042abbd..dc011c9b 100644 --- a/src/common/network/RTPFNEHeader.h +++ b/src/common/network/RTPFNEHeader.h @@ -65,9 +65,9 @@ namespace network ~RTPFNEHeader(); /// Decode a RTP header. - virtual bool decode(const uint8_t* data); + bool decode(const uint8_t* data) override; /// Encode a RTP header. - virtual void encode(uint8_t* data); + void encode(uint8_t* data) override; public: /// Traffic payload packet CRC-16. diff --git a/src/common/network/RTPHeader.cpp b/src/common/network/RTPHeader.cpp index 62d9b1c5..00b09c9e 100644 --- a/src/common/network/RTPHeader.cpp +++ b/src/common/network/RTPHeader.cpp @@ -62,10 +62,7 @@ RTPHeader::RTPHeader() : /// /// Finalizes a instance of the RTPHeader class. /// -RTPHeader::~RTPHeader() -{ - /* stub */ -} +RTPHeader::~RTPHeader() = default; /// /// Decode a RTP header. diff --git a/src/common/network/RTPHeader.h b/src/common/network/RTPHeader.h index adc8bb24..aad4133e 100644 --- a/src/common/network/RTPHeader.h +++ b/src/common/network/RTPHeader.h @@ -69,7 +69,7 @@ namespace network __READONLY_PROPERTY(uint8_t, version, Version); /// Flag indicating if the packet has trailing padding. __READONLY_PROPERTY(bool, padding, Padding); - /// Flag indicating the presense of an extension header. + /// Flag indicating the presence of an extension header. __PROPERTY(bool, extension, Extension); /// Count of contributing source IDs that follow the SSRC. __READONLY_PROPERTY(uint8_t, cc, CSRCCount); diff --git a/src/common/network/RawFrameQueue.cpp b/src/common/network/RawFrameQueue.cpp index 14e62782..94b020b5 100644 --- a/src/common/network/RawFrameQueue.cpp +++ b/src/common/network/RawFrameQueue.cpp @@ -31,9 +31,7 @@ using namespace network; -#include #include -#include #include // --------------------------------------------------------------------------- @@ -58,7 +56,7 @@ RawFrameQueue::RawFrameQueue(UDPSocket* socket, bool debug) : /// RawFrameQueue::~RawFrameQueue() { - /* stub */ + deleteBuffers(); } /// @@ -149,6 +147,20 @@ bool RawFrameQueue::flushQueue() ret = false; } + deleteBuffers(); + + return ret; +} + +// --------------------------------------------------------------------------- +// Private Class Members +// --------------------------------------------------------------------------- + +/// +/// Helper to ensure buffers are deleted. +/// +void RawFrameQueue::deleteBuffers() +{ for (auto& buffer : m_buffers) { if (buffer != nullptr) { // LogDebug(LOG_NET, "deleting buffer, addr %p len %u", buffer->buffer, buffer->length); @@ -163,6 +175,4 @@ bool RawFrameQueue::flushQueue() } } m_buffers.clear(); - - return ret; } diff --git a/src/common/network/RawFrameQueue.h b/src/common/network/RawFrameQueue.h index ad3dcf57..34b47fe9 100644 --- a/src/common/network/RawFrameQueue.h +++ b/src/common/network/RawFrameQueue.h @@ -67,6 +67,10 @@ namespace network BufferVector m_buffers; bool m_debug; + + private: + /// Helper to ensure buffers are deleted. + void deleteBuffers(); }; } // namespace network diff --git a/src/common/network/UDPSocket.h b/src/common/network/UDPSocket.h index 4a1224e6..3b932b34 100644 --- a/src/common/network/UDPSocket.h +++ b/src/common/network/UDPSocket.h @@ -62,11 +62,17 @@ enum IPMATCHTYPE { namespace network { #if defined(HAVE_SENDMSG) && !defined(HAVE_SENDMMSG) + /* For `sendmmsg'. */ struct mmsghdr { - struct msghdr msg_hdr; - unsigned int msg_len; + struct msghdr msg_hdr; /* Actual message header. */ + unsigned int msg_len; /* Number of received or sent bytes for the entry. */ }; + /* Send a VLEN messages as described by VMESSAGES to socket FD. + Returns the number of datagrams successfully written or -1 for errors. + + This function is a cancellation point and therefore not marked with + __THROW. */ static inline int sendmmsg(int sockfd, struct mmsghdr* msgvec, unsigned int vlen, int flags) { ssize_t n = 0; diff --git a/src/common/network/rest/http/ClientConnection.h b/src/common/network/rest/http/ClientConnection.h index 0993d5a0..c18ba47f 100644 --- a/src/common/network/rest/http/ClientConnection.h +++ b/src/common/network/rest/http/ClientConnection.h @@ -66,6 +66,7 @@ namespace network explicit ClientConnection(asio::ip::tcp::socket socket, RequestHandlerType& handler) : m_socket(std::move(socket)), m_requestHandler(handler), + m_buffer(), m_lexer(HTTPLexer(true)) { /* stub */ diff --git a/src/common/network/rest/http/HTTPClient.h b/src/common/network/rest/http/HTTPClient.h index 1dd736e5..e835e3ce 100644 --- a/src/common/network/rest/http/HTTPClient.h +++ b/src/common/network/rest/http/HTTPClient.h @@ -75,7 +75,7 @@ namespace network /// Initializes a copy instance of the HTTPClient class. HTTPClient(const HTTPClient&) = delete; /// Finalizes a instance of the HTTPClient class. - ~HTTPClient() + ~HTTPClient() override { if (m_connection != nullptr) { close(); @@ -136,7 +136,7 @@ namespace network private: /// - virtual void entry() + void entry() override { if (m_completed) { return; @@ -164,7 +164,7 @@ namespace network { asio::connect(m_socket, endpoints); - m_connection = new_unique(ConnectionType, std::move(m_socket), m_requestHandler); + m_connection = std::make_unique(std::move(m_socket), m_requestHandler); m_connection->start(); } diff --git a/src/common/network/rest/http/ServerConnection.h b/src/common/network/rest/http/ServerConnection.h index 1e5e1164..b08cdfbd 100644 --- a/src/common/network/rest/http/ServerConnection.h +++ b/src/common/network/rest/http/ServerConnection.h @@ -77,6 +77,7 @@ namespace network m_socket(std::move(socket)), m_connectionManager(manager), m_requestHandler(handler), + m_buffer(), m_lexer(HTTPLexer(false)), m_persistent(persistent) { diff --git a/src/common/network/rest/http/ServerConnectionManager.h b/src/common/network/rest/http/ServerConnectionManager.h index 20040caf..abe58281 100644 --- a/src/common/network/rest/http/ServerConnectionManager.h +++ b/src/common/network/rest/http/ServerConnectionManager.h @@ -59,7 +59,7 @@ namespace network class ServerConnectionManager { public: /// Initializes a new instance of the ServerConnectionManager class. - ServerConnectionManager() { /* stub */ } + ServerConnectionManager() = default; /// Initializes a copy instance of the ServerConnectionManager class. ServerConnectionManager(const ServerConnectionManager&) = delete; diff --git a/src/common/network/tcp/Socket.h b/src/common/network/tcp/Socket.h new file mode 100644 index 00000000..c1db2467 --- /dev/null +++ b/src/common/network/tcp/Socket.h @@ -0,0 +1,380 @@ +/** +* Digital Voice Modem - Common Library +* GPLv2 Open Source. Use is subject to license terms. +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* @package DVM / Common Library +* +*/ +/* +* Copyright (C) 2024 by Bryan Biedenkapp N2PLL +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program 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. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#if !defined(__SOCKET_H__) +#define __SOCKET_H__ + +#include "Defines.h" +#include "common/Log.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#if !defined(TCP_SOCKET_MAX) +#define TCP_SOCKET_MAX 1 +#endif + +namespace network +{ + namespace tcp + { + // --------------------------------------------------------------------------- + // Class Declaration + // Implements the core network socket. + // --------------------------------------------------------------------------- + + class HOST_SW_API Socket + { + public: + auto operator=(Socket&) -> Socket& = delete; + auto operator=(Socket&&) -> Socket& = delete; + Socket(Socket&) = delete; + + /// Initializes a new instance of the Socket class. + Socket() noexcept(false) : + m_fd(-1), + m_address(), + m_port(0U), + m_counter(0U) + { + /* stub */ + } + /// Initializes a new instance of the Socket class. + /// + Socket(const int fd) noexcept : + m_fd(fd), + m_address(), + m_port(0U), + m_counter(0U) + { + /* stub */ + } + /// Initializes a new instance of the Socket class. + /// + /// + /// + Socket(const int domain, const int type, const int protocol) noexcept(false) : Socket() + { + initSocket(domain, type, protocol); + } + /// Finalizes a instance of the Socket class. + virtual ~Socket() + { + static_cast(::shutdown(m_fd, SHUT_RDWR)); + static_cast(::close(m_fd)); + } + + /// + /// + /// + /// + /// + /// + void initSocket(const int domain, const int type, const int protocol) noexcept(false) + { + m_fd = ::socket(domain, type, protocol); + if (m_fd < 0) + throw std::runtime_error("Failed to create Socket"); + } + + /// + /// + /// + /// + /// + /// + int accept(sockaddr* address, socklen_t* addrlen) const noexcept + { + // check that the accept() won't block + int i, n; + struct pollfd pfd[TCP_SOCKET_MAX]; + for (i = n = 0; i < TCP_SOCKET_MAX; i++) { + if (m_fd >= 0) { + pfd[n].fd = m_fd; + pfd[n].events = POLLIN; + n++; + } + } + + // no socket descriptor to receive + if (n == 0) + return 0; + + // Return immediately + int ret = ::poll(pfd, n, 0); + if (ret < 0) { + LogError(LOG_NET, "Error returned from TCP poll, err: %d", errno); + return -1; + } + + int index; + for (i = 0; i < n; i++) { + // round robin + index = (i + m_counter) % n; + if (pfd[index].revents & POLLIN) + break; + } + if (i == n) + return -1; + + return ::accept(pfd[index].fd, address, addrlen); + } + + /// + /// + /// + /// + /// + /// + bool bind(const std::string& ipAddr, const uint16_t port) noexcept(false) + { + m_address = std::string(ipAddr); + m_port = port; + + sockaddr_in addr = {}; + initAddr(ipAddr, port, addr); + socklen_t length = sizeof(addr); + bool retval = true; + if (::bind(m_fd, reinterpret_cast(&addr), length) < 0) + retval = false; + + return retval; + } + + /// + /// + /// + /// + /// + /// + virtual bool connect(const std::string& ipAddr, const uint16_t port) noexcept(false) + { + sockaddr_in addr = {}; + initAddr(ipAddr, port, addr); + socklen_t length = sizeof(addr); + bool retval = true; + if (::connect(m_fd, reinterpret_cast(&addr), length) < 0) + retval = false; + return retval; + } + + /// + /// + /// + /// + /// + ssize_t listen(int backlog) const noexcept + { + LogInfoEx(LOG_NET, "Listening TCP port on %u", m_port); + return ::listen(m_fd, backlog); + } + + /// + /// Read data from the socket. + /// + /// Buffer to read data into. + /// Length of data to read. + /// + [[nodiscard]] ssize_t read(uint8_t* buffer, size_t length) const noexcept + { + // check that the read() won't block + int i, n; + struct pollfd pfd[TCP_SOCKET_MAX]; + for (i = n = 0; i < TCP_SOCKET_MAX; i++) { + if (m_fd >= 0) { + pfd[n].fd = m_fd; + pfd[n].events = POLLIN; + n++; + } + } + + // no socket descriptor to receive + if (n == 0) + return 0; + + // Return immediately + int ret = ::poll(pfd, n, 0); + if (ret < 0) { + LogError(LOG_NET, "Error returned from TCP poll, err: %d", errno); + return -1; + } + + int index; + for (i = 0; i < n; i++) { + // round robin + index = (i + m_counter) % n; + if (pfd[index].revents & POLLIN) + break; + } + if (i == n) + return 0; + + return ::read(pfd[index].fd, (char*)buffer, length); + } + + /// + /// Write data to the socket. + /// + /// Buffer containing data to write to socket. + /// Length of data to write. + /// + ssize_t write(const uint8_t* buffer, size_t length) const noexcept + { + return ::send(m_fd, buffer, length, 0); + } + + /// + static uint32_t addr(const sockaddr_storage& addr) + { + switch (addr.ss_family) { + case AF_INET: + { + struct sockaddr_in* in; + in = (struct sockaddr_in*)& addr; + return in->sin_addr.s_addr; + } + break; + case AF_INET6: + default: + return -1; + break; + } + } + /// + static std::string address(const sockaddr_storage& addr) + { + std::string address = std::string(); + char str[INET_ADDRSTRLEN]; + + switch (addr.ss_family) { + case AF_INET: + { + struct sockaddr_in* in; + in = (struct sockaddr_in*)& addr; + inet_ntop(AF_INET, &(in->sin_addr), str, INET_ADDRSTRLEN); + address = std::string(str); + } + break; + case AF_INET6: + { + struct sockaddr_in6* in6; + in6 = (struct sockaddr_in6*)& addr; + inet_ntop(AF_INET6, &(in6->sin6_addr), str, INET_ADDRSTRLEN); + address = std::string(str); + } + break; + default: + break; + } + + return address; + } + /// + static uint16_t port(const sockaddr_storage& addr) + { + uint16_t port = 0U; + + switch (addr.ss_family) { + case AF_INET: + { + struct sockaddr_in* in; + in = (struct sockaddr_in*)& addr; + port = ntohs(in->sin_port); + } + break; + case AF_INET6: + { + struct sockaddr_in6* in6; + in6 = (struct sockaddr_in6*)& addr; + port = ntohs(in6->sin6_port); + } + break; + default: + break; + } + + return port; + } + + /// + static bool isNone(const sockaddr_storage& addr) + { + struct sockaddr_in* in = (struct sockaddr_in*)& addr; + + return ((addr.ss_family == AF_INET) && (in->sin_addr.s_addr == htonl(INADDR_NONE))); + } + + protected: + int m_fd; + std::string m_address; + uint16_t m_port; + + uint32_t m_counter; + + /// + /// Helper to lookup a hostname and resolve it to an IP address. + /// + /// String containing hostname to resolve. + /// + [[nodiscard]] static std::string getIpAddress(const in_addr inaddr) noexcept(false) + { + char* receivedAddr = ::inet_ntoa(inaddr); + if (receivedAddr == reinterpret_cast(INADDR_NONE)) + throw std::runtime_error("Invalid IP address received on readfrom."); + + return { receivedAddr }; + } + + /// + /// Initialize the sockaddr_in structure with the provided IP and port + /// + /// IP address. + /// IP address. + /// + static void initAddr(const std::string& ipAddr, const int port, sockaddr_in& addr) noexcept(false) + { + addr.sin_family = AF_INET; + if (ipAddr.empty() || ipAddr == "0.0.0.0") + addr.sin_addr.s_addr = INADDR_ANY; + else + { + if (::inet_pton(AF_INET, ipAddr.c_str(), &addr.sin_addr) <= 0) + throw std::runtime_error("Failed to parse IP address"); + } + + addr.sin_port = ::htons(port); + } + }; + } // namespace tcp +} // namespace network + +#endif // __SOCKET_H__ diff --git a/src/common/network/tcp/TcpClient.h b/src/common/network/tcp/TcpClient.h new file mode 100644 index 00000000..6129952f --- /dev/null +++ b/src/common/network/tcp/TcpClient.h @@ -0,0 +1,107 @@ +/** +* Digital Voice Modem - Common Library +* GPLv2 Open Source. Use is subject to license terms. +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* @package DVM / Common Library +* +*/ +/* +* Copyright (C) 2024 by Bryan Biedenkapp N2PLL +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program 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. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#if !defined(__TCP_CLIENT_H__) +#define __TCP_CLIENT_H__ + +#include "Defines.h" +#include "common/network/tcp/Socket.h" +#include "common/Log.h" + +#include +#include + +namespace network +{ + namespace tcp + { + // --------------------------------------------------------------------------- + // Class Declaration + // Implements a TCP client. + // --------------------------------------------------------------------------- + + class HOST_SW_API TcpClient : public Socket + { + public: + auto operator=(TcpClient&) -> TcpClient& = delete; + auto operator=(TcpClient&&) -> TcpClient& = delete; + TcpClient(TcpClient&) = delete; + + /// Initializes a new instance of the TcpClient class. + TcpClient() noexcept(false) : Socket(AF_INET, SOCK_STREAM, 0) + { + init(); + } + /// Initializes a new instance of the TcpClient class. + /// + /// + /// + TcpClient(const int fd, sockaddr_in& client, int clientLen) noexcept(false) : Socket(fd), + m_sockaddr() + { + ::memcpy(reinterpret_cast(&m_sockaddr), reinterpret_cast(&client), clientLen); + } + /// Initializes a new instance of the TcpClient class. + /// + /// + TcpClient(const std::string& address, const uint16_t port) noexcept(false) : TcpClient() + { + assert(!address.empty()); + assert(port > 0U); + + sockaddr_in addr = {}; + initAddr(address, port, addr); + + ::memcpy(reinterpret_cast(&m_sockaddr), reinterpret_cast(&addr), sizeof(addr)); + + int ret = ::connect(m_fd, reinterpret_cast(&addr), sizeof(addr)); + if (ret < 0) { + LogError(LOG_NET, "Failed to connect to server, err: %d", errno); + } + } + + /// + /// + sockaddr_storage getAddress() const { return m_sockaddr; } + + protected: + sockaddr_storage m_sockaddr; + + /// + /// + /// + void init() noexcept(false) + { + int reuse = 1; + if (::setsockopt(m_fd, IPPROTO_TCP, TCP_NODELAY, (char*)& reuse, sizeof(reuse)) != 0) { + LogError(LOG_NET, "Cannot set the TCP socket option, err: %d", errno); + throw std::runtime_error("Cannot set the TCP socket option"); + } + } + }; + } // namespace tcp +} // namespace network + +#endif // __TCP_CLIENT_H__ diff --git a/src/common/network/tcp/TcpListener.h b/src/common/network/tcp/TcpListener.h new file mode 100644 index 00000000..86e51671 --- /dev/null +++ b/src/common/network/tcp/TcpListener.h @@ -0,0 +1,101 @@ +/** +* Digital Voice Modem - Common Library +* GPLv2 Open Source. Use is subject to license terms. +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* @package DVM / Common Library +* +*/ +/* +* Copyright (C) 2024 by Bryan Biedenkapp N2PLL +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program 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. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#if !defined(__TCP_LISTENER_H__) +#define __TCP_LISTENER_H__ + +#include "Defines.h" +#include "common/network/tcp/Socket.h" +#include "common/network/tcp/TcpClient.h" +#include "common/Log.h" + +namespace network +{ + namespace tcp + { + // --------------------------------------------------------------------------- + // Class Declaration + // Implements a TCP server listener. + // --------------------------------------------------------------------------- + + class HOST_SW_API TcpListener : public Socket + { + public: + + auto operator=(TcpListener&) -> TcpListener& = delete; + auto operator=(TcpListener&&) -> TcpListener& = delete; + TcpListener(TcpListener&) = delete; + + /// Initializes a new instance of the TcpListener class. + TcpListener() noexcept(false) : Socket(AF_INET, SOCK_STREAM, 0) + { + int reuse = 1; + if (::setsockopt(m_fd, SOL_SOCKET, SO_REUSEADDR | SO_REUSEPORT, (char*)& reuse, sizeof(reuse)) != 0) { + LogError(LOG_NET, "Cannot set the TCP socket option, err: %d", errno); + throw std::runtime_error("Cannot set the TCP socket option"); + } + } + /// Initializes a new instance of the TcpListener class. + /// + /// + explicit TcpListener(const uint16_t port, const std::string& ipAddr = "0.0.0.0") noexcept(false) : TcpListener() + { + if (!bind(ipAddr, port)) { + LogError(LOG_NET, "Cannot to bind TCP server, err: %d", errno); + throw std::runtime_error("Cannot to bind TCP server"); + } + } + /// Initializes a new instance of the TcpListener class. + /// + /// + /// + TcpListener(const std::string& ipAddr, const uint16_t port, const int backlog) noexcept(false) : TcpListener(port, ipAddr) + { + if (listen(backlog) < 0) { + LogError(LOG_NET, "Failed to listen on TCP server, err: %d", errno); + throw std::runtime_error("Failed to listen on TCP server."); + } + } + + /// + /// Accept a new TCP connection either secure or unsecure. + /// + /// Newly accepted TCP connection + [[nodiscard]] TcpClient* accept() noexcept(false) + { + sockaddr_in client = {}; + socklen_t clientLen = sizeof(client); + int fd = Socket::accept(reinterpret_cast(&client), &clientLen); + if (fd < 0) { + return nullptr; + } + + return new TcpClient(fd, client, clientLen); + } + }; + } // namespace tcp +} // namespace network + +#endif // __TCP_LISTENER_H__ diff --git a/src/common/nxdn/NXDNUtils.cpp b/src/common/nxdn/NXDNUtils.cpp index 693aba7e..cee78494 100644 --- a/src/common/nxdn/NXDNUtils.cpp +++ b/src/common/nxdn/NXDNUtils.cpp @@ -34,7 +34,6 @@ using namespace nxdn; -#include #include // --------------------------------------------------------------------------- diff --git a/src/common/nxdn/acl/AccessControl.cpp b/src/common/nxdn/acl/AccessControl.cpp index 20cd08f3..7931d4ec 100644 --- a/src/common/nxdn/acl/AccessControl.cpp +++ b/src/common/nxdn/acl/AccessControl.cpp @@ -30,14 +30,9 @@ */ #include "Defines.h" #include "nxdn/acl/AccessControl.h" -#include "Log.h" using namespace nxdn::acl; -#include -#include -#include - // --------------------------------------------------------------------------- // Static Class Members // --------------------------------------------------------------------------- @@ -64,7 +59,7 @@ void AccessControl::init(RadioIdLookup* ridLookup, TalkgroupRulesLookup* tidLook bool AccessControl::validateSrcId(uint32_t id) { // check if RID ACLs are enabled - if (m_ridLookup->getACL() == false) { + if (!m_ridLookup->getACL()) { RadioId rid = m_ridLookup->find(id); if (!rid.radioDefault() && !rid.radioEnabled()) { return false; @@ -94,7 +89,7 @@ bool AccessControl::validateTGId(uint32_t id) return false; // check if TID ACLs are enabled - if (m_tidLookup->getACL() == false) { + if (!m_tidLookup->getACL()) { return true; } diff --git a/src/common/nxdn/channel/CAC.cpp b/src/common/nxdn/channel/CAC.cpp index e8d8f179..18f850fe 100644 --- a/src/common/nxdn/channel/CAC.cpp +++ b/src/common/nxdn/channel/CAC.cpp @@ -37,7 +37,6 @@ using namespace nxdn; using namespace nxdn::channel; -#include #include #include diff --git a/src/common/nxdn/channel/FACCH1.cpp b/src/common/nxdn/channel/FACCH1.cpp index 80dae3fc..d71f8b5f 100644 --- a/src/common/nxdn/channel/FACCH1.cpp +++ b/src/common/nxdn/channel/FACCH1.cpp @@ -37,7 +37,6 @@ using namespace nxdn; using namespace nxdn::channel; -#include #include #include diff --git a/src/common/nxdn/channel/LICH.cpp b/src/common/nxdn/channel/LICH.cpp index 9fbe5d75..7a85ec49 100644 --- a/src/common/nxdn/channel/LICH.cpp +++ b/src/common/nxdn/channel/LICH.cpp @@ -36,7 +36,6 @@ using namespace nxdn; using namespace nxdn::channel; -#include #include #include @@ -143,16 +142,16 @@ void LICH::encode(uint8_t* data) m_lich = 0U; - m_lich &= 0x3FU; + m_lich &= 0x3FU; m_lich |= (m_rfct & 0x03U) << 6; - m_lich &= 0xCFU; + m_lich &= 0xCFU; m_lich |= (m_fct & 0x03U) << 4; - m_lich &= 0xF3U; + m_lich &= 0xF3U; m_lich |= (m_option & 0x03U) << 2; - m_lich &= 0xFDU; + m_lich &= 0xFDU; m_lich |= (m_outbound ? 0x01U : 0x00U) << 1; #if DEBUG_NXDN_LICH diff --git a/src/common/nxdn/channel/SACCH.cpp b/src/common/nxdn/channel/SACCH.cpp index 4783b29f..89bcbef9 100644 --- a/src/common/nxdn/channel/SACCH.cpp +++ b/src/common/nxdn/channel/SACCH.cpp @@ -38,7 +38,6 @@ using namespace nxdn; using namespace nxdn::channel; -#include #include #include diff --git a/src/common/nxdn/channel/UDCH.cpp b/src/common/nxdn/channel/UDCH.cpp index 88fa4c3d..74cf32ce 100644 --- a/src/common/nxdn/channel/UDCH.cpp +++ b/src/common/nxdn/channel/UDCH.cpp @@ -38,7 +38,6 @@ using namespace nxdn; using namespace nxdn::channel; -#include #include #include diff --git a/src/common/nxdn/edac/Convolution.cpp b/src/common/nxdn/edac/Convolution.cpp index 4a87251c..12f520ef 100644 --- a/src/common/nxdn/edac/Convolution.cpp +++ b/src/common/nxdn/edac/Convolution.cpp @@ -29,12 +29,10 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "nxdn/edac/Convolution.h" -#include "Log.h" #include "Utils.h" using namespace nxdn::edac; -#include #include #include #include diff --git a/src/common/nxdn/lc/PacketInformation.cpp b/src/common/nxdn/lc/PacketInformation.cpp index c22c194b..60e8cb44 100644 --- a/src/common/nxdn/lc/PacketInformation.cpp +++ b/src/common/nxdn/lc/PacketInformation.cpp @@ -27,12 +27,10 @@ #include "nxdn/NXDNDefines.h" #include "nxdn/lc/PacketInformation.h" #include "Log.h" -#include "Utils.h" using namespace nxdn::lc; using namespace nxdn; -#include #include #include @@ -61,10 +59,7 @@ PacketInformation::PacketInformation() : /// /// Finalizes a instance of the PacketInformation class. /// -PacketInformation::~PacketInformation() -{ - /* stub */ -} +PacketInformation::~PacketInformation() = default; /// /// Decodes packet information. diff --git a/src/common/nxdn/lc/RCCH.cpp b/src/common/nxdn/lc/RCCH.cpp index 501c1439..08dacec2 100644 --- a/src/common/nxdn/lc/RCCH.cpp +++ b/src/common/nxdn/lc/RCCH.cpp @@ -29,13 +29,11 @@ */ #include "nxdn/NXDNDefines.h" #include "nxdn/lc/RCCH.h" -#include "Log.h" #include "Utils.h" using namespace nxdn; using namespace nxdn::lc; -#include #include #include diff --git a/src/common/nxdn/lc/RTCH.cpp b/src/common/nxdn/lc/RTCH.cpp index b3d64700..407af757 100644 --- a/src/common/nxdn/lc/RTCH.cpp +++ b/src/common/nxdn/lc/RTCH.cpp @@ -36,7 +36,6 @@ using namespace nxdn; using namespace nxdn::lc; -#include #include #include diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DCALL_HDR.cpp b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DCALL_HDR.cpp index 2552e885..9b42f8d4 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DCALL_HDR.cpp +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DCALL_HDR.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "nxdn/lc/rcch/MESSAGE_TYPE_DCALL_HDR.h" -#include "Log.h" -#include "Utils.h" using namespace nxdn::lc::rcch; using namespace nxdn::lc; using namespace nxdn; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ MESSAGE_TYPE_DCALL_HDR::MESSAGE_TYPE_DCALL_HDR() : RCCH() /// void MESSAGE_TYPE_DCALL_HDR::decode(const uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); @@ -79,7 +76,7 @@ void MESSAGE_TYPE_DCALL_HDR::decode(const uint8_t* data, uint32_t length, uint32 /// void MESSAGE_TYPE_DCALL_HDR::encode(uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DCALL_HDR.h b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DCALL_HDR.h index f027ec92..bcd2ad84 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DCALL_HDR.h +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DCALL_HDR.h @@ -51,7 +51,7 @@ namespace nxdn void encode(uint8_t* data, uint32_t length, uint32_t offset = 0U) override; /// Returns a string that represents the current RCCH. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace rcch } // namespace lc diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DST_ID_INFO.cpp b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DST_ID_INFO.cpp index 3b6cd172..6c5f9bf4 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DST_ID_INFO.cpp +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DST_ID_INFO.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "nxdn/lc/rcch/MESSAGE_TYPE_DST_ID_INFO.h" -#include "Log.h" -#include "Utils.h" using namespace nxdn::lc::rcch; using namespace nxdn::lc; using namespace nxdn; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ MESSAGE_TYPE_DST_ID_INFO::MESSAGE_TYPE_DST_ID_INFO() : RCCH() /// void MESSAGE_TYPE_DST_ID_INFO::decode(const uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); @@ -71,7 +68,7 @@ void MESSAGE_TYPE_DST_ID_INFO::decode(const uint8_t* data, uint32_t length, uint /// void MESSAGE_TYPE_DST_ID_INFO::encode(uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DST_ID_INFO.h b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DST_ID_INFO.h index 6a12b3f0..5e8f9434 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DST_ID_INFO.h +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_DST_ID_INFO.h @@ -51,7 +51,7 @@ namespace nxdn void encode(uint8_t* data, uint32_t length, uint32_t offset = 0U) override; /// Returns a string that represents the current RCCH. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace rcch } // namespace lc diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_GRP_REG.cpp b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_GRP_REG.cpp index 4181d386..1b68e77c 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_GRP_REG.cpp +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_GRP_REG.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "nxdn/lc/rcch/MESSAGE_TYPE_GRP_REG.h" -#include "Log.h" -#include "Utils.h" using namespace nxdn::lc::rcch; using namespace nxdn::lc; using namespace nxdn; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ MESSAGE_TYPE_GRP_REG::MESSAGE_TYPE_GRP_REG() : RCCH() /// void MESSAGE_TYPE_GRP_REG::decode(const uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); @@ -75,7 +72,7 @@ void MESSAGE_TYPE_GRP_REG::decode(const uint8_t* data, uint32_t length, uint32_t /// void MESSAGE_TYPE_GRP_REG::encode(uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_GRP_REG.h b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_GRP_REG.h index 748c3c0d..7c2c84be 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_GRP_REG.h +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_GRP_REG.h @@ -52,7 +52,7 @@ namespace nxdn void encode(uint8_t* data, uint32_t length, uint32_t offset = 0U) override; /// Returns a string that represents the current RCCH. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace rcch } // namespace lc diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_IDLE.cpp b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_IDLE.cpp index 36fefc6d..08e285a7 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_IDLE.cpp +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_IDLE.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "nxdn/lc/rcch/MESSAGE_TYPE_IDLE.h" -#include "Log.h" -#include "Utils.h" using namespace nxdn::lc::rcch; using namespace nxdn::lc; using namespace nxdn; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ MESSAGE_TYPE_IDLE::MESSAGE_TYPE_IDLE() : RCCH() /// void MESSAGE_TYPE_IDLE::decode(const uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); @@ -71,7 +68,7 @@ void MESSAGE_TYPE_IDLE::decode(const uint8_t* data, uint32_t length, uint32_t of /// void MESSAGE_TYPE_IDLE::encode(uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_IDLE.h b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_IDLE.h index a1cf1773..ea6dd2e7 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_IDLE.h +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_IDLE.h @@ -51,7 +51,7 @@ namespace nxdn void encode(uint8_t* data, uint32_t length, uint32_t offset = 0U) override; /// Returns a string that represents the current RCCH. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace rcch } // namespace lc diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG.cpp b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG.cpp index f246a89c..f63a8491 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG.cpp +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "nxdn/lc/rcch/MESSAGE_TYPE_REG.h" -#include "Log.h" -#include "Utils.h" using namespace nxdn::lc::rcch; using namespace nxdn::lc; using namespace nxdn; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ MESSAGE_TYPE_REG::MESSAGE_TYPE_REG() : RCCH() /// void MESSAGE_TYPE_REG::decode(const uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); @@ -78,7 +75,7 @@ void MESSAGE_TYPE_REG::decode(const uint8_t* data, uint32_t length, uint32_t off /// void MESSAGE_TYPE_REG::encode(uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG.h b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG.h index 5b896fd8..4eccf3ce 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG.h +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG.h @@ -52,7 +52,7 @@ namespace nxdn void encode(uint8_t* data, uint32_t length, uint32_t offset = 0U) override; /// Returns a string that represents the current RCCH. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace rcch } // namespace lc diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_C.cpp b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_C.cpp index a336ce51..8d6aa730 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_C.cpp +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_C.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "nxdn/lc/rcch/MESSAGE_TYPE_REG_C.h" -#include "Log.h" -#include "Utils.h" using namespace nxdn::lc::rcch; using namespace nxdn::lc; using namespace nxdn; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ MESSAGE_TYPE_REG_C::MESSAGE_TYPE_REG_C() : RCCH() /// void MESSAGE_TYPE_REG_C::decode(const uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); @@ -75,7 +72,7 @@ void MESSAGE_TYPE_REG_C::decode(const uint8_t* data, uint32_t length, uint32_t o /// void MESSAGE_TYPE_REG_C::encode(uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_C.h b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_C.h index 9285afd0..ed0a1777 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_C.h +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_C.h @@ -52,7 +52,7 @@ namespace nxdn void encode(uint8_t* data, uint32_t length, uint32_t offset = 0U) override; /// Returns a string that represents the current RCCH. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace rcch } // namespace lc diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_COMM.cpp b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_COMM.cpp index 3c215bf2..ec30f273 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_COMM.cpp +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_COMM.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "nxdn/lc/rcch/MESSAGE_TYPE_REG_COMM.h" -#include "Log.h" -#include "Utils.h" using namespace nxdn::lc::rcch; using namespace nxdn::lc; using namespace nxdn; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ MESSAGE_TYPE_REG_COMM::MESSAGE_TYPE_REG_COMM() : RCCH() /// void MESSAGE_TYPE_REG_COMM::decode(const uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); @@ -71,7 +68,7 @@ void MESSAGE_TYPE_REG_COMM::decode(const uint8_t* data, uint32_t length, uint32_ /// void MESSAGE_TYPE_REG_COMM::encode(uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_COMM.h b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_COMM.h index 6d93c6df..5f7a3c9b 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_COMM.h +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_REG_COMM.h @@ -51,7 +51,7 @@ namespace nxdn void encode(uint8_t* data, uint32_t length, uint32_t offset = 0U) override; /// Returns a string that represents the current RCCH. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace rcch } // namespace lc diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SITE_INFO.cpp b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SITE_INFO.cpp index 9c90aba7..5a83f9e7 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SITE_INFO.cpp +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SITE_INFO.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "nxdn/lc/rcch/MESSAGE_TYPE_SITE_INFO.h" -#include "Log.h" -#include "Utils.h" using namespace nxdn::lc::rcch; using namespace nxdn::lc; using namespace nxdn; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -60,7 +57,7 @@ MESSAGE_TYPE_SITE_INFO::MESSAGE_TYPE_SITE_INFO() : RCCH(), /// void MESSAGE_TYPE_SITE_INFO::decode(const uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); @@ -76,7 +73,7 @@ void MESSAGE_TYPE_SITE_INFO::decode(const uint8_t* data, uint32_t length, uint32 /// void MESSAGE_TYPE_SITE_INFO::encode(uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SITE_INFO.h b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SITE_INFO.h index 9fbaff97..a0797b68 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SITE_INFO.h +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SITE_INFO.h @@ -51,7 +51,7 @@ namespace nxdn void encode(uint8_t* data, uint32_t length, uint32_t offset = 0U) override; /// Returns a string that represents the current RCCH. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /** Channel Structure Data */ diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SRV_INFO.cpp b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SRV_INFO.cpp index ddbd99d9..016e75c2 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SRV_INFO.cpp +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SRV_INFO.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "nxdn/lc/rcch/MESSAGE_TYPE_SRV_INFO.h" -#include "Log.h" -#include "Utils.h" using namespace nxdn::lc::rcch; using namespace nxdn::lc; using namespace nxdn; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ MESSAGE_TYPE_SRV_INFO::MESSAGE_TYPE_SRV_INFO() : RCCH() /// void MESSAGE_TYPE_SRV_INFO::decode(const uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); @@ -71,7 +68,7 @@ void MESSAGE_TYPE_SRV_INFO::decode(const uint8_t* data, uint32_t length, uint32_ /// void MESSAGE_TYPE_SRV_INFO::encode(uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SRV_INFO.h b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SRV_INFO.h index a970417c..877ff95a 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SRV_INFO.h +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_SRV_INFO.h @@ -51,7 +51,7 @@ namespace nxdn void encode(uint8_t* data, uint32_t length, uint32_t offset = 0U) override; /// Returns a string that represents the current RCCH. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace rcch } // namespace lc diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.cpp b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.cpp index 872b379c..aac8934a 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.cpp +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.h" -#include "Log.h" -#include "Utils.h" using namespace nxdn::lc::rcch; using namespace nxdn::lc; using namespace nxdn; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ MESSAGE_TYPE_VCALL_ASSGN::MESSAGE_TYPE_VCALL_ASSGN() : RCCH() /// void MESSAGE_TYPE_VCALL_ASSGN::decode(const uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); @@ -71,7 +68,7 @@ void MESSAGE_TYPE_VCALL_ASSGN::decode(const uint8_t* data, uint32_t length, uint /// void MESSAGE_TYPE_VCALL_ASSGN::encode(uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.h b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.h index 446dfe15..7401b5bb 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.h +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_ASSGN.h @@ -51,7 +51,7 @@ namespace nxdn void encode(uint8_t* data, uint32_t length, uint32_t offset = 0U) override; /// Returns a string that represents the current RCCH. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace rcch } // namespace lc diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_CONN.cpp b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_CONN.cpp index 72dfdcd0..1170382d 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_CONN.cpp +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_CONN.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "nxdn/lc/rcch/MESSAGE_TYPE_VCALL_CONN.h" -#include "Log.h" -#include "Utils.h" using namespace nxdn::lc::rcch; using namespace nxdn::lc; using namespace nxdn; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ MESSAGE_TYPE_VCALL_CONN::MESSAGE_TYPE_VCALL_CONN() : RCCH() /// void MESSAGE_TYPE_VCALL_CONN::decode(const uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); @@ -79,7 +76,7 @@ void MESSAGE_TYPE_VCALL_CONN::decode(const uint8_t* data, uint32_t length, uint3 /// void MESSAGE_TYPE_VCALL_CONN::encode(uint8_t* data, uint32_t length, uint32_t offset) { - assert(data != NULL); + assert(data != nullptr); uint8_t rcch[NXDN_RCCH_LC_LENGTH_BYTES + 4U]; ::memset(rcch, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES + 4U); diff --git a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_CONN.h b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_CONN.h index a1887588..fb58f1b3 100644 --- a/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_CONN.h +++ b/src/common/nxdn/lc/rcch/MESSAGE_TYPE_VCALL_CONN.h @@ -52,7 +52,7 @@ namespace nxdn void encode(uint8_t* data, uint32_t length, uint32_t offset = 0U) override; /// Returns a string that represents the current RCCH. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace rcch } // namespace lc diff --git a/src/common/nxdn/lc/rcch/RCCHFactory.cpp b/src/common/nxdn/lc/rcch/RCCHFactory.cpp index c52e43ae..bf7762dd 100644 --- a/src/common/nxdn/lc/rcch/RCCHFactory.cpp +++ b/src/common/nxdn/lc/rcch/RCCHFactory.cpp @@ -41,18 +41,12 @@ using namespace nxdn; /// /// Initializes a new instance of the RCCHFactory class. /// -RCCHFactory::RCCHFactory() -{ - /* stub */ -} +RCCHFactory::RCCHFactory() = default; /// /// Finalizes a instance of RCCHFactory class. /// -RCCHFactory::~RCCHFactory() -{ - /* stub */ -} +RCCHFactory::~RCCHFactory() = default; /// /// Create an instance of a RCCH. diff --git a/src/common/p25/Audio.cpp b/src/common/p25/Audio.cpp index cdca748b..83d7218c 100644 --- a/src/common/p25/Audio.cpp +++ b/src/common/p25/Audio.cpp @@ -36,7 +36,6 @@ using namespace p25; -#include #include // --------------------------------------------------------------------------- @@ -55,10 +54,7 @@ Audio::Audio() : /// /// Finalizes a instance of the Audio class. /// -Audio::~Audio() -{ - /* stub */ -} +Audio::~Audio() = default; /// /// Process P25 IMBE audio data. diff --git a/src/common/p25/NID.cpp b/src/common/p25/NID.cpp index 48da1c89..cd61a05b 100644 --- a/src/common/p25/NID.cpp +++ b/src/common/p25/NID.cpp @@ -36,7 +36,6 @@ using namespace p25; -#include #include // --------------------------------------------------------------------------- diff --git a/src/common/p25/P25Utils.cpp b/src/common/p25/P25Utils.cpp index bbd6aa11..b7eecfad 100644 --- a/src/common/p25/P25Utils.cpp +++ b/src/common/p25/P25Utils.cpp @@ -34,7 +34,6 @@ using namespace p25; -#include #include // --------------------------------------------------------------------------- diff --git a/src/common/p25/Sync.cpp b/src/common/p25/Sync.cpp index 4c85570d..b1109ff2 100644 --- a/src/common/p25/Sync.cpp +++ b/src/common/p25/Sync.cpp @@ -33,7 +33,6 @@ using namespace p25; -#include #include #include diff --git a/src/common/p25/acl/AccessControl.cpp b/src/common/p25/acl/AccessControl.cpp index 4a44ea4c..251ba337 100644 --- a/src/common/p25/acl/AccessControl.cpp +++ b/src/common/p25/acl/AccessControl.cpp @@ -30,14 +30,9 @@ */ #include "Defines.h" #include "p25/acl/AccessControl.h" -#include "Log.h" using namespace p25::acl; -#include -#include -#include - // --------------------------------------------------------------------------- // Static Class Members // --------------------------------------------------------------------------- @@ -64,7 +59,7 @@ void AccessControl::init(RadioIdLookup* ridLookup, TalkgroupRulesLookup* tidLook bool AccessControl::validateSrcId(uint32_t id) { // check if RID ACLs are enabled - if (m_ridLookup->getACL() == false) { + if (!m_ridLookup->getACL()) { RadioId rid = m_ridLookup->find(id); if (!rid.radioDefault() && !rid.radioEnabled()) { return false; @@ -94,7 +89,7 @@ bool AccessControl::validateTGId(uint32_t id) return false; // check if TID ACLs are enabled - if (m_tidLookup->getACL() == false) { + if (!m_tidLookup->getACL()) { return true; } diff --git a/src/common/p25/data/DataBlock.cpp b/src/common/p25/data/DataBlock.cpp index 04549d21..be0c535b 100644 --- a/src/common/p25/data/DataBlock.cpp +++ b/src/common/p25/data/DataBlock.cpp @@ -33,7 +33,6 @@ using namespace p25::data; using namespace p25; -#include #include #include diff --git a/src/common/p25/data/DataHeader.cpp b/src/common/p25/data/DataHeader.cpp index cb660010..57aab905 100644 --- a/src/common/p25/data/DataHeader.cpp +++ b/src/common/p25/data/DataHeader.cpp @@ -33,7 +33,6 @@ using namespace p25::data; using namespace p25; -#include #include #include diff --git a/src/common/p25/data/LowSpeedData.cpp b/src/common/p25/data/LowSpeedData.cpp index ce29f775..bd7d4561 100644 --- a/src/common/p25/data/LowSpeedData.cpp +++ b/src/common/p25/data/LowSpeedData.cpp @@ -35,7 +35,6 @@ using namespace p25::data; using namespace p25; -#include #include // --------------------------------------------------------------------------- @@ -79,10 +78,7 @@ LowSpeedData::LowSpeedData() : /// /// Finalizes a new instance of the LowSpeedData class. /// -LowSpeedData::~LowSpeedData() -{ - /* stub */ -} +LowSpeedData::~LowSpeedData() = default; /// /// Equals operator. diff --git a/src/common/p25/dfsi/LC.cpp b/src/common/p25/dfsi/LC.cpp index e68960d2..5cbf57fb 100644 --- a/src/common/p25/dfsi/LC.cpp +++ b/src/common/p25/dfsi/LC.cpp @@ -27,15 +27,12 @@ #include "p25/P25Defines.h" #include "p25/dfsi/DFSIDefines.h" #include "p25/dfsi/LC.h" -#include "p25/lc/tsbk/TSBKFactory.h" -#include "p25/P25Utils.h" #include "Log.h" #include "Utils.h" using namespace p25::dfsi; using namespace p25; -#include #include #include diff --git a/src/common/p25/lc/TDULC.cpp b/src/common/p25/lc/TDULC.cpp index e59192c1..bca0e6ae 100644 --- a/src/common/p25/lc/TDULC.cpp +++ b/src/common/p25/lc/TDULC.cpp @@ -27,7 +27,6 @@ #include "p25/P25Defines.h" #include "p25/lc/TDULC.h" #include "p25/P25Utils.h" -#include "edac/CRC.h" #include "edac/Golay24128.h" #include "Log.h" #include "Utils.h" @@ -35,8 +34,6 @@ using namespace p25::lc; using namespace p25; -#include -#include #include #include diff --git a/src/common/p25/lc/tdulc/LC_ADJ_STS_BCAST.cpp b/src/common/p25/lc/tdulc/LC_ADJ_STS_BCAST.cpp index 128fe7a7..e6968830 100644 --- a/src/common/p25/lc/tdulc/LC_ADJ_STS_BCAST.cpp +++ b/src/common/p25/lc/tdulc/LC_ADJ_STS_BCAST.cpp @@ -26,14 +26,12 @@ #include "Defines.h" #include "p25/lc/tdulc/LC_ADJ_STS_BCAST.h" #include "Log.h" -#include "Utils.h" using namespace p25::lc::tdulc; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -44,6 +42,7 @@ using namespace p25; /// LC_ADJ_STS_BCAST::LC_ADJ_STS_BCAST() : TDULC(), m_adjCFVA(P25_CFVA_FAILURE), + m_adjSysId(0U), m_adjRfssId(0U), m_adjSiteId(0U), m_adjChannelId(0U), @@ -60,7 +59,7 @@ LC_ADJ_STS_BCAST::LC_ADJ_STS_BCAST() : TDULC(), /// True, if TDULC was decoded, otherwise false. bool LC_ADJ_STS_BCAST::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -73,7 +72,7 @@ bool LC_ADJ_STS_BCAST::decode(const uint8_t* data) /// void LC_ADJ_STS_BCAST::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t rsValue = 0U; @@ -93,9 +92,9 @@ void LC_ADJ_STS_BCAST::encode(uint8_t* data) rsValue = (rsValue << 8) + m_adjServiceClass; // System Service Class } else { - LogError(LOG_P25, "TDULC::encodeLC(), invalid values for LC_ADJ_STS_BCAST, tsbkAdjSiteRFSSId = $%02X, tsbkAdjSiteId = $%02X, tsbkAdjSiteChannel = $%02X", + LogError(LOG_P25, "LC_ADJ_STS_BCAST::encodeLC(), invalid values for LC_ADJ_STS_BCAST, tsbkAdjSiteRFSSId = $%02X, tsbkAdjSiteId = $%02X, tsbkAdjSiteChannel = $%02X", m_adjRfssId, m_adjSiteId, m_adjChannelNo); - return; // blatently ignore creating this TSBK + return; // blatantly ignore creating this TSBK } std::unique_ptr rs = TDULC::fromValue(rsValue); @@ -115,6 +114,7 @@ void LC_ADJ_STS_BCAST::copy(const LC_ADJ_STS_BCAST& data) TDULC::copy(data); m_adjCFVA = data.m_adjCFVA; + m_adjSysId = data.m_adjSysId; m_adjRfssId = data.m_adjRfssId; m_adjSiteId = data.m_adjSiteId; m_adjChannelId = data.m_adjChannelId; diff --git a/src/common/p25/lc/tdulc/LC_CALL_TERM.cpp b/src/common/p25/lc/tdulc/LC_CALL_TERM.cpp index 19a61e54..7f4cc4db 100644 --- a/src/common/p25/lc/tdulc/LC_CALL_TERM.cpp +++ b/src/common/p25/lc/tdulc/LC_CALL_TERM.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tdulc/LC_CALL_TERM.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tdulc; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ LC_CALL_TERM::LC_CALL_TERM() : TDULC() /// True, if TDULC was decoded, otherwise false. bool LC_CALL_TERM::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -67,7 +64,7 @@ bool LC_CALL_TERM::decode(const uint8_t* data) /// void LC_CALL_TERM::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t rsValue = 0U; diff --git a/src/common/p25/lc/tdulc/LC_CONV_FALLBACK.cpp b/src/common/p25/lc/tdulc/LC_CONV_FALLBACK.cpp index 1c78626b..fccd20e9 100644 --- a/src/common/p25/lc/tdulc/LC_CONV_FALLBACK.cpp +++ b/src/common/p25/lc/tdulc/LC_CONV_FALLBACK.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tdulc/LC_CONV_FALLBACK.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tdulc; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ LC_CONV_FALLBACK::LC_CONV_FALLBACK() : TDULC() /// True, if TDULC was decoded, otherwise false. bool LC_CONV_FALLBACK::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -67,7 +64,7 @@ bool LC_CONV_FALLBACK::decode(const uint8_t* data) /// void LC_CONV_FALLBACK::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t rsValue = 0U; diff --git a/src/common/p25/lc/tdulc/LC_FAILSOFT.cpp b/src/common/p25/lc/tdulc/LC_FAILSOFT.cpp index d5c48386..cc730ee7 100644 --- a/src/common/p25/lc/tdulc/LC_FAILSOFT.cpp +++ b/src/common/p25/lc/tdulc/LC_FAILSOFT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tdulc/LC_FAILSOFT.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tdulc; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ LC_FAILSOFT::LC_FAILSOFT() : TDULC() /// True, if TDULC was decoded, otherwise false. bool LC_FAILSOFT::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -68,7 +65,7 @@ bool LC_FAILSOFT::decode(const uint8_t* data) /// void LC_FAILSOFT::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t rsValue = 0U; diff --git a/src/common/p25/lc/tdulc/LC_GROUP.cpp b/src/common/p25/lc/tdulc/LC_GROUP.cpp index 07563389..a095ecaa 100644 --- a/src/common/p25/lc/tdulc/LC_GROUP.cpp +++ b/src/common/p25/lc/tdulc/LC_GROUP.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tdulc/LC_GROUP.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tdulc; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ LC_GROUP::LC_GROUP() : TDULC() /// True, if TDULC was decoded, otherwise false. bool LC_GROUP::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t rs[P25_TDULC_LENGTH_BYTES + 1U]; ::memset(rs, 0x00U, P25_TDULC_LENGTH_BYTES); @@ -82,7 +79,7 @@ bool LC_GROUP::decode(const uint8_t* data) /// void LC_GROUP::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t rsValue = 0U; diff --git a/src/common/p25/lc/tdulc/LC_GROUP_UPDT.cpp b/src/common/p25/lc/tdulc/LC_GROUP_UPDT.cpp index 04e17992..8e36772e 100644 --- a/src/common/p25/lc/tdulc/LC_GROUP_UPDT.cpp +++ b/src/common/p25/lc/tdulc/LC_GROUP_UPDT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tdulc/LC_GROUP_UPDT.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tdulc; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ LC_GROUP_UPDT::LC_GROUP_UPDT() : TDULC() /// True, if TDULC was decoded, otherwise false. bool LC_GROUP_UPDT::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -67,7 +64,7 @@ bool LC_GROUP_UPDT::decode(const uint8_t* data) /// void LC_GROUP_UPDT::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t rsValue = 0U; diff --git a/src/common/p25/lc/tdulc/LC_IDEN_UP.cpp b/src/common/p25/lc/tdulc/LC_IDEN_UP.cpp index 5f9dd4bf..ee5b59eb 100644 --- a/src/common/p25/lc/tdulc/LC_IDEN_UP.cpp +++ b/src/common/p25/lc/tdulc/LC_IDEN_UP.cpp @@ -26,7 +26,6 @@ #include "Defines.h" #include "p25/lc/tdulc/LC_IDEN_UP.h" #include "Log.h" -#include "Utils.h" using namespace p25::lc::tdulc; using namespace p25::lc; @@ -54,7 +53,7 @@ LC_IDEN_UP::LC_IDEN_UP() : TDULC() /// True, if TDULC was decoded, otherwise false. bool LC_IDEN_UP::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -67,7 +66,7 @@ bool LC_IDEN_UP::decode(const uint8_t* data) /// void LC_IDEN_UP::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t rsValue = 0U; @@ -110,7 +109,7 @@ void LC_IDEN_UP::encode(uint8_t* data) } } else { - LogError(LOG_P25, "TDULC::encodeLC(), invalid values for LC_IDEN_UP, baseFrequency = %uHz, txOffsetMhz = %fMHz, chBandwidthKhz = %fKHz, chSpaceKhz = %fKHz", + LogError(LOG_P25, "LC_IDEN_UP::encodeLC(), invalid values for LC_IDEN_UP, baseFrequency = %uHz, txOffsetMhz = %fMHz, chBandwidthKhz = %fKHz, chSpaceKhz = %fKHz", m_siteIdenEntry.baseFrequency(), m_siteIdenEntry.txOffsetMhz(), m_siteIdenEntry.chBandwidthKhz(), m_siteIdenEntry.chSpaceKhz()); return; // blatently ignore creating this TSBK diff --git a/src/common/p25/lc/tdulc/LC_NET_STS_BCAST.cpp b/src/common/p25/lc/tdulc/LC_NET_STS_BCAST.cpp index eb7ced72..97c788e8 100644 --- a/src/common/p25/lc/tdulc/LC_NET_STS_BCAST.cpp +++ b/src/common/p25/lc/tdulc/LC_NET_STS_BCAST.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tdulc/LC_NET_STS_BCAST.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tdulc; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ LC_NET_STS_BCAST::LC_NET_STS_BCAST() : TDULC() /// True, if TDULC was decoded, otherwise false. bool LC_NET_STS_BCAST::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -67,7 +64,7 @@ bool LC_NET_STS_BCAST::decode(const uint8_t* data) /// void LC_NET_STS_BCAST::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t rsValue = 0U; diff --git a/src/common/p25/lc/tdulc/LC_PRIVATE.cpp b/src/common/p25/lc/tdulc/LC_PRIVATE.cpp index 76d14324..8101f8da 100644 --- a/src/common/p25/lc/tdulc/LC_PRIVATE.cpp +++ b/src/common/p25/lc/tdulc/LC_PRIVATE.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tdulc/LC_PRIVATE.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tdulc; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ LC_PRIVATE::LC_PRIVATE() : TDULC() /// True, if TDULC was decoded, otherwise false. bool LC_PRIVATE::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t rs[P25_TDULC_LENGTH_BYTES + 1U]; ::memset(rs, 0x00U, P25_TDULC_LENGTH_BYTES); @@ -82,7 +79,7 @@ bool LC_PRIVATE::decode(const uint8_t* data) /// void LC_PRIVATE::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t rsValue = 0U; diff --git a/src/common/p25/lc/tdulc/LC_RFSS_STS_BCAST.cpp b/src/common/p25/lc/tdulc/LC_RFSS_STS_BCAST.cpp index 8da925de..3dfbc16e 100644 --- a/src/common/p25/lc/tdulc/LC_RFSS_STS_BCAST.cpp +++ b/src/common/p25/lc/tdulc/LC_RFSS_STS_BCAST.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tdulc/LC_RFSS_STS_BCAST.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tdulc; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ LC_RFSS_STS_BCAST::LC_RFSS_STS_BCAST() : TDULC() /// True, if TDULC was decoded, otherwise false. bool LC_RFSS_STS_BCAST::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -67,7 +64,7 @@ bool LC_RFSS_STS_BCAST::decode(const uint8_t* data) /// void LC_RFSS_STS_BCAST::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t rsValue = 0U; diff --git a/src/common/p25/lc/tdulc/LC_SYS_SRV_BCAST.cpp b/src/common/p25/lc/tdulc/LC_SYS_SRV_BCAST.cpp index 189bbc58..ba7a663d 100644 --- a/src/common/p25/lc/tdulc/LC_SYS_SRV_BCAST.cpp +++ b/src/common/p25/lc/tdulc/LC_SYS_SRV_BCAST.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tdulc/LC_SYS_SRV_BCAST.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tdulc; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ LC_SYS_SRV_BCAST::LC_SYS_SRV_BCAST() : TDULC() /// True, if TDULC was decoded, otherwise false. bool LC_SYS_SRV_BCAST::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -67,7 +64,7 @@ bool LC_SYS_SRV_BCAST::decode(const uint8_t* data) /// void LC_SYS_SRV_BCAST::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); const uint32_t services = (m_siteData.netActive()) ? P25_SYS_SRV_NET_ACTIVE : 0U | P25_SYS_SRV_DEFAULT; diff --git a/src/common/p25/lc/tdulc/LC_TEL_INT_VCH_USER.cpp b/src/common/p25/lc/tdulc/LC_TEL_INT_VCH_USER.cpp index c30e37a5..515259e3 100644 --- a/src/common/p25/lc/tdulc/LC_TEL_INT_VCH_USER.cpp +++ b/src/common/p25/lc/tdulc/LC_TEL_INT_VCH_USER.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tdulc/LC_TEL_INT_VCH_USER.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tdulc; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -54,7 +51,7 @@ LC_TEL_INT_VCH_USER::LC_TEL_INT_VCH_USER() : TDULC() /// True, if TDULC was decoded, otherwise false. bool LC_TEL_INT_VCH_USER::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); uint8_t rs[P25_TDULC_LENGTH_BYTES + 1U]; ::memset(rs, 0x00U, P25_TDULC_LENGTH_BYTES); @@ -82,7 +79,7 @@ bool LC_TEL_INT_VCH_USER::decode(const uint8_t* data) /// void LC_TEL_INT_VCH_USER::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t rsValue = 0U; diff --git a/src/common/p25/lc/tdulc/TDULCFactory.cpp b/src/common/p25/lc/tdulc/TDULCFactory.cpp index 54756c1a..71866aa8 100644 --- a/src/common/p25/lc/tdulc/TDULCFactory.cpp +++ b/src/common/p25/lc/tdulc/TDULCFactory.cpp @@ -48,18 +48,12 @@ using namespace p25; /// /// Initializes a new instance of the TDULCFactory class. /// -TDULCFactory::TDULCFactory() -{ - /* stub */ -} +TDULCFactory::TDULCFactory() = default; /// /// Finalizes a instance of TDULCFactory class. /// -TDULCFactory::~TDULCFactory() -{ - /* stub */ -} +TDULCFactory::~TDULCFactory() = default; /// /// Create an instance of a TDULC. diff --git a/src/common/p25/lc/tsbk/IOSP_ACK_RSP.cpp b/src/common/p25/lc/tsbk/IOSP_ACK_RSP.cpp index 284b56f4..5d56a4c3 100644 --- a/src/common/p25/lc/tsbk/IOSP_ACK_RSP.cpp +++ b/src/common/p25/lc/tsbk/IOSP_ACK_RSP.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/IOSP_ACK_RSP.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ IOSP_ACK_RSP::IOSP_ACK_RSP() : TSBK() /// True, if TSBK was decoded, otherwise false. bool IOSP_ACK_RSP::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -82,7 +79,7 @@ bool IOSP_ACK_RSP::decode(const uint8_t* data, bool rawTSBK) /// void IOSP_ACK_RSP::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -109,8 +106,6 @@ void IOSP_ACK_RSP::encode(uint8_t* data, bool rawTSBK, bool noTrellis) /// std::string IOSP_ACK_RSP::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_ACK_RSP (Acknowledge Response - Unit)"); - else - return std::string("TSBK_IOSP_ACK_RSP (Acknowledge Response - FNE)"); + if (isp) return std::string("TSBK_IOSP_ACK_RSP (Acknowledge Response - Unit)"); + else return std::string("TSBK_IOSP_ACK_RSP (Acknowledge Response - FNE)"); } diff --git a/src/common/p25/lc/tsbk/IOSP_ACK_RSP.h b/src/common/p25/lc/tsbk/IOSP_ACK_RSP.h index d2e568c6..82f34035 100644 --- a/src/common/p25/lc/tsbk/IOSP_ACK_RSP.h +++ b/src/common/p25/lc/tsbk/IOSP_ACK_RSP.h @@ -52,7 +52,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/IOSP_CALL_ALRT.cpp b/src/common/p25/lc/tsbk/IOSP_CALL_ALRT.cpp index 732f4b6f..3762feff 100644 --- a/src/common/p25/lc/tsbk/IOSP_CALL_ALRT.cpp +++ b/src/common/p25/lc/tsbk/IOSP_CALL_ALRT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/IOSP_CALL_ALRT.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ IOSP_CALL_ALRT::IOSP_CALL_ALRT() : TSBK() /// True, if TSBK was decoded, otherwise false. bool IOSP_CALL_ALRT::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -80,7 +77,7 @@ bool IOSP_CALL_ALRT::decode(const uint8_t* data, bool rawTSBK) /// void IOSP_CALL_ALRT::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -98,8 +95,6 @@ void IOSP_CALL_ALRT::encode(uint8_t* data, bool rawTSBK, bool noTrellis) /// std::string IOSP_CALL_ALRT::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_CALL_ALRT (Call Alert Request)"); - else - return std::string("TSBK_IOSP_CALL_ALRT (Call Alert)"); + if (isp) return std::string("TSBK_IOSP_CALL_ALRT (Call Alert Request)"); + else return std::string("TSBK_IOSP_CALL_ALRT (Call Alert)"); } diff --git a/src/common/p25/lc/tsbk/IOSP_CALL_ALRT.h b/src/common/p25/lc/tsbk/IOSP_CALL_ALRT.h index 890e919b..aab97784 100644 --- a/src/common/p25/lc/tsbk/IOSP_CALL_ALRT.h +++ b/src/common/p25/lc/tsbk/IOSP_CALL_ALRT.h @@ -52,7 +52,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/IOSP_EXT_FNCT.cpp b/src/common/p25/lc/tsbk/IOSP_EXT_FNCT.cpp index da715f99..a4a7854d 100644 --- a/src/common/p25/lc/tsbk/IOSP_EXT_FNCT.cpp +++ b/src/common/p25/lc/tsbk/IOSP_EXT_FNCT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/IOSP_EXT_FNCT.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -56,7 +53,7 @@ IOSP_EXT_FNCT::IOSP_EXT_FNCT() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool IOSP_EXT_FNCT::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -82,7 +79,7 @@ bool IOSP_EXT_FNCT::decode(const uint8_t* data, bool rawTSBK) /// void IOSP_EXT_FNCT::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -101,10 +98,8 @@ void IOSP_EXT_FNCT::encode(uint8_t* data, bool rawTSBK, bool noTrellis) /// std::string IOSP_EXT_FNCT::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_EXT_FNCT (Extended Function Response)"); - else - return std::string("TSBK_IOSP_EXT_FNCT (Extended Function Command)"); + if (isp) return std::string("TSBK_IOSP_EXT_FNCT (Extended Function Response)"); + else return std::string("TSBK_IOSP_EXT_FNCT (Extended Function Command)"); } // --------------------------------------------------------------------------- diff --git a/src/common/p25/lc/tsbk/IOSP_EXT_FNCT.h b/src/common/p25/lc/tsbk/IOSP_EXT_FNCT.h index ad7bcbbb..44c45867 100644 --- a/src/common/p25/lc/tsbk/IOSP_EXT_FNCT.h +++ b/src/common/p25/lc/tsbk/IOSP_EXT_FNCT.h @@ -52,7 +52,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Extended function opcode. diff --git a/src/common/p25/lc/tsbk/IOSP_GRP_AFF.cpp b/src/common/p25/lc/tsbk/IOSP_GRP_AFF.cpp index 16a7f2cb..4dda1f97 100644 --- a/src/common/p25/lc/tsbk/IOSP_GRP_AFF.cpp +++ b/src/common/p25/lc/tsbk/IOSP_GRP_AFF.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/IOSP_GRP_AFF.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -56,7 +53,7 @@ IOSP_GRP_AFF::IOSP_GRP_AFF() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool IOSP_GRP_AFF::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -82,7 +79,7 @@ bool IOSP_GRP_AFF::decode(const uint8_t* data, bool rawTSBK) /// void IOSP_GRP_AFF::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -103,10 +100,8 @@ void IOSP_GRP_AFF::encode(uint8_t* data, bool rawTSBK, bool noTrellis) /// std::string IOSP_GRP_AFF::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_GRP_AFF (Group Affiliation Request)"); - else - return std::string("TSBK_IOSP_GRP_AFF (Group Affiliation Response)"); + if (isp) return std::string("TSBK_IOSP_GRP_AFF (Group Affiliation Request)"); + else return std::string("TSBK_IOSP_GRP_AFF (Group Affiliation Response)"); } // --------------------------------------------------------------------------- diff --git a/src/common/p25/lc/tsbk/IOSP_GRP_AFF.h b/src/common/p25/lc/tsbk/IOSP_GRP_AFF.h index c79adad2..3978fb56 100644 --- a/src/common/p25/lc/tsbk/IOSP_GRP_AFF.h +++ b/src/common/p25/lc/tsbk/IOSP_GRP_AFF.h @@ -52,7 +52,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Announcement group. diff --git a/src/common/p25/lc/tsbk/IOSP_GRP_VCH.cpp b/src/common/p25/lc/tsbk/IOSP_GRP_VCH.cpp index b6949a93..4cb9c33b 100644 --- a/src/common/p25/lc/tsbk/IOSP_GRP_VCH.cpp +++ b/src/common/p25/lc/tsbk/IOSP_GRP_VCH.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/IOSP_GRP_VCH.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -56,7 +53,7 @@ IOSP_GRP_VCH::IOSP_GRP_VCH() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool IOSP_GRP_VCH::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -86,7 +83,7 @@ bool IOSP_GRP_VCH::decode(const uint8_t* data, bool rawTSBK) /// void IOSP_GRP_VCH::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -115,8 +112,6 @@ void IOSP_GRP_VCH::encode(uint8_t* data, bool rawTSBK, bool noTrellis) /// std::string IOSP_GRP_VCH::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_GRP_VCH (Group Voice Channel Request)"); - else - return std::string("TSBK_IOSP_GRP_VCH (Group Voice Channel Grant)"); + if (isp) return std::string("TSBK_IOSP_GRP_VCH (Group Voice Channel Request)"); + else return std::string("TSBK_IOSP_GRP_VCH (Group Voice Channel Grant)"); } diff --git a/src/common/p25/lc/tsbk/IOSP_GRP_VCH.h b/src/common/p25/lc/tsbk/IOSP_GRP_VCH.h index 106ad5e3..9b4bd5d2 100644 --- a/src/common/p25/lc/tsbk/IOSP_GRP_VCH.h +++ b/src/common/p25/lc/tsbk/IOSP_GRP_VCH.h @@ -52,7 +52,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Flag forcing the use of the group voice channel ID regardless of value. diff --git a/src/common/p25/lc/tsbk/IOSP_MSG_UPDT.cpp b/src/common/p25/lc/tsbk/IOSP_MSG_UPDT.cpp index 761b4476..ea2e6a5c 100644 --- a/src/common/p25/lc/tsbk/IOSP_MSG_UPDT.cpp +++ b/src/common/p25/lc/tsbk/IOSP_MSG_UPDT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/IOSP_MSG_UPDT.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -56,7 +53,7 @@ IOSP_MSG_UPDT::IOSP_MSG_UPDT() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool IOSP_MSG_UPDT::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -82,7 +79,7 @@ bool IOSP_MSG_UPDT::decode(const uint8_t* data, bool rawTSBK) /// void IOSP_MSG_UPDT::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -101,10 +98,8 @@ void IOSP_MSG_UPDT::encode(uint8_t* data, bool rawTSBK, bool noTrellis) /// std::string IOSP_MSG_UPDT::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_MSG_UPDT (Message Update Request)"); - else - return std::string("TSBK_IOSP_MSG_UPDT (Message Update)"); + if (isp) return std::string("TSBK_IOSP_MSG_UPDT (Message Update Request)"); + else return std::string("TSBK_IOSP_MSG_UPDT (Message Update)"); } // --------------------------------------------------------------------------- diff --git a/src/common/p25/lc/tsbk/IOSP_MSG_UPDT.h b/src/common/p25/lc/tsbk/IOSP_MSG_UPDT.h index f93bd0bd..683c9bd8 100644 --- a/src/common/p25/lc/tsbk/IOSP_MSG_UPDT.h +++ b/src/common/p25/lc/tsbk/IOSP_MSG_UPDT.h @@ -52,7 +52,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Status value. diff --git a/src/common/p25/lc/tsbk/IOSP_RAD_MON.cpp b/src/common/p25/lc/tsbk/IOSP_RAD_MON.cpp index ffeee801..21f6b34d 100644 --- a/src/common/p25/lc/tsbk/IOSP_RAD_MON.cpp +++ b/src/common/p25/lc/tsbk/IOSP_RAD_MON.cpp @@ -26,15 +26,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/IOSP_RAD_MON.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -57,7 +54,7 @@ IOSP_RAD_MON::IOSP_RAD_MON() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool IOSP_RAD_MON::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -83,7 +80,7 @@ bool IOSP_RAD_MON::decode(const uint8_t* data, bool rawTSBK) /// void IOSP_RAD_MON::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -102,10 +99,8 @@ void IOSP_RAD_MON::encode(uint8_t* data, bool rawTSBK, bool noTrellis) /// std::string IOSP_RAD_MON::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_RAD_MON (Radio Unit Monitor Request)"); - else - return std::string("TSBK_IOSP_RAD_MON (Radio Unit Monitor Command)"); + if (isp) return std::string("TSBK_IOSP_RAD_MON (Radio Unit Monitor Request)"); + else return std::string("TSBK_IOSP_RAD_MON (Radio Unit Monitor Command)"); } // --------------------------------------------------------------------------- diff --git a/src/common/p25/lc/tsbk/IOSP_RAD_MON.h b/src/common/p25/lc/tsbk/IOSP_RAD_MON.h index 2a636a42..b6bd477f 100644 --- a/src/common/p25/lc/tsbk/IOSP_RAD_MON.h +++ b/src/common/p25/lc/tsbk/IOSP_RAD_MON.h @@ -53,7 +53,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Radio Unit Monitor. diff --git a/src/common/p25/lc/tsbk/IOSP_STS_UPDT.cpp b/src/common/p25/lc/tsbk/IOSP_STS_UPDT.cpp index 944932f3..3d7daa77 100644 --- a/src/common/p25/lc/tsbk/IOSP_STS_UPDT.cpp +++ b/src/common/p25/lc/tsbk/IOSP_STS_UPDT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/IOSP_STS_UPDT.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -56,7 +53,7 @@ IOSP_STS_UPDT::IOSP_STS_UPDT() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool IOSP_STS_UPDT::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -82,7 +79,7 @@ bool IOSP_STS_UPDT::decode(const uint8_t* data, bool rawTSBK) /// void IOSP_STS_UPDT::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -101,10 +98,8 @@ void IOSP_STS_UPDT::encode(uint8_t* data, bool rawTSBK, bool noTrellis) /// std::string IOSP_STS_UPDT::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_STS_UPDT (Status Update Request)"); - else - return std::string("TSBK_IOSP_STS_UPDT (Status Update)"); + if (isp) return std::string("TSBK_IOSP_STS_UPDT (Status Update Request)"); + else return std::string("TSBK_IOSP_STS_UPDT (Status Update)"); } // --------------------------------------------------------------------------- diff --git a/src/common/p25/lc/tsbk/IOSP_STS_UPDT.h b/src/common/p25/lc/tsbk/IOSP_STS_UPDT.h index c6d0e9e8..a837461f 100644 --- a/src/common/p25/lc/tsbk/IOSP_STS_UPDT.h +++ b/src/common/p25/lc/tsbk/IOSP_STS_UPDT.h @@ -52,7 +52,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Status value. diff --git a/src/common/p25/lc/tsbk/IOSP_UU_ANS.cpp b/src/common/p25/lc/tsbk/IOSP_UU_ANS.cpp index 8fee4546..aa4bac19 100644 --- a/src/common/p25/lc/tsbk/IOSP_UU_ANS.cpp +++ b/src/common/p25/lc/tsbk/IOSP_UU_ANS.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/IOSP_UU_ANS.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ IOSP_UU_ANS::IOSP_UU_ANS() : TSBK() /// True, if TSBK was decoded, otherwise false. bool IOSP_UU_ANS::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -84,7 +81,7 @@ bool IOSP_UU_ANS::decode(const uint8_t* data, bool rawTSBK) /// void IOSP_UU_ANS::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -106,8 +103,6 @@ void IOSP_UU_ANS::encode(uint8_t* data, bool rawTSBK, bool noTrellis) /// std::string IOSP_UU_ANS::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_UU_ANS (Unit-to-Unit Answer Response)"); - else - return std::string("TSBK_IOSP_UU_ANS (Unit-to-Unit Answer Request)"); + if (isp) return std::string("TSBK_IOSP_UU_ANS (Unit-to-Unit Answer Response)"); + else return std::string("TSBK_IOSP_UU_ANS (Unit-to-Unit Answer Request)"); } diff --git a/src/common/p25/lc/tsbk/IOSP_UU_ANS.h b/src/common/p25/lc/tsbk/IOSP_UU_ANS.h index c41e187e..718b41ac 100644 --- a/src/common/p25/lc/tsbk/IOSP_UU_ANS.h +++ b/src/common/p25/lc/tsbk/IOSP_UU_ANS.h @@ -55,7 +55,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/IOSP_UU_VCH.cpp b/src/common/p25/lc/tsbk/IOSP_UU_VCH.cpp index 42c6e88d..62f99029 100644 --- a/src/common/p25/lc/tsbk/IOSP_UU_VCH.cpp +++ b/src/common/p25/lc/tsbk/IOSP_UU_VCH.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/IOSP_UU_VCH.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ IOSP_UU_VCH::IOSP_UU_VCH() : TSBK() /// True, if TSBK was decoded, otherwise false. bool IOSP_UU_VCH::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -85,7 +82,7 @@ bool IOSP_UU_VCH::decode(const uint8_t* data, bool rawTSBK) /// void IOSP_UU_VCH::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -114,8 +111,6 @@ void IOSP_UU_VCH::encode(uint8_t* data, bool rawTSBK, bool noTrellis) /// std::string IOSP_UU_VCH::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_UU_VCH (Unit-to-Unit Voice Channel Request)"); - else - return std::string("TSBK_IOSP_UU_VCH (Unit-to-Unit Voice Channel Grant)"); + if (isp) return std::string("TSBK_IOSP_UU_VCH (Unit-to-Unit Voice Channel Request)"); + else return std::string("TSBK_IOSP_UU_VCH (Unit-to-Unit Voice Channel Grant)"); } diff --git a/src/common/p25/lc/tsbk/IOSP_UU_VCH.h b/src/common/p25/lc/tsbk/IOSP_UU_VCH.h index 78b7fbce..9464fa76 100644 --- a/src/common/p25/lc/tsbk/IOSP_UU_VCH.h +++ b/src/common/p25/lc/tsbk/IOSP_UU_VCH.h @@ -52,7 +52,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/IOSP_U_REG.cpp b/src/common/p25/lc/tsbk/IOSP_U_REG.cpp index d67c9828..9a2cc46c 100644 --- a/src/common/p25/lc/tsbk/IOSP_U_REG.cpp +++ b/src/common/p25/lc/tsbk/IOSP_U_REG.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/IOSP_U_REG.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -101,8 +98,6 @@ void IOSP_U_REG::encode(uint8_t* data, bool rawTSBK, bool noTrellis) /// std::string IOSP_U_REG::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_U_REG (Unit Registration Request)"); - else - return std::string("TSBK_IOSP_U_REG (Unit Registration Response)"); + if (isp) return std::string("TSBK_IOSP_U_REG (Unit Registration Request)"); + else return std::string("TSBK_IOSP_U_REG (Unit Registration Response)"); } diff --git a/src/common/p25/lc/tsbk/IOSP_U_REG.h b/src/common/p25/lc/tsbk/IOSP_U_REG.h index 9b40c678..b2cea823 100644 --- a/src/common/p25/lc/tsbk/IOSP_U_REG.h +++ b/src/common/p25/lc/tsbk/IOSP_U_REG.h @@ -52,7 +52,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/ISP_AUTH_FNE_RST.cpp b/src/common/p25/lc/tsbk/ISP_AUTH_FNE_RST.cpp index 47ffe85b..163c83e4 100644 --- a/src/common/p25/lc/tsbk/ISP_AUTH_FNE_RST.cpp +++ b/src/common/p25/lc/tsbk/ISP_AUTH_FNE_RST.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/ISP_AUTH_FNE_RST.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -57,7 +54,7 @@ ISP_AUTH_FNE_RST::ISP_AUTH_FNE_RST() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool ISP_AUTH_FNE_RST::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -83,7 +80,7 @@ bool ISP_AUTH_FNE_RST::decode(const uint8_t* data, bool rawTSBK) /// void ISP_AUTH_FNE_RST::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); /* stub */ } diff --git a/src/common/p25/lc/tsbk/ISP_AUTH_FNE_RST.h b/src/common/p25/lc/tsbk/ISP_AUTH_FNE_RST.h index 9364f27b..8149b553 100644 --- a/src/common/p25/lc/tsbk/ISP_AUTH_FNE_RST.h +++ b/src/common/p25/lc/tsbk/ISP_AUTH_FNE_RST.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = true) override; public: /// Flag indicating authentication was successful. diff --git a/src/common/p25/lc/tsbk/ISP_AUTH_RESP.cpp b/src/common/p25/lc/tsbk/ISP_AUTH_RESP.cpp index 9cb52506..c11123d8 100644 --- a/src/common/p25/lc/tsbk/ISP_AUTH_RESP.cpp +++ b/src/common/p25/lc/tsbk/ISP_AUTH_RESP.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/ISP_AUTH_RESP.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -44,7 +41,7 @@ using namespace p25; /// ISP_AUTH_RESP::ISP_AUTH_RESP() : TSBK(), m_authStandalone(false), - m_authRes(NULL) + m_authRes(nullptr) { m_lco = TSBK_ISP_AUTH_RESP; @@ -57,9 +54,9 @@ ISP_AUTH_RESP::ISP_AUTH_RESP() : TSBK(), /// ISP_AUTH_RESP::~ISP_AUTH_RESP() { - if (m_authRes != NULL) { + if (m_authRes != nullptr) { delete[] m_authRes; - m_authRes = NULL; + m_authRes = nullptr; } } @@ -71,7 +68,7 @@ ISP_AUTH_RESP::~ISP_AUTH_RESP() /// True, if TSBK was decoded, otherwise false. bool ISP_AUTH_RESP::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -101,7 +98,7 @@ bool ISP_AUTH_RESP::decode(const uint8_t* data, bool rawTSBK) /// void ISP_AUTH_RESP::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); /* stub */ } @@ -120,7 +117,7 @@ std::string ISP_AUTH_RESP::toString(bool isp) /// void ISP_AUTH_RESP::getAuthRes(uint8_t* res) const { - assert(res != NULL); + assert(res != nullptr); ::memcpy(res, m_authRes, P25_AUTH_RES_LENGTH_BYTES); } @@ -139,7 +136,7 @@ void ISP_AUTH_RESP::copy(const ISP_AUTH_RESP& data) m_authStandalone = data.m_authStandalone; - if (m_authRes != NULL) { + if (m_authRes != nullptr) { delete[] m_authRes; } diff --git a/src/common/p25/lc/tsbk/ISP_AUTH_RESP.h b/src/common/p25/lc/tsbk/ISP_AUTH_RESP.h index 16bb5701..9dccce2f 100644 --- a/src/common/p25/lc/tsbk/ISP_AUTH_RESP.h +++ b/src/common/p25/lc/tsbk/ISP_AUTH_RESP.h @@ -53,7 +53,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = true) override; /** Authentication data */ /// Gets the authentication result. diff --git a/src/common/p25/lc/tsbk/ISP_AUTH_SU_DMD.cpp b/src/common/p25/lc/tsbk/ISP_AUTH_SU_DMD.cpp index f7eb4b0c..fcb3f86d 100644 --- a/src/common/p25/lc/tsbk/ISP_AUTH_SU_DMD.cpp +++ b/src/common/p25/lc/tsbk/ISP_AUTH_SU_DMD.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/ISP_AUTH_SU_DMD.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ ISP_AUTH_SU_DMD::ISP_AUTH_SU_DMD() : TSBK() /// True, if TSBK was decoded, otherwise false. bool ISP_AUTH_SU_DMD::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -79,7 +76,7 @@ bool ISP_AUTH_SU_DMD::decode(const uint8_t* data, bool rawTSBK) /// void ISP_AUTH_SU_DMD::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); /* stub */ } diff --git a/src/common/p25/lc/tsbk/ISP_AUTH_SU_DMD.h b/src/common/p25/lc/tsbk/ISP_AUTH_SU_DMD.h index 46eca410..24fbcf38 100644 --- a/src/common/p25/lc/tsbk/ISP_AUTH_SU_DMD.h +++ b/src/common/p25/lc/tsbk/ISP_AUTH_SU_DMD.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = true) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/ISP_CAN_SRV_REQ.cpp b/src/common/p25/lc/tsbk/ISP_CAN_SRV_REQ.cpp index 429f141c..6ab7e0b8 100644 --- a/src/common/p25/lc/tsbk/ISP_CAN_SRV_REQ.cpp +++ b/src/common/p25/lc/tsbk/ISP_CAN_SRV_REQ.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/ISP_CAN_SRV_REQ.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ ISP_CAN_SRV_REQ::ISP_CAN_SRV_REQ() : TSBK() /// True, if TSBK was decoded, otherwise false. bool ISP_CAN_SRV_REQ::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -83,7 +80,7 @@ bool ISP_CAN_SRV_REQ::decode(const uint8_t* data, bool rawTSBK) /// void ISP_CAN_SRV_REQ::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); /* stub */ } diff --git a/src/common/p25/lc/tsbk/ISP_CAN_SRV_REQ.h b/src/common/p25/lc/tsbk/ISP_CAN_SRV_REQ.h index 983c9c81..d2c87103 100644 --- a/src/common/p25/lc/tsbk/ISP_CAN_SRV_REQ.h +++ b/src/common/p25/lc/tsbk/ISP_CAN_SRV_REQ.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = true) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/ISP_EMERG_ALRM_REQ.cpp b/src/common/p25/lc/tsbk/ISP_EMERG_ALRM_REQ.cpp index 8fb4f2df..e43a760e 100644 --- a/src/common/p25/lc/tsbk/ISP_EMERG_ALRM_REQ.cpp +++ b/src/common/p25/lc/tsbk/ISP_EMERG_ALRM_REQ.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/ISP_EMERG_ALRM_REQ.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ ISP_EMERG_ALRM_REQ::ISP_EMERG_ALRM_REQ() : TSBK() /// True, if TSBK was decoded, otherwise false. bool ISP_EMERG_ALRM_REQ::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -94,7 +91,7 @@ bool ISP_EMERG_ALRM_REQ::decode(const uint8_t* data, bool rawTSBK) /// void ISP_EMERG_ALRM_REQ::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); /* stub */ } diff --git a/src/common/p25/lc/tsbk/ISP_EMERG_ALRM_REQ.h b/src/common/p25/lc/tsbk/ISP_EMERG_ALRM_REQ.h index 311a768f..503548c1 100644 --- a/src/common/p25/lc/tsbk/ISP_EMERG_ALRM_REQ.h +++ b/src/common/p25/lc/tsbk/ISP_EMERG_ALRM_REQ.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = true) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.cpp b/src/common/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.cpp index e6164ad9..9adc3dbd 100644 --- a/src/common/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.cpp +++ b/src/common/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -56,7 +53,7 @@ ISP_GRP_AFF_Q_RSP::ISP_GRP_AFF_Q_RSP() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool ISP_GRP_AFF_Q_RSP::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -82,7 +79,7 @@ bool ISP_GRP_AFF_Q_RSP::decode(const uint8_t* data, bool rawTSBK) /// void ISP_GRP_AFF_Q_RSP::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); /* stub */ } diff --git a/src/common/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.h b/src/common/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.h index 8c7a55c6..610c849c 100644 --- a/src/common/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.h +++ b/src/common/p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = true) override; public: /// Announcement group. diff --git a/src/common/p25/lc/tsbk/ISP_LOC_REG_REQ.cpp b/src/common/p25/lc/tsbk/ISP_LOC_REG_REQ.cpp index a9e261a4..6b4e2dce 100644 --- a/src/common/p25/lc/tsbk/ISP_LOC_REG_REQ.cpp +++ b/src/common/p25/lc/tsbk/ISP_LOC_REG_REQ.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/ISP_LOC_REG_REQ.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -56,7 +53,7 @@ ISP_LOC_REG_REQ::ISP_LOC_REG_REQ() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool ISP_LOC_REG_REQ::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -82,7 +79,7 @@ bool ISP_LOC_REG_REQ::decode(const uint8_t* data, bool rawTSBK) /// void ISP_LOC_REG_REQ::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); /* stub */ } diff --git a/src/common/p25/lc/tsbk/ISP_LOC_REG_REQ.h b/src/common/p25/lc/tsbk/ISP_LOC_REG_REQ.h index 1aa82a1e..a2eb61c0 100644 --- a/src/common/p25/lc/tsbk/ISP_LOC_REG_REQ.h +++ b/src/common/p25/lc/tsbk/ISP_LOC_REG_REQ.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = true) override; public: /// Location registration area. diff --git a/src/common/p25/lc/tsbk/ISP_SNDCP_CH_REQ.cpp b/src/common/p25/lc/tsbk/ISP_SNDCP_CH_REQ.cpp index 82239ec4..5d734ea9 100644 --- a/src/common/p25/lc/tsbk/ISP_SNDCP_CH_REQ.cpp +++ b/src/common/p25/lc/tsbk/ISP_SNDCP_CH_REQ.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/ISP_SNDCP_CH_REQ.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -57,7 +54,7 @@ ISP_SNDCP_CH_REQ::ISP_SNDCP_CH_REQ() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool ISP_SNDCP_CH_REQ::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -83,7 +80,7 @@ bool ISP_SNDCP_CH_REQ::decode(const uint8_t* data, bool rawTSBK) /// void ISP_SNDCP_CH_REQ::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); /* stub */ } diff --git a/src/common/p25/lc/tsbk/ISP_SNDCP_CH_REQ.h b/src/common/p25/lc/tsbk/ISP_SNDCP_CH_REQ.h index e0de60a5..7e211a37 100644 --- a/src/common/p25/lc/tsbk/ISP_SNDCP_CH_REQ.h +++ b/src/common/p25/lc/tsbk/ISP_SNDCP_CH_REQ.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = true) override; public: /// SNDCP Data Service Options diff --git a/src/common/p25/lc/tsbk/ISP_U_DEREG_REQ.cpp b/src/common/p25/lc/tsbk/ISP_U_DEREG_REQ.cpp index 2274a0f7..a6de6320 100644 --- a/src/common/p25/lc/tsbk/ISP_U_DEREG_REQ.cpp +++ b/src/common/p25/lc/tsbk/ISP_U_DEREG_REQ.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/ISP_U_DEREG_REQ.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ ISP_U_DEREG_REQ::ISP_U_DEREG_REQ() : TSBK() /// True, if TSBK was decoded, otherwise false. bool ISP_U_DEREG_REQ::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -81,7 +78,7 @@ bool ISP_U_DEREG_REQ::decode(const uint8_t* data, bool rawTSBK) /// void ISP_U_DEREG_REQ::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); /* stub */ } diff --git a/src/common/p25/lc/tsbk/ISP_U_DEREG_REQ.h b/src/common/p25/lc/tsbk/ISP_U_DEREG_REQ.h index e84aec07..e48fdfa1 100644 --- a/src/common/p25/lc/tsbk/ISP_U_DEREG_REQ.h +++ b/src/common/p25/lc/tsbk/ISP_U_DEREG_REQ.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = true) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_ADJ_STS_BCAST.cpp b/src/common/p25/lc/tsbk/OSP_ADJ_STS_BCAST.cpp index 1cd2b65e..a7bb946c 100644 --- a/src/common/p25/lc/tsbk/OSP_ADJ_STS_BCAST.cpp +++ b/src/common/p25/lc/tsbk/OSP_ADJ_STS_BCAST.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_ADJ_STS_BCAST.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -44,6 +41,7 @@ using namespace p25; /// OSP_ADJ_STS_BCAST::OSP_ADJ_STS_BCAST() : TSBK(), m_adjCFVA(P25_CFVA_FAILURE), + m_adjSysId(0U), m_adjRfssId(0U), m_adjSiteId(0U), m_adjChannelId(0U), @@ -61,7 +59,7 @@ OSP_ADJ_STS_BCAST::OSP_ADJ_STS_BCAST() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool OSP_ADJ_STS_BCAST::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -90,7 +88,7 @@ bool OSP_ADJ_STS_BCAST::decode(const uint8_t* data, bool rawTSBK) /// void OSP_ADJ_STS_BCAST::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -130,6 +128,7 @@ void OSP_ADJ_STS_BCAST::copy(const OSP_ADJ_STS_BCAST& data) TSBK::copy(data); m_adjCFVA = data.m_adjCFVA; + m_adjSysId = data.m_adjSysId; m_adjRfssId = data.m_adjRfssId; m_adjSiteId = data.m_adjSiteId; m_adjChannelId = data.m_adjChannelId; diff --git a/src/common/p25/lc/tsbk/OSP_ADJ_STS_BCAST.h b/src/common/p25/lc/tsbk/OSP_ADJ_STS_BCAST.h index 7be4c038..1e048e16 100644 --- a/src/common/p25/lc/tsbk/OSP_ADJ_STS_BCAST.h +++ b/src/common/p25/lc/tsbk/OSP_ADJ_STS_BCAST.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /** Adjacent Site Data */ diff --git a/src/common/p25/lc/tsbk/OSP_AUTH_FNE_RESP.cpp b/src/common/p25/lc/tsbk/OSP_AUTH_FNE_RESP.cpp index 59fd79b4..818a6a5e 100644 --- a/src/common/p25/lc/tsbk/OSP_AUTH_FNE_RESP.cpp +++ b/src/common/p25/lc/tsbk/OSP_AUTH_FNE_RESP.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_AUTH_FNE_RESP.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -43,7 +40,7 @@ using namespace p25; /// Initializes a new instance of the OSP_AUTH_FNE_RESP class. /// OSP_AUTH_FNE_RESP::OSP_AUTH_FNE_RESP() : TSBK(), - m_authRes(NULL) + m_authRes(nullptr) { m_lco = TSBK_OSP_AUTH_FNE_RESP; @@ -56,9 +53,9 @@ OSP_AUTH_FNE_RESP::OSP_AUTH_FNE_RESP() : TSBK(), /// OSP_AUTH_FNE_RESP::~OSP_AUTH_FNE_RESP() { - if (m_authRes != NULL) { + if (m_authRes != nullptr) { delete[] m_authRes; - m_authRes = NULL; + m_authRes = nullptr; } } @@ -70,7 +67,7 @@ OSP_AUTH_FNE_RESP::~OSP_AUTH_FNE_RESP() /// True, if TSBK was decoded, otherwise false. bool OSP_AUTH_FNE_RESP::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -85,7 +82,7 @@ bool OSP_AUTH_FNE_RESP::decode(const uint8_t* data, bool rawTSBK) /// void OSP_AUTH_FNE_RESP::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -113,9 +110,9 @@ std::string OSP_AUTH_FNE_RESP::toString(bool isp) /// void OSP_AUTH_FNE_RESP::setAuthRes(const uint8_t* res) { - assert(res != NULL); + assert(res != nullptr); - if (m_authRes != NULL) { + if (m_authRes != nullptr) { delete[] m_authRes; } @@ -135,7 +132,7 @@ void OSP_AUTH_FNE_RESP::copy(const OSP_AUTH_FNE_RESP& data) { TSBK::copy(data); - if (m_authRes != NULL) { + if (m_authRes != nullptr) { delete[] m_authRes; } diff --git a/src/common/p25/lc/tsbk/OSP_AUTH_FNE_RESP.h b/src/common/p25/lc/tsbk/OSP_AUTH_FNE_RESP.h index 5fcb70c6..a4317101 100644 --- a/src/common/p25/lc/tsbk/OSP_AUTH_FNE_RESP.h +++ b/src/common/p25/lc/tsbk/OSP_AUTH_FNE_RESP.h @@ -53,7 +53,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; /** Authentication data */ /// Sets the authentication result. diff --git a/src/common/p25/lc/tsbk/OSP_DENY_RSP.cpp b/src/common/p25/lc/tsbk/OSP_DENY_RSP.cpp index bb4c81e5..3c5d6f60 100644 --- a/src/common/p25/lc/tsbk/OSP_DENY_RSP.cpp +++ b/src/common/p25/lc/tsbk/OSP_DENY_RSP.cpp @@ -26,14 +26,12 @@ #include "Defines.h" #include "p25/lc/tsbk/OSP_DENY_RSP.h" #include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +53,7 @@ OSP_DENY_RSP::OSP_DENY_RSP() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_DENY_RSP::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -83,13 +81,13 @@ bool OSP_DENY_RSP::decode(const uint8_t* data, bool rawTSBK) /// void OSP_DENY_RSP::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; if (m_response == 0U) { - LogError(LOG_P25, "TSBK::encode(), invalid values for TSBK_OSP_DENY_RSP, reason = %u", m_response); - return; // blatently ignore creating this TSBK + LogError(LOG_P25, "OSP_DENY_RSP::encode(), invalid values for TSBK_OSP_DENY_RSP, reason = %u", m_response); + return; // blatantly ignore creating this TSBK } tsbkValue = (m_aivFlag) ? 0x80U : 0x00U; // Additional Info Flag diff --git a/src/common/p25/lc/tsbk/OSP_DENY_RSP.h b/src/common/p25/lc/tsbk/OSP_DENY_RSP.h index 69f03675..3a7eb5b9 100644 --- a/src/common/p25/lc/tsbk/OSP_DENY_RSP.h +++ b/src/common/p25/lc/tsbk/OSP_DENY_RSP.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.cpp b/src/common/p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.cpp index d4b30739..d0b1f9fb 100644 --- a/src/common/p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.cpp +++ b/src/common/p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -56,7 +53,7 @@ OSP_DVM_LC_CALL_TERM::OSP_DVM_LC_CALL_TERM() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_DVM_LC_CALL_TERM::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -83,7 +80,7 @@ bool OSP_DVM_LC_CALL_TERM::decode(const uint8_t* data, bool rawTSBK) /// void OSP_DVM_LC_CALL_TERM::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.h b/src/common/p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.h index ff300346..08f10576 100644 --- a/src/common/p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.h +++ b/src/common/p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_GRP_AFF_Q.cpp b/src/common/p25/lc/tsbk/OSP_GRP_AFF_Q.cpp index 9a4ad2c9..b6821a83 100644 --- a/src/common/p25/lc/tsbk/OSP_GRP_AFF_Q.cpp +++ b/src/common/p25/lc/tsbk/OSP_GRP_AFF_Q.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_GRP_AFF_Q.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ OSP_GRP_AFF_Q::OSP_GRP_AFF_Q() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_GRP_AFF_Q::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -70,7 +67,7 @@ bool OSP_GRP_AFF_Q::decode(const uint8_t* data, bool rawTSBK) /// void OSP_GRP_AFF_Q::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_GRP_AFF_Q.h b/src/common/p25/lc/tsbk/OSP_GRP_AFF_Q.h index c9e94cc8..e1cc9ac7 100644 --- a/src/common/p25/lc/tsbk/OSP_GRP_AFF_Q.h +++ b/src/common/p25/lc/tsbk/OSP_GRP_AFF_Q.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_GRP_VCH_GRANT_UPD.cpp b/src/common/p25/lc/tsbk/OSP_GRP_VCH_GRANT_UPD.cpp index d477a3ea..c85eb13b 100644 --- a/src/common/p25/lc/tsbk/OSP_GRP_VCH_GRANT_UPD.cpp +++ b/src/common/p25/lc/tsbk/OSP_GRP_VCH_GRANT_UPD.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_GRP_VCH_GRANT_UPD.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ OSP_GRP_VCH_GRANT_UPD::OSP_GRP_VCH_GRANT_UPD() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_GRP_VCH_GRANT_UPD::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -70,7 +67,7 @@ bool OSP_GRP_VCH_GRANT_UPD::decode(const uint8_t* data, bool rawTSBK) /// void OSP_GRP_VCH_GRANT_UPD::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_GRP_VCH_GRANT_UPD.h b/src/common/p25/lc/tsbk/OSP_GRP_VCH_GRANT_UPD.h index 8243be71..2b39c3ea 100644 --- a/src/common/p25/lc/tsbk/OSP_GRP_VCH_GRANT_UPD.h +++ b/src/common/p25/lc/tsbk/OSP_GRP_VCH_GRANT_UPD.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_IDEN_UP.cpp b/src/common/p25/lc/tsbk/OSP_IDEN_UP.cpp index 7202d72d..220e1fb8 100644 --- a/src/common/p25/lc/tsbk/OSP_IDEN_UP.cpp +++ b/src/common/p25/lc/tsbk/OSP_IDEN_UP.cpp @@ -26,7 +26,6 @@ #include "Defines.h" #include "p25/lc/tsbk/OSP_IDEN_UP.h" #include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; @@ -55,7 +54,7 @@ OSP_IDEN_UP::OSP_IDEN_UP() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_IDEN_UP::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -70,16 +69,16 @@ bool OSP_IDEN_UP::decode(const uint8_t* data, bool rawTSBK) /// void OSP_IDEN_UP::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; if ((m_siteIdenEntry.chBandwidthKhz() != 0.0F) && (m_siteIdenEntry.chSpaceKhz() != 0.0F) && (m_siteIdenEntry.txOffsetMhz() != 0.0F) && (m_siteIdenEntry.baseFrequency() != 0U)) { if (m_siteIdenEntry.baseFrequency() < 762000000U) { - LogError(LOG_P25, "TSBK::encode(), invalid values for TSBK_OSP_IDEN_UP, baseFrequency = %uHz", + LogError(LOG_P25, "OSP_IDEN_UP::encode(), invalid values for TSBK_OSP_IDEN_UP, baseFrequency = %uHz", m_siteIdenEntry.baseFrequency()); - return; // blatently ignore creating this TSBK + return; // blatantly ignore creating this TSBK } uint32_t calcSpace = (uint32_t)(m_siteIdenEntry.chSpaceKhz() / 0.125); @@ -99,7 +98,7 @@ void OSP_IDEN_UP::encode(uint8_t* data, bool rawTSBK, bool noTrellis) tsbkValue = (tsbkValue << 32) + calcBaseFreq; // Base Frequency } else { - LogError(LOG_P25, "TSBK::encode(), invalid values for TSBK_OSP_IDEN_UP, baseFrequency = %uHz, txOffsetMhz = %fMHz, chBandwidthKhz = %fKHz, chSpaceKhz = %fKHz", + LogError(LOG_P25, "OSP_IDEN_UP::encode(), invalid values for TSBK_OSP_IDEN_UP, baseFrequency = %uHz, txOffsetMhz = %fMHz, chBandwidthKhz = %fKHz, chSpaceKhz = %fKHz", m_siteIdenEntry.baseFrequency(), m_siteIdenEntry.txOffsetMhz(), m_siteIdenEntry.chBandwidthKhz(), m_siteIdenEntry.chSpaceKhz()); return; // blatently ignore creating this TSBK diff --git a/src/common/p25/lc/tsbk/OSP_IDEN_UP.h b/src/common/p25/lc/tsbk/OSP_IDEN_UP.h index b17a350e..d734a97e 100644 --- a/src/common/p25/lc/tsbk/OSP_IDEN_UP.h +++ b/src/common/p25/lc/tsbk/OSP_IDEN_UP.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_IDEN_UP_VU.cpp b/src/common/p25/lc/tsbk/OSP_IDEN_UP_VU.cpp index 80a10899..a3b76a33 100644 --- a/src/common/p25/lc/tsbk/OSP_IDEN_UP_VU.cpp +++ b/src/common/p25/lc/tsbk/OSP_IDEN_UP_VU.cpp @@ -26,7 +26,6 @@ #include "Defines.h" #include "p25/lc/tsbk/OSP_IDEN_UP_VU.h" #include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; @@ -55,7 +54,7 @@ OSP_IDEN_UP_VU::OSP_IDEN_UP_VU() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_IDEN_UP_VU::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -70,7 +69,7 @@ bool OSP_IDEN_UP_VU::decode(const uint8_t* data, bool rawTSBK) /// void OSP_IDEN_UP_VU::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -93,10 +92,10 @@ void OSP_IDEN_UP_VU::encode(uint8_t* data, bool rawTSBK, bool noTrellis) tsbkValue = (tsbkValue << 32) + calcBaseFreq; // Base Frequency } else { - LogError(LOG_P25, "TSBK::encode(), invalid values for TSBK_OSP_IDEN_UP_VU, baseFrequency = %uHz, txOffsetMhz = %fMHz, chBandwidthKhz = %fKHz, chSpaceKhz = %fKHz", + LogError(LOG_P25, "OSP_IDEN_UP_VU::encode(), invalid values for TSBK_OSP_IDEN_UP_VU, baseFrequency = %uHz, txOffsetMhz = %fMHz, chBandwidthKhz = %fKHz, chSpaceKhz = %fKHz", m_siteIdenEntry.baseFrequency(), m_siteIdenEntry.txOffsetMhz(), m_siteIdenEntry.chBandwidthKhz(), m_siteIdenEntry.chSpaceKhz()); - return; // blatently ignore creating this TSBK + return; // blatantly ignore creating this TSBK } std::unique_ptr tsbk = TSBK::fromValue(tsbkValue); diff --git a/src/common/p25/lc/tsbk/OSP_IDEN_UP_VU.h b/src/common/p25/lc/tsbk/OSP_IDEN_UP_VU.h index 6e077b69..df7cbfd4 100644 --- a/src/common/p25/lc/tsbk/OSP_IDEN_UP_VU.h +++ b/src/common/p25/lc/tsbk/OSP_IDEN_UP_VU.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_LOC_REG_RSP.cpp b/src/common/p25/lc/tsbk/OSP_LOC_REG_RSP.cpp index 943071fc..de4886c3 100644 --- a/src/common/p25/lc/tsbk/OSP_LOC_REG_RSP.cpp +++ b/src/common/p25/lc/tsbk/OSP_LOC_REG_RSP.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_LOC_REG_RSP.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ OSP_LOC_REG_RSP::OSP_LOC_REG_RSP() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_LOC_REG_RSP::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -70,7 +67,7 @@ bool OSP_LOC_REG_RSP::decode(const uint8_t* data, bool rawTSBK) /// void OSP_LOC_REG_RSP::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_LOC_REG_RSP.h b/src/common/p25/lc/tsbk/OSP_LOC_REG_RSP.h index 3c015803..f753aea1 100644 --- a/src/common/p25/lc/tsbk/OSP_LOC_REG_RSP.h +++ b/src/common/p25/lc/tsbk/OSP_LOC_REG_RSP.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_MOT_CC_BSI.cpp b/src/common/p25/lc/tsbk/OSP_MOT_CC_BSI.cpp index 243b1b21..7714849f 100644 --- a/src/common/p25/lc/tsbk/OSP_MOT_CC_BSI.cpp +++ b/src/common/p25/lc/tsbk/OSP_MOT_CC_BSI.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_MOT_CC_BSI.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -56,7 +53,7 @@ OSP_MOT_CC_BSI::OSP_MOT_CC_BSI() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_MOT_CC_BSI::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -71,7 +68,7 @@ bool OSP_MOT_CC_BSI::decode(const uint8_t* data, bool rawTSBK) /// void OSP_MOT_CC_BSI::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_MOT_CC_BSI.h b/src/common/p25/lc/tsbk/OSP_MOT_CC_BSI.h index 94822680..a31a79d2 100644 --- a/src/common/p25/lc/tsbk/OSP_MOT_CC_BSI.h +++ b/src/common/p25/lc/tsbk/OSP_MOT_CC_BSI.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_MOT_GRG_ADD.cpp b/src/common/p25/lc/tsbk/OSP_MOT_GRG_ADD.cpp index 2cee2593..6e926c42 100644 --- a/src/common/p25/lc/tsbk/OSP_MOT_GRG_ADD.cpp +++ b/src/common/p25/lc/tsbk/OSP_MOT_GRG_ADD.cpp @@ -26,14 +26,12 @@ #include "Defines.h" #include "p25/lc/tsbk/OSP_MOT_GRG_ADD.h" #include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -42,7 +40,11 @@ using namespace p25; /// /// Initializes a new instance of the OSP_MOT_GRG_ADD class. /// -OSP_MOT_GRG_ADD::OSP_MOT_GRG_ADD() : TSBK() +OSP_MOT_GRG_ADD::OSP_MOT_GRG_ADD() : TSBK(), + m_patchSuperGroupId(0U), + m_patchGroup1Id(0U), + m_patchGroup2Id(0U), + m_patchGroup3Id(0U) { m_lco = TSBK_OSP_MOT_GRG_ADD; } @@ -55,7 +57,7 @@ OSP_MOT_GRG_ADD::OSP_MOT_GRG_ADD() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_MOT_GRG_ADD::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -70,7 +72,7 @@ bool OSP_MOT_GRG_ADD::decode(const uint8_t* data, bool rawTSBK) /// void OSP_MOT_GRG_ADD::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -94,6 +96,11 @@ void OSP_MOT_GRG_ADD::encode(uint8_t* data, bool rawTSBK, bool noTrellis) tsbkValue = (tsbkValue << 16) + m_patchGroup1Id; // Patch Group 1 Address } } + else { + LogError(LOG_P25, "OSP_MOT_GRG_ADD::encode(), invalid values for TSBK_OSP_MOT_GRG_DEL, patchSuperGroupId = $%02X, patchGroup1Id = $%02X", + m_patchSuperGroupId, m_patchGroup1Id); + return; // blatantly ignore creating this TSBK + } std::unique_ptr tsbk = TSBK::fromValue(tsbkValue); TSBK::encode(data, tsbk.get(), rawTSBK, noTrellis); diff --git a/src/common/p25/lc/tsbk/OSP_MOT_GRG_ADD.h b/src/common/p25/lc/tsbk/OSP_MOT_GRG_ADD.h index 60545505..c1acd5ae 100644 --- a/src/common/p25/lc/tsbk/OSP_MOT_GRG_ADD.h +++ b/src/common/p25/lc/tsbk/OSP_MOT_GRG_ADD.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Patch super group ID. diff --git a/src/common/p25/lc/tsbk/OSP_MOT_GRG_DEL.cpp b/src/common/p25/lc/tsbk/OSP_MOT_GRG_DEL.cpp index 54aff895..f5fbd7ce 100644 --- a/src/common/p25/lc/tsbk/OSP_MOT_GRG_DEL.cpp +++ b/src/common/p25/lc/tsbk/OSP_MOT_GRG_DEL.cpp @@ -26,14 +26,12 @@ #include "Defines.h" #include "p25/lc/tsbk/OSP_MOT_GRG_DEL.h" #include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -42,7 +40,11 @@ using namespace p25; /// /// Initializes a new instance of the OSP_MOT_GRG_DEL class. /// -OSP_MOT_GRG_DEL::OSP_MOT_GRG_DEL() : TSBK() +OSP_MOT_GRG_DEL::OSP_MOT_GRG_DEL() : TSBK(), + m_patchSuperGroupId(0U), + m_patchGroup1Id(0U), + m_patchGroup2Id(0U), + m_patchGroup3Id(0U) { m_lco = TSBK_OSP_MOT_GRG_DEL; } @@ -55,7 +57,7 @@ OSP_MOT_GRG_DEL::OSP_MOT_GRG_DEL() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_MOT_GRG_DEL::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -70,7 +72,7 @@ bool OSP_MOT_GRG_DEL::decode(const uint8_t* data, bool rawTSBK) /// void OSP_MOT_GRG_DEL::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -95,9 +97,9 @@ void OSP_MOT_GRG_DEL::encode(uint8_t* data, bool rawTSBK, bool noTrellis) } } else { - LogError(LOG_P25, "TSBK::encode(), invalid values for TSBK_OSP_MOT_GRG_DEL, patchSuperGroupId = $%02X, patchGroup1Id = $%02X", + LogError(LOG_P25, "OSP_MOT_GRG_DEL::encode(), invalid values for TSBK_OSP_MOT_GRG_DEL, patchSuperGroupId = $%02X, patchGroup1Id = $%02X", m_patchSuperGroupId, m_patchGroup1Id); - return; // blatently ignore creating this TSBK + return; // blatantly ignore creating this TSBK } std::unique_ptr tsbk = TSBK::fromValue(tsbkValue); diff --git a/src/common/p25/lc/tsbk/OSP_MOT_GRG_DEL.h b/src/common/p25/lc/tsbk/OSP_MOT_GRG_DEL.h index 7b27e0dc..be7d5888 100644 --- a/src/common/p25/lc/tsbk/OSP_MOT_GRG_DEL.h +++ b/src/common/p25/lc/tsbk/OSP_MOT_GRG_DEL.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Patch super group ID. diff --git a/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.cpp b/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.cpp index 7d085c02..5a4777ed 100644 --- a/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.cpp +++ b/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.cpp @@ -26,14 +26,12 @@ #include "Defines.h" #include "p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.h" #include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -42,7 +40,8 @@ using namespace p25; /// /// Initializes a new instance of the OSP_MOT_GRG_VCH_GRANT class. /// -OSP_MOT_GRG_VCH_GRANT::OSP_MOT_GRG_VCH_GRANT() : TSBK() +OSP_MOT_GRG_VCH_GRANT::OSP_MOT_GRG_VCH_GRANT() : TSBK(), + m_patchSuperGroupId(0U) { m_lco = TSBK_OSP_MOT_GRG_VCH_GRANT; } @@ -55,7 +54,7 @@ OSP_MOT_GRG_VCH_GRANT::OSP_MOT_GRG_VCH_GRANT() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_MOT_GRG_VCH_GRANT::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -70,7 +69,7 @@ bool OSP_MOT_GRG_VCH_GRANT::decode(const uint8_t* data, bool rawTSBK) /// void OSP_MOT_GRG_VCH_GRANT::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; @@ -84,8 +83,8 @@ void OSP_MOT_GRG_VCH_GRANT::encode(uint8_t* data, bool rawTSBK, bool noTrellis) tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address } else { - LogError(LOG_P25, "TSBK::encode(), invalid values for TSBK_OSP_MOT_GRG_VCH_GRANT, patchSuperGroupId = $%02X", m_patchSuperGroupId); - return; // blatently ignore creating this TSBK + LogError(LOG_P25, "OSP_MOT_GRG_VCH_GRANT::encode(), invalid values for TSBK_OSP_MOT_GRG_VCH_GRANT, patchSuperGroupId = $%02X", m_patchSuperGroupId); + return; // blatantly ignore creating this TSBK } std::unique_ptr tsbk = TSBK::fromValue(tsbkValue); diff --git a/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.h b/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.h index 1ec88c76..82897d75 100644 --- a/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.h +++ b/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_GRANT.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Patch super group ID. diff --git a/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.cpp b/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.cpp index ab752622..4dbf8f16 100644 --- a/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.cpp +++ b/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -42,7 +39,9 @@ using namespace p25; /// /// Initializes a new instance of the OSP_MOT_GRG_VCH_UPD class. /// -OSP_MOT_GRG_VCH_UPD::OSP_MOT_GRG_VCH_UPD() : TSBK() +OSP_MOT_GRG_VCH_UPD::OSP_MOT_GRG_VCH_UPD() : TSBK(), + m_patchGroup1Id(0U), + m_patchGroup2Id(0U) { m_lco = TSBK_OSP_MOT_GRG_VCH_UPD; } @@ -55,7 +54,7 @@ OSP_MOT_GRG_VCH_UPD::OSP_MOT_GRG_VCH_UPD() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_MOT_GRG_VCH_UPD::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -70,7 +69,7 @@ bool OSP_MOT_GRG_VCH_UPD::decode(const uint8_t* data, bool rawTSBK) /// void OSP_MOT_GRG_VCH_UPD::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.h b/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.h index 7c1bbb78..0dd72438 100644 --- a/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.h +++ b/src/common/p25/lc/tsbk/OSP_MOT_GRG_VCH_UPD.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// 1st patch group ID. diff --git a/src/common/p25/lc/tsbk/OSP_MOT_PSH_CCH.cpp b/src/common/p25/lc/tsbk/OSP_MOT_PSH_CCH.cpp index 7ed355ff..5b85bedf 100644 --- a/src/common/p25/lc/tsbk/OSP_MOT_PSH_CCH.cpp +++ b/src/common/p25/lc/tsbk/OSP_MOT_PSH_CCH.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_MOT_PSH_CCH.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -56,7 +53,7 @@ OSP_MOT_PSH_CCH::OSP_MOT_PSH_CCH() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_MOT_PSH_CCH::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -71,7 +68,7 @@ bool OSP_MOT_PSH_CCH::decode(const uint8_t* data, bool rawTSBK) /// void OSP_MOT_PSH_CCH::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_MOT_PSH_CCH.h b/src/common/p25/lc/tsbk/OSP_MOT_PSH_CCH.h index cc904aa5..188c533d 100644 --- a/src/common/p25/lc/tsbk/OSP_MOT_PSH_CCH.h +++ b/src/common/p25/lc/tsbk/OSP_MOT_PSH_CCH.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_NET_STS_BCAST.cpp b/src/common/p25/lc/tsbk/OSP_NET_STS_BCAST.cpp index 9539ebf1..e339fc22 100644 --- a/src/common/p25/lc/tsbk/OSP_NET_STS_BCAST.cpp +++ b/src/common/p25/lc/tsbk/OSP_NET_STS_BCAST.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_NET_STS_BCAST.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ OSP_NET_STS_BCAST::OSP_NET_STS_BCAST() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_NET_STS_BCAST::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -70,7 +67,7 @@ bool OSP_NET_STS_BCAST::decode(const uint8_t* data, bool rawTSBK) /// void OSP_NET_STS_BCAST::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_NET_STS_BCAST.h b/src/common/p25/lc/tsbk/OSP_NET_STS_BCAST.h index b9182356..e4a356d0 100644 --- a/src/common/p25/lc/tsbk/OSP_NET_STS_BCAST.h +++ b/src/common/p25/lc/tsbk/OSP_NET_STS_BCAST.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_QUE_RSP.cpp b/src/common/p25/lc/tsbk/OSP_QUE_RSP.cpp index 9966ffe1..819a2bb1 100644 --- a/src/common/p25/lc/tsbk/OSP_QUE_RSP.cpp +++ b/src/common/p25/lc/tsbk/OSP_QUE_RSP.cpp @@ -26,14 +26,12 @@ #include "Defines.h" #include "p25/lc/tsbk/OSP_QUE_RSP.h" #include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +53,7 @@ OSP_QUE_RSP::OSP_QUE_RSP() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_QUE_RSP::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -83,13 +81,13 @@ bool OSP_QUE_RSP::decode(const uint8_t* data, bool rawTSBK) /// void OSP_QUE_RSP::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; if (m_response == 0U) { - LogError(LOG_P25, "TSBK::encode(), invalid values for TSBK_OSP_QUE_RSP, reason = %u", m_response); - return; // blatently ignore creating this TSBK + LogError(LOG_P25, "OSP_QUE_RSP::encode(), invalid values for TSBK_OSP_QUE_RSP, reason = %u", m_response); + return; // blatantly ignore creating this TSBK } tsbkValue = (m_aivFlag) ? 0x80U : 0x00U; // Additional Info Flag diff --git a/src/common/p25/lc/tsbk/OSP_QUE_RSP.h b/src/common/p25/lc/tsbk/OSP_QUE_RSP.h index 46547761..7f4120bc 100644 --- a/src/common/p25/lc/tsbk/OSP_QUE_RSP.h +++ b/src/common/p25/lc/tsbk/OSP_QUE_RSP.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_RFSS_STS_BCAST.cpp b/src/common/p25/lc/tsbk/OSP_RFSS_STS_BCAST.cpp index e43a3128..652b792a 100644 --- a/src/common/p25/lc/tsbk/OSP_RFSS_STS_BCAST.cpp +++ b/src/common/p25/lc/tsbk/OSP_RFSS_STS_BCAST.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_RFSS_STS_BCAST.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -56,7 +53,7 @@ OSP_RFSS_STS_BCAST::OSP_RFSS_STS_BCAST() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool OSP_RFSS_STS_BCAST::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -71,7 +68,7 @@ bool OSP_RFSS_STS_BCAST::decode(const uint8_t* data, bool rawTSBK) /// void OSP_RFSS_STS_BCAST::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_RFSS_STS_BCAST.h b/src/common/p25/lc/tsbk/OSP_RFSS_STS_BCAST.h index ef984366..c20f5ec5 100644 --- a/src/common/p25/lc/tsbk/OSP_RFSS_STS_BCAST.h +++ b/src/common/p25/lc/tsbk/OSP_RFSS_STS_BCAST.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Roamer Reaccess Method. diff --git a/src/common/p25/lc/tsbk/OSP_SCCB.cpp b/src/common/p25/lc/tsbk/OSP_SCCB.cpp index 1a83a8dc..5f0c160e 100644 --- a/src/common/p25/lc/tsbk/OSP_SCCB.cpp +++ b/src/common/p25/lc/tsbk/OSP_SCCB.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_SCCB.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -57,7 +54,7 @@ OSP_SCCB::OSP_SCCB() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool OSP_SCCB::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -72,7 +69,7 @@ bool OSP_SCCB::decode(const uint8_t* data, bool rawTSBK) /// void OSP_SCCB::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_SCCB.h b/src/common/p25/lc/tsbk/OSP_SCCB.h index 475ffe16..927c8b08 100644 --- a/src/common/p25/lc/tsbk/OSP_SCCB.h +++ b/src/common/p25/lc/tsbk/OSP_SCCB.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// SCCB channel ID 1. diff --git a/src/common/p25/lc/tsbk/OSP_SCCB_EXP.cpp b/src/common/p25/lc/tsbk/OSP_SCCB_EXP.cpp index fc975992..e162f99c 100644 --- a/src/common/p25/lc/tsbk/OSP_SCCB_EXP.cpp +++ b/src/common/p25/lc/tsbk/OSP_SCCB_EXP.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_SCCB_EXP.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -57,7 +54,7 @@ OSP_SCCB_EXP::OSP_SCCB_EXP() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool OSP_SCCB_EXP::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -72,7 +69,7 @@ bool OSP_SCCB_EXP::decode(const uint8_t* data, bool rawTSBK) /// void OSP_SCCB_EXP::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_SCCB_EXP.h b/src/common/p25/lc/tsbk/OSP_SCCB_EXP.h index a99323f0..4e756c3e 100644 --- a/src/common/p25/lc/tsbk/OSP_SCCB_EXP.h +++ b/src/common/p25/lc/tsbk/OSP_SCCB_EXP.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// SCCB channel ID 1. diff --git a/src/common/p25/lc/tsbk/OSP_SNDCP_CH_ANN.cpp b/src/common/p25/lc/tsbk/OSP_SNDCP_CH_ANN.cpp index 8eb0d869..0667402e 100644 --- a/src/common/p25/lc/tsbk/OSP_SNDCP_CH_ANN.cpp +++ b/src/common/p25/lc/tsbk/OSP_SNDCP_CH_ANN.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_SNDCP_CH_ANN.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -57,7 +54,7 @@ OSP_SNDCP_CH_ANN::OSP_SNDCP_CH_ANN() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool OSP_SNDCP_CH_ANN::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -72,7 +69,7 @@ bool OSP_SNDCP_CH_ANN::decode(const uint8_t* data, bool rawTSBK) /// void OSP_SNDCP_CH_ANN::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_SNDCP_CH_ANN.h b/src/common/p25/lc/tsbk/OSP_SNDCP_CH_ANN.h index f46c4568..c171db03 100644 --- a/src/common/p25/lc/tsbk/OSP_SNDCP_CH_ANN.h +++ b/src/common/p25/lc/tsbk/OSP_SNDCP_CH_ANN.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; private: bool m_sndcpAutoAccess; diff --git a/src/common/p25/lc/tsbk/OSP_SNDCP_CH_GNT.cpp b/src/common/p25/lc/tsbk/OSP_SNDCP_CH_GNT.cpp index 30a3c20e..50291010 100644 --- a/src/common/p25/lc/tsbk/OSP_SNDCP_CH_GNT.cpp +++ b/src/common/p25/lc/tsbk/OSP_SNDCP_CH_GNT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_SNDCP_CH_GNT.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -57,7 +54,7 @@ OSP_SNDCP_CH_GNT::OSP_SNDCP_CH_GNT() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool OSP_SNDCP_CH_GNT::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -72,7 +69,7 @@ bool OSP_SNDCP_CH_GNT::decode(const uint8_t* data, bool rawTSBK) /// void OSP_SNDCP_CH_GNT::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_SNDCP_CH_GNT.h b/src/common/p25/lc/tsbk/OSP_SNDCP_CH_GNT.h index cb8e2d17..e08a6173 100644 --- a/src/common/p25/lc/tsbk/OSP_SNDCP_CH_GNT.h +++ b/src/common/p25/lc/tsbk/OSP_SNDCP_CH_GNT.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// SNDCP Data Service Options diff --git a/src/common/p25/lc/tsbk/OSP_SYNC_BCAST.cpp b/src/common/p25/lc/tsbk/OSP_SYNC_BCAST.cpp index b24ea084..1707c4d0 100644 --- a/src/common/p25/lc/tsbk/OSP_SYNC_BCAST.cpp +++ b/src/common/p25/lc/tsbk/OSP_SYNC_BCAST.cpp @@ -25,8 +25,6 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_SYNC_BCAST.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; @@ -58,7 +56,7 @@ OSP_SYNC_BCAST::OSP_SYNC_BCAST() : TSBK(), /// True, if TSBK was decoded, otherwise false. bool OSP_SYNC_BCAST::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -73,7 +71,7 @@ bool OSP_SYNC_BCAST::decode(const uint8_t* data, bool rawTSBK) /// void OSP_SYNC_BCAST::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_SYNC_BCAST.h b/src/common/p25/lc/tsbk/OSP_SYNC_BCAST.h index 75d16dc2..2e2bb743 100644 --- a/src/common/p25/lc/tsbk/OSP_SYNC_BCAST.h +++ b/src/common/p25/lc/tsbk/OSP_SYNC_BCAST.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Microslot count. diff --git a/src/common/p25/lc/tsbk/OSP_SYS_SRV_BCAST.cpp b/src/common/p25/lc/tsbk/OSP_SYS_SRV_BCAST.cpp index 64a55aae..7a1b3137 100644 --- a/src/common/p25/lc/tsbk/OSP_SYS_SRV_BCAST.cpp +++ b/src/common/p25/lc/tsbk/OSP_SYS_SRV_BCAST.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_SYS_SRV_BCAST.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ OSP_SYS_SRV_BCAST::OSP_SYS_SRV_BCAST() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_SYS_SRV_BCAST::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -70,7 +67,7 @@ bool OSP_SYS_SRV_BCAST::decode(const uint8_t* data, bool rawTSBK) /// void OSP_SYS_SRV_BCAST::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); const uint32_t services = (m_siteData.netActive()) ? P25_SYS_SRV_NET_ACTIVE : 0U | P25_SYS_SRV_DEFAULT; diff --git a/src/common/p25/lc/tsbk/OSP_SYS_SRV_BCAST.h b/src/common/p25/lc/tsbk/OSP_SYS_SRV_BCAST.h index 61567c86..95193d0c 100644 --- a/src/common/p25/lc/tsbk/OSP_SYS_SRV_BCAST.h +++ b/src/common/p25/lc/tsbk/OSP_SYS_SRV_BCAST.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_TIME_DATE_ANN.cpp b/src/common/p25/lc/tsbk/OSP_TIME_DATE_ANN.cpp index 5661c7d5..9875ad91 100644 --- a/src/common/p25/lc/tsbk/OSP_TIME_DATE_ANN.cpp +++ b/src/common/p25/lc/tsbk/OSP_TIME_DATE_ANN.cpp @@ -26,8 +26,6 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_TIME_DATE_ANN.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; @@ -58,7 +56,7 @@ OSP_TIME_DATE_ANN::OSP_TIME_DATE_ANN() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_TIME_DATE_ANN::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -73,7 +71,7 @@ bool OSP_TIME_DATE_ANN::decode(const uint8_t* data, bool rawTSBK) /// void OSP_TIME_DATE_ANN::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_TIME_DATE_ANN.h b/src/common/p25/lc/tsbk/OSP_TIME_DATE_ANN.h index 1bc198c0..0f24cebe 100644 --- a/src/common/p25/lc/tsbk/OSP_TIME_DATE_ANN.h +++ b/src/common/p25/lc/tsbk/OSP_TIME_DATE_ANN.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_TSBK_RAW.cpp b/src/common/p25/lc/tsbk/OSP_TSBK_RAW.cpp index ff98eea7..a8e4bd72 100644 --- a/src/common/p25/lc/tsbk/OSP_TSBK_RAW.cpp +++ b/src/common/p25/lc/tsbk/OSP_TSBK_RAW.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_TSBK_RAW.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -66,7 +63,7 @@ OSP_TSBK_RAW::~OSP_TSBK_RAW() /// True, if TSBK was decoded, otherwise false. bool OSP_TSBK_RAW::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -81,8 +78,8 @@ bool OSP_TSBK_RAW::decode(const uint8_t* data, bool rawTSBK) /// void OSP_TSBK_RAW::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); - assert(m_tsbk != NULL); + assert(data != nullptr); + assert(m_tsbk != nullptr); /* stub */ @@ -95,7 +92,7 @@ void OSP_TSBK_RAW::encode(uint8_t* data, bool rawTSBK, bool noTrellis) /// void OSP_TSBK_RAW::setTSBK(const uint8_t* tsbk) { - assert(tsbk != NULL); + assert(tsbk != nullptr); m_lco = tsbk[0U] & 0x3F; // LCO m_lastBlock = (tsbk[0U] & 0x80U) == 0x80U; // Last Block Marker diff --git a/src/common/p25/lc/tsbk/OSP_UU_VCH_GRANT_UPD.cpp b/src/common/p25/lc/tsbk/OSP_UU_VCH_GRANT_UPD.cpp index fd903a6c..74409f08 100644 --- a/src/common/p25/lc/tsbk/OSP_UU_VCH_GRANT_UPD.cpp +++ b/src/common/p25/lc/tsbk/OSP_UU_VCH_GRANT_UPD.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_UU_VCH_GRANT_UPD.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ OSP_UU_VCH_GRANT_UPD::OSP_UU_VCH_GRANT_UPD() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_UU_VCH_GRANT_UPD::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -70,7 +67,7 @@ bool OSP_UU_VCH_GRANT_UPD::decode(const uint8_t* data, bool rawTSBK) /// void OSP_UU_VCH_GRANT_UPD::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_UU_VCH_GRANT_UPD.h b/src/common/p25/lc/tsbk/OSP_UU_VCH_GRANT_UPD.h index c74588f3..9386a756 100644 --- a/src/common/p25/lc/tsbk/OSP_UU_VCH_GRANT_UPD.h +++ b/src/common/p25/lc/tsbk/OSP_UU_VCH_GRANT_UPD.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_U_DEREG_ACK.cpp b/src/common/p25/lc/tsbk/OSP_U_DEREG_ACK.cpp index 0b99af0b..1626dc1d 100644 --- a/src/common/p25/lc/tsbk/OSP_U_DEREG_ACK.cpp +++ b/src/common/p25/lc/tsbk/OSP_U_DEREG_ACK.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_U_DEREG_ACK.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ OSP_U_DEREG_ACK::OSP_U_DEREG_ACK() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_U_DEREG_ACK::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U]; ::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES); @@ -81,7 +78,7 @@ bool OSP_U_DEREG_ACK::decode(const uint8_t* data, bool rawTSBK) /// void OSP_U_DEREG_ACK::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_U_DEREG_ACK.h b/src/common/p25/lc/tsbk/OSP_U_DEREG_ACK.h index 0cbec88f..9aa8ddbf 100644 --- a/src/common/p25/lc/tsbk/OSP_U_DEREG_ACK.h +++ b/src/common/p25/lc/tsbk/OSP_U_DEREG_ACK.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/OSP_U_REG_CMD.cpp b/src/common/p25/lc/tsbk/OSP_U_REG_CMD.cpp index 560abe8e..210a96e6 100644 --- a/src/common/p25/lc/tsbk/OSP_U_REG_CMD.cpp +++ b/src/common/p25/lc/tsbk/OSP_U_REG_CMD.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/OSP_U_REG_CMD.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -55,7 +52,7 @@ OSP_U_REG_CMD::OSP_U_REG_CMD() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_U_REG_CMD::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -70,7 +67,7 @@ bool OSP_U_REG_CMD::decode(const uint8_t* data, bool rawTSBK) /// void OSP_U_REG_CMD::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/common/p25/lc/tsbk/OSP_U_REG_CMD.h b/src/common/p25/lc/tsbk/OSP_U_REG_CMD.h index 2f3921b8..41282d8a 100644 --- a/src/common/p25/lc/tsbk/OSP_U_REG_CMD.h +++ b/src/common/p25/lc/tsbk/OSP_U_REG_CMD.h @@ -51,7 +51,7 @@ namespace p25 void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/TSBKFactory.cpp b/src/common/p25/lc/tsbk/TSBKFactory.cpp index 5babd777..d7c02084 100644 --- a/src/common/p25/lc/tsbk/TSBKFactory.cpp +++ b/src/common/p25/lc/tsbk/TSBKFactory.cpp @@ -52,18 +52,12 @@ bool TSBKFactory::m_warnCRC = false; /// /// Initializes a new instance of the TSBKFactory class. /// -TSBKFactory::TSBKFactory() -{ - /* stub */ -} +TSBKFactory::TSBKFactory() = default; /// /// Finalizes a instance of TSBKFactory class. /// -TSBKFactory::~TSBKFactory() -{ - /* stub */ -} +TSBKFactory::~TSBKFactory() = default; /// /// Create an instance of a TSBK. diff --git a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_ACK_RSP.cpp b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_ACK_RSP.cpp index 8c8e7a4d..db9077b0 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_ACK_RSP.cpp +++ b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_ACK_RSP.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/mbt/MBT_IOSP_ACK_RSP.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -97,8 +94,6 @@ void MBT_IOSP_ACK_RSP::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserD /// std::string MBT_IOSP_ACK_RSP::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_ACK_RSP (Acknowledge Response - Unit)"); - else - return std::string("TSBK_IOSP_ACK_RSP (Acknowledge Response - FNE)"); + if (isp) return std::string("TSBK_IOSP_ACK_RSP (Acknowledge Response - Unit)"); + else return std::string("TSBK_IOSP_ACK_RSP (Acknowledge Response - FNE)"); } diff --git a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_ACK_RSP.h b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_ACK_RSP.h index 1f6c3b89..6f396c03 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_ACK_RSP.h +++ b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_ACK_RSP.h @@ -52,7 +52,7 @@ namespace p25 void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_CALL_ALRT.cpp b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_CALL_ALRT.cpp index 32eb2b86..6382c117 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_CALL_ALRT.cpp +++ b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_CALL_ALRT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/mbt/MBT_IOSP_CALL_ALRT.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -95,8 +92,6 @@ void MBT_IOSP_CALL_ALRT::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUse /// std::string MBT_IOSP_CALL_ALRT::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_CALL_ALRT (Call Alert Request)"); - else - return std::string("TSBK_IOSP_CALL_ALRT (Call Alert)"); + if (isp) return std::string("TSBK_IOSP_CALL_ALRT (Call Alert Request)"); + else return std::string("TSBK_IOSP_CALL_ALRT (Call Alert)"); } diff --git a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_CALL_ALRT.h b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_CALL_ALRT.h index 675f94ef..09ff3857 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_CALL_ALRT.h +++ b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_CALL_ALRT.h @@ -52,7 +52,7 @@ namespace p25 void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_EXT_FNCT.cpp b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_EXT_FNCT.cpp index 4f0b9d63..9eef9fad 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_EXT_FNCT.cpp +++ b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_EXT_FNCT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/mbt/MBT_IOSP_EXT_FNCT.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -97,10 +94,8 @@ void MBT_IOSP_EXT_FNCT::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUser /// std::string MBT_IOSP_EXT_FNCT::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_EXT_FNCT (Extended Function Response)"); - else - return std::string("TSBK_IOSP_EXT_FNCT (Extended Function Command)"); + if (isp) return std::string("TSBK_IOSP_EXT_FNCT (Extended Function Response)"); + else return std::string("TSBK_IOSP_EXT_FNCT (Extended Function Command)"); } // --------------------------------------------------------------------------- diff --git a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_EXT_FNCT.h b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_EXT_FNCT.h index 7e2c3068..28036c86 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_EXT_FNCT.h +++ b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_EXT_FNCT.h @@ -52,7 +52,7 @@ namespace p25 void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Extended function opcode. diff --git a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_GRP_AFF.cpp b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_GRP_AFF.cpp index 1bcaff14..146583a0 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_GRP_AFF.cpp +++ b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_GRP_AFF.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/mbt/MBT_IOSP_GRP_AFF.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -95,8 +92,6 @@ void MBT_IOSP_GRP_AFF::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserD /// std::string MBT_IOSP_GRP_AFF::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_GRP_AFF (Group Affiliation Request)"); - else - return std::string("TSBK_IOSP_GRP_AFF (Group Affiliation Response)"); + if (isp) return std::string("TSBK_IOSP_GRP_AFF (Group Affiliation Request)"); + else return std::string("TSBK_IOSP_GRP_AFF (Group Affiliation Response)"); } diff --git a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_GRP_AFF.h b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_GRP_AFF.h index 2dfb3290..551d48b2 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_GRP_AFF.h +++ b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_GRP_AFF.h @@ -52,7 +52,7 @@ namespace p25 void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_MSG_UPDT.cpp b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_MSG_UPDT.cpp index 9670f50a..8662c3de 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_MSG_UPDT.cpp +++ b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_MSG_UPDT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/mbt/MBT_IOSP_MSG_UPDT.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -97,10 +94,8 @@ void MBT_IOSP_MSG_UPDT::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUser /// std::string MBT_IOSP_MSG_UPDT::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_MSG_UPDT (Message Update Request)"); - else - return std::string("TSBK_IOSP_MSG_UPDT (Message Update)"); + if (isp) return std::string("TSBK_IOSP_MSG_UPDT (Message Update Request)"); + else return std::string("TSBK_IOSP_MSG_UPDT (Message Update)"); } // --------------------------------------------------------------------------- diff --git a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_MSG_UPDT.h b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_MSG_UPDT.h index ce1e3eb8..9c96b913 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_MSG_UPDT.h +++ b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_MSG_UPDT.h @@ -52,7 +52,7 @@ namespace p25 void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Message value. diff --git a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_STS_UPDT.cpp b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_STS_UPDT.cpp index 92dcfbe2..d4cfea7c 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_STS_UPDT.cpp +++ b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_STS_UPDT.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/mbt/MBT_IOSP_STS_UPDT.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -97,10 +94,8 @@ void MBT_IOSP_STS_UPDT::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUser /// std::string MBT_IOSP_STS_UPDT::toString(bool isp) { - if (isp) - return std::string("TSBK_IOSP_STS_UPDT (Status Update Request)"); - else - return std::string("TSBK_IOSP_STS_UPDT (Status Update)"); + if (isp) return std::string("TSBK_IOSP_STS_UPDT (Status Update Request)"); + else return std::string("TSBK_IOSP_STS_UPDT (Status Update)"); } // --------------------------------------------------------------------------- diff --git a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_STS_UPDT.h b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_STS_UPDT.h index 48ce22b8..eb3956c9 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_IOSP_STS_UPDT.h +++ b/src/common/p25/lc/tsbk/mbt/MBT_IOSP_STS_UPDT.h @@ -52,7 +52,7 @@ namespace p25 void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /// Status value. diff --git a/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_RESP_M.cpp b/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_RESP_M.cpp index ee6d9224..e35efbaf 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_RESP_M.cpp +++ b/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_RESP_M.cpp @@ -26,14 +26,12 @@ #include "Defines.h" #include "p25/lc/tsbk/mbt/MBT_ISP_AUTH_RESP_M.h" #include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -42,7 +40,8 @@ using namespace p25; /// /// Initializes a new instance of the MBT_ISP_AUTH_RESP_M class. /// -MBT_ISP_AUTH_RESP_M::MBT_ISP_AUTH_RESP_M() : AMBT() +MBT_ISP_AUTH_RESP_M::MBT_ISP_AUTH_RESP_M() : AMBT(), + m_authStandalone(false) { m_lco = TSBK_ISP_AUTH_RESP_M; @@ -88,7 +87,7 @@ bool MBT_ISP_AUTH_RESP_M::decodeMBT(const data::DataHeader& dataHeader, const da ulong64_t tsbkValue = AMBT::toValue(dataHeader, pduUserData); if (dataHeader.getBlocksToFollow() != 2) { - LogError(LOG_P25, "TSBK::decodeMBT(), PDU does not contain the appropriate amount of data blocks"); + LogError(LOG_P25, "MBT_ISP_AUTH_RESP_M::decodeMBT(), PDU does not contain the appropriate amount of data blocks"); return false; } diff --git a/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_RESP_M.h b/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_RESP_M.h index 1e768f43..949970da 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_RESP_M.h +++ b/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_RESP_M.h @@ -45,7 +45,7 @@ namespace p25 /// Initializes a new instance of the MBT_ISP_AUTH_RESP_M class. MBT_ISP_AUTH_RESP_M(); /// Finalizes a instance of the MBT_ISP_AUTH_RESP_M class. - ~MBT_ISP_AUTH_RESP_M(); + ~MBT_ISP_AUTH_RESP_M() override; /// Decode a alternate trunking signalling block. bool decodeMBT(const data::DataHeader& dataHeader, const data::DataBlock* blocks) override; @@ -53,7 +53,7 @@ namespace p25 void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = true) override; /** Authentication data */ /// Gets the authentication result. diff --git a/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_SU_DMD.cpp b/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_SU_DMD.cpp index 49878b15..b6651a26 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_SU_DMD.cpp +++ b/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_SU_DMD.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/mbt/MBT_ISP_AUTH_SU_DMD.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members diff --git a/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_SU_DMD.h b/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_SU_DMD.h index acae6d52..3d4f6e96 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_SU_DMD.h +++ b/src/common/p25/lc/tsbk/mbt/MBT_ISP_AUTH_SU_DMD.h @@ -51,7 +51,7 @@ namespace p25 void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = true) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/mbt/MBT_ISP_CAN_SRV_REQ.cpp b/src/common/p25/lc/tsbk/mbt/MBT_ISP_CAN_SRV_REQ.cpp index d3b0c183..07d90db0 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_ISP_CAN_SRV_REQ.cpp +++ b/src/common/p25/lc/tsbk/mbt/MBT_ISP_CAN_SRV_REQ.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/mbt/MBT_ISP_CAN_SRV_REQ.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members diff --git a/src/common/p25/lc/tsbk/mbt/MBT_ISP_CAN_SRV_REQ.h b/src/common/p25/lc/tsbk/mbt/MBT_ISP_CAN_SRV_REQ.h index 0f915ad0..b5a7454f 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_ISP_CAN_SRV_REQ.h +++ b/src/common/p25/lc/tsbk/mbt/MBT_ISP_CAN_SRV_REQ.h @@ -51,7 +51,7 @@ namespace p25 void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = true) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/mbt/MBT_OSP_ADJ_STS_BCAST.cpp b/src/common/p25/lc/tsbk/mbt/MBT_OSP_ADJ_STS_BCAST.cpp index 1c575f9f..df5e860e 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_OSP_ADJ_STS_BCAST.cpp +++ b/src/common/p25/lc/tsbk/mbt/MBT_OSP_ADJ_STS_BCAST.cpp @@ -26,14 +26,12 @@ #include "Defines.h" #include "p25/lc/tsbk/mbt/MBT_OSP_ADJ_STS_BCAST.h" #include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -44,6 +42,7 @@ using namespace p25; /// MBT_OSP_ADJ_STS_BCAST::MBT_OSP_ADJ_STS_BCAST() : AMBT(), m_adjCFVA(P25_CFVA_FAILURE), + m_adjSysId(0U), m_adjRfssId(0U), m_adjSiteId(0U), m_adjChannelId(0U), @@ -104,9 +103,9 @@ void MBT_OSP_ADJ_STS_BCAST::encodeMBT(data::DataHeader& dataHeader, uint8_t* pdu pduUserData[7U] = (m_siteData.netId() & 0x0FU) << 4; // Network ID (b3-b0) } else { - LogError(LOG_P25, "TSBK::encodeMBT(), invalid values for OSP_ADJ_STS_BCAST, adjRfssId = $%02X, adjSiteId = $%02X, adjChannelId = %u, adjChannelNo = $%02X, adjSvcClass = $%02X", + LogError(LOG_P25, "MBT_OSP_ADJ_STS_BCAST::encodeMBT(), invalid values for OSP_ADJ_STS_BCAST, adjRfssId = $%02X, adjSiteId = $%02X, adjChannelId = %u, adjChannelNo = $%02X, adjSvcClass = $%02X", m_adjRfssId, m_adjSiteId, m_adjChannelId, m_adjChannelNo, m_adjServiceClass); - return; // blatently ignore creating this TSBK + return; // blatantly ignore creating this TSBK } AMBT::encode(dataHeader, pduUserData); @@ -135,6 +134,7 @@ void MBT_OSP_ADJ_STS_BCAST::copy(const MBT_OSP_ADJ_STS_BCAST& data) TSBK::copy(data); m_adjCFVA = data.m_adjCFVA; + m_adjSysId = data.m_adjSysId; m_adjRfssId = data.m_adjRfssId; m_adjSiteId = data.m_adjSiteId; m_adjChannelId = data.m_adjChannelId; diff --git a/src/common/p25/lc/tsbk/mbt/MBT_OSP_ADJ_STS_BCAST.h b/src/common/p25/lc/tsbk/mbt/MBT_OSP_ADJ_STS_BCAST.h index a21e8932..a780aa8c 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_OSP_ADJ_STS_BCAST.h +++ b/src/common/p25/lc/tsbk/mbt/MBT_OSP_ADJ_STS_BCAST.h @@ -51,7 +51,7 @@ namespace p25 void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; public: /** Adjacent Site Data */ diff --git a/src/common/p25/lc/tsbk/mbt/MBT_OSP_AUTH_DMD.cpp b/src/common/p25/lc/tsbk/mbt/MBT_OSP_AUTH_DMD.cpp index 9e6bbeec..91c9ee1d 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_OSP_AUTH_DMD.cpp +++ b/src/common/p25/lc/tsbk/mbt/MBT_OSP_AUTH_DMD.cpp @@ -25,7 +25,6 @@ */ #include "Defines.h" #include "p25/lc/tsbk/mbt/MBT_OSP_AUTH_DMD.h" -#include "Log.h" #include "Utils.h" using namespace p25::lc::tsbk; @@ -33,7 +32,6 @@ using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members diff --git a/src/common/p25/lc/tsbk/mbt/MBT_OSP_AUTH_DMD.h b/src/common/p25/lc/tsbk/mbt/MBT_OSP_AUTH_DMD.h index cc2f8d22..10928ada 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_OSP_AUTH_DMD.h +++ b/src/common/p25/lc/tsbk/mbt/MBT_OSP_AUTH_DMD.h @@ -45,7 +45,7 @@ namespace p25 /// Initializes a new instance of the MBT_OSP_AUTH_DMD class. MBT_OSP_AUTH_DMD(); /// Finalizes a instance of the MBT_OSP_AUTH_DMD class. - ~MBT_OSP_AUTH_DMD(); + ~MBT_OSP_AUTH_DMD() override; /// Decode a alternate trunking signalling block. bool decodeMBT(const data::DataHeader& dataHeader, const data::DataBlock* blocks) override; @@ -53,7 +53,7 @@ namespace p25 void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; /// Sets the authentication random seed. void setAuthRS(const uint8_t* rs); diff --git a/src/common/p25/lc/tsbk/mbt/MBT_OSP_NET_STS_BCAST.cpp b/src/common/p25/lc/tsbk/mbt/MBT_OSP_NET_STS_BCAST.cpp index 1dd994f2..5184c195 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_OSP_NET_STS_BCAST.cpp +++ b/src/common/p25/lc/tsbk/mbt/MBT_OSP_NET_STS_BCAST.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/mbt/MBT_OSP_NET_STS_BCAST.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members diff --git a/src/common/p25/lc/tsbk/mbt/MBT_OSP_NET_STS_BCAST.h b/src/common/p25/lc/tsbk/mbt/MBT_OSP_NET_STS_BCAST.h index 7b14a118..9241d1f4 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_OSP_NET_STS_BCAST.h +++ b/src/common/p25/lc/tsbk/mbt/MBT_OSP_NET_STS_BCAST.h @@ -51,7 +51,7 @@ namespace p25 void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/p25/lc/tsbk/mbt/MBT_OSP_RFSS_STS_BCAST.cpp b/src/common/p25/lc/tsbk/mbt/MBT_OSP_RFSS_STS_BCAST.cpp index f83f9f04..89d83354 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_OSP_RFSS_STS_BCAST.cpp +++ b/src/common/p25/lc/tsbk/mbt/MBT_OSP_RFSS_STS_BCAST.cpp @@ -25,15 +25,12 @@ */ #include "Defines.h" #include "p25/lc/tsbk/mbt/MBT_OSP_RFSS_STS_BCAST.h" -#include "Log.h" -#include "Utils.h" using namespace p25::lc::tsbk; using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members diff --git a/src/common/p25/lc/tsbk/mbt/MBT_OSP_RFSS_STS_BCAST.h b/src/common/p25/lc/tsbk/mbt/MBT_OSP_RFSS_STS_BCAST.h index d0868cab..68ce8f8a 100644 --- a/src/common/p25/lc/tsbk/mbt/MBT_OSP_RFSS_STS_BCAST.h +++ b/src/common/p25/lc/tsbk/mbt/MBT_OSP_RFSS_STS_BCAST.h @@ -51,7 +51,7 @@ namespace p25 void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/common/yaml/Yaml.cpp b/src/common/yaml/Yaml.cpp index b5d0ab26..f3991d26 100644 --- a/src/common/yaml/Yaml.cpp +++ b/src/common/yaml/Yaml.cpp @@ -177,9 +177,7 @@ namespace yaml /// /// Finalizes a new instance of the TypeImp class. /// - virtual ~TypeImp() - { - } + virtual ~TypeImp() = default; /// /// @@ -231,7 +229,7 @@ namespace yaml /// /// Finalizes a new instance of the SequenceImp class. /// - ~SequenceImp() + ~SequenceImp() override { for (auto it = m_Sequence.begin(); it != m_Sequence.end(); it++) { delete it->second; @@ -240,7 +238,7 @@ namespace yaml /// /// - virtual const std::string & getData() const + virtual const std::string& getData() const { return g_EmptyString; } @@ -368,7 +366,7 @@ namespace yaml /// /// Finalizes a new instance of the SequenceImp class. /// - ~MapImp() + ~MapImp() override { for (auto it = m_Map.begin(); it != m_Map.end(); it++) { delete it->second; @@ -468,7 +466,7 @@ namespace yaml /// /// Finalizes a new instance of the ScalarImp class. /// - ~ScalarImp() + ~ScalarImp() override { /* stub */ } @@ -629,10 +627,7 @@ namespace yaml /// /// Finalizes a new instance of the IteratorImp class. /// - virtual ~IteratorImp() - { - /* stub */ - } + virtual ~IteratorImp() = default; /// /// @@ -660,31 +655,31 @@ namespace yaml public: /// /// - virtual Node::eType type() const + Node::eType type() const override { return Node::SequenceType; } /// /// - virtual void initBegin(SequenceImp* pSequenceImp) + void initBegin(SequenceImp* pSequenceImp) override { m_Iterator = pSequenceImp->m_Sequence.begin(); } /// /// - virtual void initEnd(SequenceImp* pSequenceImp) + void initEnd(SequenceImp* pSequenceImp) override { m_Iterator = pSequenceImp->m_Sequence.end(); } /// /// - virtual void initBegin(MapImp* pMapImp) + void initBegin(MapImp* pMapImp) override { /* stub */ } /// /// - virtual void initEnd(MapImp* pMapImp) + void initEnd(MapImp* pMapImp) override { /* stub */ } @@ -708,31 +703,31 @@ namespace yaml public: /// /// - virtual Node::eType type() const + Node::eType type() const override { return Node::MapType; } /// /// - virtual void initBegin(SequenceImp* pSequenceImp) + void initBegin(SequenceImp* pSequenceImp) override { /* stub */ } /// /// - virtual void initEnd(SequenceImp* pSequenceImp) + void initEnd(SequenceImp* pSequenceImp) override { /* stub */ } /// /// - virtual void initBegin(MapImp* pMapImp) + void initBegin(MapImp* pMapImp) override { m_Iterator = pMapImp->m_Map.begin(); } /// /// - virtual void initEnd(MapImp* pMapImp) + void initEnd(MapImp* pMapImp) override { m_Iterator = pMapImp->m_Map.end(); } @@ -756,31 +751,31 @@ namespace yaml public: /// /// - virtual Node::eType type() const + Node::eType type() const override { return Node::SequenceType; } /// /// - virtual void initBegin(SequenceImp* pSequenceImp) + void initBegin(SequenceImp* pSequenceImp) override { m_Iterator = pSequenceImp->m_Sequence.begin(); } /// /// - virtual void initEnd(SequenceImp* pSequenceImp) + void initEnd(SequenceImp* pSequenceImp) override { m_Iterator = pSequenceImp->m_Sequence.end(); } /// /// - virtual void initBegin(MapImp* pMapImp) + void initBegin(MapImp* pMapImp) override { /* stub */ } /// /// - virtual void initEnd(MapImp* pMapImp) + void initEnd(MapImp* pMapImp) override { /* stub */ } @@ -804,31 +799,31 @@ namespace yaml public: /// /// - virtual Node::eType type() const + Node::eType type() const override { return Node::MapType; } /// /// - virtual void initBegin(SequenceImp* pSequenceImp) + void initBegin(SequenceImp* pSequenceImp) override { /* stub */ } /// /// - virtual void initEnd(SequenceImp* pSequenceImp) + void initEnd(SequenceImp* pSequenceImp) override { /* stub */ } /// /// - virtual void initBegin(MapImp* pMapImp) + void initBegin(MapImp* pMapImp) override { m_Iterator = pMapImp->m_Map.begin(); } /// /// - virtual void initEnd(MapImp* pMapImp) + void initEnd(MapImp* pMapImp) override { m_Iterator = pMapImp->m_Map.end(); } @@ -887,7 +882,7 @@ namespace yaml } /// Assignment operator. - Iterator& Iterator::operator = (const Iterator& it) + Iterator& Iterator::operator= (const Iterator& it) { if (m_pImp) { switch (m_Type) { @@ -945,7 +940,7 @@ namespace yaml } /// Post-increment operator. - Iterator& Iterator::operator ++ (int dummy) + Iterator& Iterator::operator++ (int dummy) { switch (m_Type) { case SequenceType: @@ -961,7 +956,7 @@ namespace yaml } /// Post-decrement operator. - Iterator& Iterator::operator -- (int dummy) + Iterator& Iterator::operator-- (int dummy) { switch(m_Type) { case SequenceType: @@ -977,7 +972,7 @@ namespace yaml } /// Check if iterator is equal to other iterator. - bool Iterator::operator == (const Iterator& it) + bool Iterator::operator== (const Iterator& it) { if (m_Type != it.m_Type) { return false; @@ -998,7 +993,7 @@ namespace yaml } /// Check if iterator is not equal to other iterator. - bool Iterator::operator != (const Iterator& it) + bool Iterator::operator!= (const Iterator& it) { return !(*this == it); } @@ -1047,7 +1042,7 @@ namespace yaml } /// Assignment operator. - ConstIterator& ConstIterator::operator = (const ConstIterator& it) + ConstIterator& ConstIterator::operator= (const ConstIterator& it) { if (m_pImp) { switch (m_Type) { @@ -1104,7 +1099,7 @@ namespace yaml } /// Post-increment operator. - ConstIterator& ConstIterator::operator ++ (int dummy) + ConstIterator& ConstIterator::operator++ (int dummy) { switch (m_Type) { case SequenceType: @@ -1120,7 +1115,7 @@ namespace yaml } /// Post-decrement operator. - ConstIterator& ConstIterator::operator -- (int dummy) + ConstIterator& ConstIterator::operator-- (int dummy) { switch (m_Type) { case SequenceType: @@ -1136,7 +1131,7 @@ namespace yaml } /// Check if iterator is equal to other iterator. - bool ConstIterator::operator == (const ConstIterator& it) + bool ConstIterator::operator== (const ConstIterator& it) { if (m_Type != it.m_Type) { return false; @@ -1157,7 +1152,7 @@ namespace yaml } /// Check if iterator is not equal to other iterator. - bool ConstIterator::operator != (const ConstIterator & it) + bool ConstIterator::operator!= (const ConstIterator & it) { return !(*this == it); } @@ -1331,21 +1326,21 @@ namespace yaml } /// Assignment operator. - Node& Node::operator = (const Node& node) + Node& Node::operator= (const Node& node) { NODE_IMP->clear(); CopyNode(node, *this); return *this; } /// Assignment operator. - Node& Node::operator = (const std::string& value) + Node& Node::operator= (const std::string& value) { NODE_IMP->initScalar(); TYPE_IMP->setData(value); return *this; } /// Assignment operator. - Node& Node::operator = (const char* value) + Node& Node::operator= (const char* value) { NODE_IMP->initScalar(); TYPE_IMP->setData(value ? std::string(value) : ""); @@ -1505,8 +1500,7 @@ namespace yaml /* stub */ } - enum eFlag - { + enum eFlag { LiteralScalarFlag, // Literal scalar type, defined as "|". FoldedScalarFlag, // Folded scalar type, defined as "<". ScalarNewlineFlag // Scalar ends with a newline. @@ -1573,7 +1567,7 @@ namespace yaml // --------------------------------------------------------------------------- // Class Declaration // Implementation class of Yaml parsing. - // Parsing incoming streamand outputs a root node. + // Parsing incoming stream and outputs a root node. // --------------------------------------------------------------------------- class ParseImp { @@ -1581,10 +1575,7 @@ namespace yaml /// /// Initializes a new instance of the ParseImp class. /// - ParseImp() - { - /* stub */ - } + ParseImp() = default; /// /// Finalizes a new instance of the ParseImp class. /// @@ -1646,7 +1637,7 @@ namespace yaml } // start of document - if (documentStartFound == false && line == "---") { + if (!documentStartFound && line == "---") { // erase all lines before this line clearLines(); documentStartFound = true; @@ -1695,7 +1686,7 @@ namespace yaml } // add line - if (foundFirstNotEmpty == false) { + if (!foundFirstNotEmpty) { if (line.size()) { foundFirstNotEmpty = true; } @@ -1714,12 +1705,12 @@ namespace yaml { for (auto it = m_Lines.begin(); it != m_Lines.end();) { // sequence - if (postProcessSequenceLine(it) == true) { + if (postProcessSequenceLine(it)) { continue; } // mapping - if (postProcessMappingLine(it) == true) { + if (postProcessMappingLine(it)) { continue; } @@ -1755,7 +1746,7 @@ namespace yaml ReaderLine* pLine = *it; // sequence split - if (isSequenceStart(pLine->Data) == false) { + if (!isSequenceStart(pLine->Data)) { return false; } @@ -1824,7 +1815,7 @@ namespace yaml } // make sure the value is not a sequence start - if (isSequenceStart(value) == true) { + if (isSequenceStart(value)) { throw ParsingException(ExceptionMessage(g_ErrorBlockSequenceNotAllowed, *pLine, valueStart)); } @@ -1848,7 +1839,7 @@ namespace yaml // add new line with value unsigned char dummyBlockFlags = 0; - if (isBlockScalar(value, pLine->No, dummyBlockFlags) == true) { + if (isBlockScalar(value, pLine->No, dummyBlockFlags)) { newLineOffset = pLine->Offset; } @@ -1960,7 +1951,7 @@ namespace yaml } // check next line; if sequence and correct level, go on, else exit - // if same level but but of type map = error + // if same level but of type map = error if (it == m_Lines.end() || ((pNextLine = *it)->Offset < pLine->Offset)) { break; } @@ -2008,7 +1999,7 @@ namespace yaml } // check next line; if map and correct level, go on, else exit - // if same level but but of type map = error + // if same level but of type map = error if (it == m_Lines.end() || ((pNextLine = *it)->Offset < pLine->Offset)) { break; } @@ -2056,7 +2047,7 @@ namespace yaml } // not a block scalar, cut end spaces/tabs - if (blockScalar == false) { + if (!blockScalar) { while (true) { pLine = *it; if (parentOffset != 0 && pLine->Offset <= parentOffset) { @@ -2071,7 +2062,7 @@ namespace yaml data += pLine->Data.substr(0, endOffset + 1); } - // Move to next line + // move to next line ++it; if (it == m_Lines.end() || (*it)->Type != Node::ScalarType) { break; @@ -2080,7 +2071,7 @@ namespace yaml data += " "; } - if (ValidateQuote(data) == false) { + if (!ValidateQuote(data)) { throw ParsingException(ExceptionMessage(g_ErrorInvalidQuote, *pFirstLine)); } } @@ -2250,7 +2241,7 @@ namespace yaml bool Parse(Node& root, const char* filename) { std::ifstream f(filename, std::ifstream::binary); - if (f.is_open() == false) { + if (!f.is_open()) { throw OperationException(g_ErrorCannotOpenFile); } @@ -2337,7 +2328,7 @@ namespace yaml Serialize(root, stream, config); std::ofstream f(filename); - if (f.is_open() == false) { + if (!f.is_open()) { throw OperationException(g_ErrorCannotOpenFile); } @@ -2403,7 +2394,7 @@ namespace yaml } stream << std::string(level, ' ') << "- "; useLevel = false; - if (value.isSequence() || (value.isMap() && config.SequenceMapNewline == true)) { + if (value.isSequence() || (value.isMap() && config.SequenceMapNewline)) { useLevel = true; stream << "\n"; } @@ -2437,7 +2428,7 @@ namespace yaml useLevel = false; - if (value.isScalar() == false || (value.isScalar() && config.MapScalarNewline)) { + if (!value.isScalar() || (value.isScalar() && config.MapScalarNewline)) { useLevel = true; stream << "\n"; } @@ -2464,7 +2455,7 @@ namespace yaml std::string line = ""; std::vector lines; std::istringstream iss(value); - while (iss.eof() == false) { + while (!iss.eof()) { std::getline(iss, line); lines.push_back(line); } @@ -2501,7 +2492,7 @@ namespace yaml } } - if (endNewline == false) { + if (!endNewline) { stream << "-"; } stream << "\n"; @@ -2581,7 +2572,7 @@ namespace yaml const char token = input[qPos]; if (token == '"' && (qPos == 0 || input[qPos-1] != '\\')) { // found start quote - if (foundStart == false) { + if (!foundStart) { start = qPos; foundStart = true; } diff --git a/src/fne/ActivityLog.cpp b/src/fne/ActivityLog.cpp index 7fae9a05..62cfe329 100644 --- a/src/fne/ActivityLog.cpp +++ b/src/fne/ActivityLog.cpp @@ -24,21 +24,16 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "ActivityLog.h" -#include "common/network/BaseNetwork.h" #include "common/Log.h" // for CurrentLogFileLevel() and LogGetNetwork() -#include - #if defined(CATCH2_TEST_COMPILATION) #include #endif #include -#include #include #include #include -#include // --------------------------------------------------------------------------- // Constants diff --git a/src/fne/FNEMain.cpp b/src/fne/FNEMain.cpp index 2a82f63f..d822f239 100644 --- a/src/fne/FNEMain.cpp +++ b/src/fne/FNEMain.cpp @@ -41,14 +41,10 @@ using namespace lookups; #include #include -#include -#include #include -#include -#include // --------------------------------------------------------------------------- -// Macros +// Macros // --------------------------------------------------------------------------- #define IS(s) (::strcmp(argv[i], s) == 0) @@ -167,7 +163,7 @@ int checkArgs(int argc, char* argv[]) usage("error: %s", "must specify the configuration file to use"); g_iniFile = std::string(argv[++i]); - if (g_iniFile == "") + if (g_iniFile.empty()) usage("error: %s", "configuration file cannot be blank!"); p += 2; diff --git a/src/fne/HostFNE.cpp b/src/fne/HostFNE.cpp index cfb1dc60..a6428b00 100644 --- a/src/fne/HostFNE.cpp +++ b/src/fne/HostFNE.cpp @@ -28,7 +28,6 @@ #include "common/Log.h" #include "common/StopWatch.h" #include "common/Thread.h" -#include "common/Utils.h" #include "network/fne/TagDMRData.h" #include "network/fne/TagP25Data.h" #include "network/fne/TagNXDNData.h" @@ -40,15 +39,10 @@ using namespace network; using namespace lookups; #include -#include #include #include -#include -#include #include -#include -#include #include // --------------------------------------------------------------------------- @@ -88,10 +82,7 @@ HostFNE::HostFNE(const std::string& confFile) : /// /// Finalizes a instance of the HostFNE class. /// -HostFNE::~HostFNE() -{ - /* stub */ -} +HostFNE::~HostFNE() = default; /// /// Executes the main FNE processing loop. diff --git a/src/fne/HostFNE.h b/src/fne/HostFNE.h index d481d864..84d79e48 100644 --- a/src/fne/HostFNE.h +++ b/src/fne/HostFNE.h @@ -93,7 +93,7 @@ private: /// Reads basic configuration parameters from the INI. bool readParams(); - /// Initializes REST API serivces. + /// Initializes REST API services. bool initializeRESTAPI(); /// Initializes master FNE network connectivity. bool createMasterNetwork(); diff --git a/src/fne/network/FNENetwork.cpp b/src/fne/network/FNENetwork.cpp index c5f72d0f..04e0d157 100644 --- a/src/fne/network/FNENetwork.cpp +++ b/src/fne/network/FNENetwork.cpp @@ -27,7 +27,6 @@ #include "common/edac/SHA256.h" #include "common/network/json/json.h" #include "common/Log.h" -#include "common/StopWatch.h" #include "common/Utils.h" #include "network/FNENetwork.h" #include "network/fne/TagDMRData.h" @@ -39,9 +38,7 @@ using namespace network; using namespace network::fne; -#include #include -#include #include // --------------------------------------------------------------------------- diff --git a/src/fne/network/FNENetwork.h b/src/fne/network/FNENetwork.h index ff8389d4..707b3251 100644 --- a/src/fne/network/FNENetwork.h +++ b/src/fne/network/FNENetwork.h @@ -60,7 +60,7 @@ namespace network auto operator=(FNEPeerConnection&&) -> FNEPeerConnection& = delete; FNEPeerConnection(FNEPeerConnection&) = delete; - /// Initializes a new insatnce of the FNEPeerConnection class. + /// Initializes a new instance of the FNEPeerConnection class. FNEPeerConnection() : m_id(0U), m_currStreamId(0U), @@ -79,7 +79,7 @@ namespace network { /* stub */ } - /// Initializes a new insatnce of the FNEPeerConnection class. + /// Initializes a new instance of the FNEPeerConnection class. /// Unique ID of this modem on the network. /// /// @@ -156,7 +156,7 @@ namespace network bool debug, bool verbose, bool dmr, bool p25, bool nxdn, uint32_t parrotDelay, bool parrotGrantDemand, bool allowActivityTransfer, bool allowDiagnosticTransfer, uint32_t pingTime, uint32_t updateLookupTime); /// Finalizes a instance of the FNENetwork class. - ~FNENetwork(); + ~FNENetwork() override; /// Gets the current status of the network. NET_CONN_STATUS getStatus() { return m_status; } @@ -174,13 +174,13 @@ namespace network void setPresharedKey(const uint8_t* presharedKey); /// Updates the timer by the passed number of milliseconds. - void clock(uint32_t ms); + void clock(uint32_t ms) override; /// Opens connection to the network. - bool open(); + bool open() override; /// Closes connection to the network. - void close(); + void close() override; private: friend class fne::TagDMRData; diff --git a/src/fne/network/PeerNetwork.cpp b/src/fne/network/PeerNetwork.cpp index b2fd84a7..be5c91e4 100644 --- a/src/fne/network/PeerNetwork.cpp +++ b/src/fne/network/PeerNetwork.cpp @@ -32,7 +32,6 @@ using namespace network; #include #include -#include // --------------------------------------------------------------------------- // Public Class Members diff --git a/src/fne/network/RESTAPI.cpp b/src/fne/network/RESTAPI.cpp index 1d17abff..04f53004 100644 --- a/src/fne/network/RESTAPI.cpp +++ b/src/fne/network/RESTAPI.cpp @@ -28,11 +28,9 @@ #include "common/lookups/AffiliationLookup.h" #include "common/network/json/json.h" #include "common/Log.h" -#include "common/Thread.h" #include "common/Utils.h" #include "fne/network/RESTAPI.h" #include "HostFNE.h" -#include "FNEMain.h" using namespace network; using namespace network::rest; @@ -189,10 +187,7 @@ RESTAPI::RESTAPI(const std::string& address, uint16_t port, const std::string& p /// /// Finalizes a instance of the RESTAPI class. /// -RESTAPI::~RESTAPI() -{ - /* stub */ -} +RESTAPI::~RESTAPI() = default; /// /// Sets the instances of the Radio ID and Talkgroup ID lookup tables. @@ -285,7 +280,7 @@ bool RESTAPI::validateAuth(const HTTPPayload& request, HTTPPayload& reply) #if DEBUG_HTTP_PAYLOAD ::LogDebug(LOG_REST, "RESTAPI::validateAuth() token, host = %s, token = %s", host.c_str(), headerToken.c_str()); #endif - if (headerToken == "") { + if (headerToken.empty()) { errorPayload(reply, "no authentication token", HTTPPayload::UNAUTHORIZED); return false; } diff --git a/src/fne/network/RESTAPI.h b/src/fne/network/RESTAPI.h index fccd0488..6fc9b0a8 100644 --- a/src/fne/network/RESTAPI.h +++ b/src/fne/network/RESTAPI.h @@ -56,7 +56,7 @@ public: /// Initializes a new instance of the RESTAPI class. RESTAPI(const std::string& address, uint16_t port, const std::string& password, HostFNE* host, bool debug); /// Finalizes a instance of the RESTAPI class. - ~RESTAPI(); + ~RESTAPI() override; /// Sets the instances of the Radio ID and Talkgroup ID lookup tables. void setLookups(::lookups::RadioIdLookup* ridLookup, ::lookups::TalkgroupRulesLookup* tidLookup); @@ -91,7 +91,7 @@ private: std::unordered_map m_authTokens; /// - virtual void entry(); + void entry() override; /// Helper to initialize REST API endpoints. void initializeEndpoints(); diff --git a/src/fne/network/fne/TagDMRData.cpp b/src/fne/network/fne/TagDMRData.cpp index 28817196..8625f050 100644 --- a/src/fne/network/fne/TagDMRData.cpp +++ b/src/fne/network/fne/TagDMRData.cpp @@ -66,10 +66,7 @@ TagDMRData::TagDMRData(FNENetwork* network, bool debug) : /// /// Finalizes a instance of the TagDMRData class. /// -TagDMRData::~TagDMRData() -{ - /* stub */ -} +TagDMRData::~TagDMRData() = default; /// /// Process a data frame from the network. @@ -336,7 +333,7 @@ void TagDMRData::routeRewrite(uint8_t* buffer, uint32_t peerId, dmr::data::Data std::unique_ptr lc = fullLC.decode(data + 2U, dataType); if (lc == nullptr) { LogWarning(LOG_NET, "DMR Slot %u, bad LC received from the network, replacing", slotNo); - lc = new_unique(lc::LC, dmrData.getFLCO(), dmrData.getSrcId(), rewriteDstId); + lc = std::make_unique(dmrData.getFLCO(), dmrData.getSrcId(), rewriteDstId); } lc->setDstId(rewriteDstId); @@ -351,7 +348,7 @@ void TagDMRData::routeRewrite(uint8_t* buffer, uint32_t peerId, dmr::data::Data std::unique_ptr lc = fullLC.decodePI(data + 2U); if (lc == nullptr) { LogWarning(LOG_NET, "DMR Slot %u, DT_VOICE_PI_HEADER, bad LC received, replacing", slotNo); - lc = new_unique(lc::PrivacyLC); + lc = std::make_unique(); } lc->setDstId(rewriteDstId); diff --git a/src/fne/network/fne/TagNXDNData.cpp b/src/fne/network/fne/TagNXDNData.cpp index e208d336..d1acdbdc 100644 --- a/src/fne/network/fne/TagNXDNData.cpp +++ b/src/fne/network/fne/TagNXDNData.cpp @@ -27,7 +27,6 @@ #include "common/nxdn/NXDNDefines.h" #include "common/Clock.h" #include "common/Log.h" -#include "common/StopWatch.h" #include "common/Utils.h" #include "network/FNENetwork.h" #include "network/fne/TagNXDNData.h" @@ -38,9 +37,7 @@ using namespace network; using namespace network::fne; using namespace nxdn; -#include #include -#include #include // --------------------------------------------------------------------------- @@ -65,10 +62,7 @@ TagNXDNData::TagNXDNData(FNENetwork* network, bool debug) : /// /// Finalizes a instance of the TagNXDNData class. /// -TagNXDNData::~TagNXDNData() -{ - /* stub */ -} +TagNXDNData::~TagNXDNData() = default; /// /// Process a data frame from the network. diff --git a/src/fne/network/fne/TagP25Data.cpp b/src/fne/network/fne/TagP25Data.cpp index bdb19ac5..3623b91b 100644 --- a/src/fne/network/fne/TagP25Data.cpp +++ b/src/fne/network/fne/TagP25Data.cpp @@ -28,7 +28,6 @@ #include "common/p25/Sync.h" #include "common/Clock.h" #include "common/Log.h" -#include "common/StopWatch.h" #include "common/Thread.h" #include "common/Utils.h" #include "network/FNENetwork.h" @@ -40,9 +39,7 @@ using namespace network; using namespace network::fne; using namespace p25; -#include #include -#include #include // --------------------------------------------------------------------------- @@ -68,10 +65,7 @@ TagP25Data::TagP25Data(FNENetwork* network, bool debug) : /// /// Finalizes a instance of the TagP25Data class. /// -TagP25Data::~TagP25Data() -{ - /* stub */ -} +TagP25Data::~TagP25Data() = default; /// /// Process a data frame from the network. diff --git a/src/host/Console.cpp b/src/host/Console.cpp index d0c098a4..5a807867 100644 --- a/src/host/Console.cpp +++ b/src/host/Console.cpp @@ -52,10 +52,7 @@ Console::Console() : /// /// Finalizes a instance of the Console class. /// -Console::~Console() -{ - /* stub */ -} +Console::~Console() = default; /// /// Opens the terminal console. diff --git a/src/host/Host.Config.cpp b/src/host/Host.Config.cpp index 6b60271f..c652b21b 100644 --- a/src/host/Host.Config.cpp +++ b/src/host/Host.Config.cpp @@ -360,7 +360,7 @@ bool Host::createModem() yaml::Node dmrProtocol = protocolConf["dmr"]; uint32_t dmrQueueSize = dmrProtocol["queueSize"].as(24U); - // clamp queue size to no less then 24 and no greater the 100 + // clamp queue size to no less than 24 and no greater the 100 if (dmrQueueSize < 24U) { LogWarning(LOG_HOST, "DMR queue size must be greater then 24 frames, defaulting to 24 frames!"); dmrQueueSize = 24U; @@ -378,7 +378,7 @@ bool Host::createModem() yaml::Node p25Protocol = protocolConf["p25"]; uint32_t p25QueueSize = p25Protocol["queueSize"].as(12U); - // clamp queue size to no less then 12 and no greater the 100 frames + // clamp queue size to no less than 12 and no greater the 100 frames if (p25QueueSize < 12U) { LogWarning(LOG_HOST, "P25 queue size must be greater then 12 frames, defaulting to 12 frames!"); p25QueueSize = 12U; @@ -396,7 +396,7 @@ bool Host::createModem() yaml::Node nxdnProtocol = protocolConf["nxdn"]; uint32_t nxdnQueueSize = nxdnProtocol["queueSize"].as(31U); - // clamp queue size to no less then 31 and no greater the 50 frames + // clamp queue size to no less than 31 and no greater the 50 frames if (nxdnQueueSize < 31U) { LogWarning(LOG_HOST, "NXDN queue size must be greater then 31 frames, defaulting to 31 frames!"); nxdnQueueSize = 31U; diff --git a/src/host/Host.cpp b/src/host/Host.cpp index b4b95dce..0192ef4f 100644 --- a/src/host/Host.cpp +++ b/src/host/Host.cpp @@ -30,8 +30,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "Defines.h" -#include "common/dmr/DMRUtils.h" -#include "common/p25/P25Utils.h" #include "common/lookups/RSSIInterpolator.h" #include "common/Log.h" #include "common/StopWatch.h" @@ -46,17 +44,12 @@ using namespace modem; using namespace lookups; #include -#include #include #include -#include +#include #include -#include #include -#include -#include -#include // --------------------------------------------------------------------------- // Constants @@ -149,10 +142,7 @@ Host::Host(const std::string& confFile) : /// /// Finalizes a instance of the Host class. /// -Host::~Host() -{ - /* stub */ -} +Host::~Host() = default; /// /// Executes the main modem host processing loop. @@ -427,9 +417,9 @@ int Host::run() g_fireDMRBeacon = true; } - dmr = std::unique_ptr(new dmr::Control(m_authoritative, m_dmrColorCode, callHang, m_dmrQueueSizeBytes, + dmr = std::make_unique(m_authoritative, m_dmrColorCode, callHang, m_dmrQueueSizeBytes, embeddedLCOnly, dumpTAData, m_timeout, m_rfTalkgroupHang, m_modem, m_network, m_duplex, m_ridLookup, m_tidLookup, - m_idenTable, rssi, jitter, dmrDumpDataPacket, dmrRepeatDataPacket, dmrDumpCsbkData, dmrDebug, dmrVerbose)); + m_idenTable, rssi, jitter, dmrDumpDataPacket, dmrRepeatDataPacket, dmrDumpCsbkData, dmrDebug, dmrVerbose); dmr->setOptions(m_conf, m_supervisor, m_voiceChNo, m_voiceChData, m_controlChData, m_dmrNetId, m_siteId, m_channelId, m_channelNo, true); @@ -498,9 +488,9 @@ int Host::run() } } - p25 = std::unique_ptr(new p25::Control(m_authoritative, m_p25NAC, callHang, m_p25QueueSizeBytes, m_modem, + p25 = std::make_unique(m_authoritative, m_p25NAC, callHang, m_p25QueueSizeBytes, m_modem, m_network, m_timeout, m_rfTalkgroupHang, m_duplex, m_ridLookup, m_tidLookup, m_idenTable, rssi, p25DumpDataPacket, - p25RepeatDataPacket, p25DumpTsbkData, p25Debug, p25Verbose)); + p25RepeatDataPacket, p25DumpTsbkData, p25Debug, p25Verbose); p25->setOptions(m_conf, m_supervisor, m_cwCallsign, m_voiceChNo, m_voiceChData, m_controlChData, m_p25NetId, m_sysId, m_p25RfssId, m_siteId, m_channelId, m_channelNo, true); @@ -560,9 +550,9 @@ int Host::run() } } - nxdn = std::unique_ptr(new nxdn::Control(m_authoritative, m_nxdnRAN, callHang, m_nxdnQueueSizeBytes, + nxdn = std::make_unique(m_authoritative, m_nxdnRAN, callHang, m_nxdnQueueSizeBytes, m_timeout, m_rfTalkgroupHang, m_modem, m_network, m_duplex, m_ridLookup, m_tidLookup, m_idenTable, rssi, - nxdnDumpRcchData, nxdnDebug, nxdnVerbose)); + nxdnDumpRcchData, nxdnDebug, nxdnVerbose); nxdn->setOptions(m_conf, m_supervisor, m_cwCallsign, m_voiceChNo, m_voiceChData, m_controlChData, m_siteId, m_sysId, m_channelId, m_channelNo, true); diff --git a/src/host/HostMain.cpp b/src/host/HostMain.cpp index 75b679a0..8aa39fad 100644 --- a/src/host/HostMain.cpp +++ b/src/host/HostMain.cpp @@ -44,14 +44,10 @@ using namespace lookups; #include #include -#include -#include #include -#include -#include // --------------------------------------------------------------------------- -// Macros +// Macros // --------------------------------------------------------------------------- #define IS(s) (::strcmp(argv[i], s) == 0) @@ -212,7 +208,7 @@ int checkArgs(int argc, char* argv[]) usage("error: %s", "must specify the configuration file to use"); g_iniFile = std::string(argv[++i]); - if (g_iniFile == "") + if (g_iniFile.empty()) usage("error: %s", "configuration file cannot be blank!"); p += 2; @@ -225,7 +221,7 @@ int checkArgs(int argc, char* argv[]) usage("error: %s", "must specify the address to connect to"); g_remoteAddress = std::string(argv[++i]); - if (g_remoteAddress == "") + if (g_remoteAddress.empty()) usage("error: %s", "remote address cannot be blank!"); p += 2; diff --git a/src/host/dmr/Control.cpp b/src/host/dmr/Control.cpp index 3b964a85..62c1c6c4 100644 --- a/src/host/dmr/Control.cpp +++ b/src/host/dmr/Control.cpp @@ -32,7 +32,6 @@ using namespace dmr; -#include #include #include diff --git a/src/host/dmr/Control.h b/src/host/dmr/Control.h index 905f012f..be0864fe 100644 --- a/src/host/dmr/Control.h +++ b/src/host/dmr/Control.h @@ -72,11 +72,11 @@ namespace dmr ::lookups::VoiceChData controlChData, 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; } + bool getCCRunning() const { return m_ccRunning; } /// Sets a flag indicating whether the DMR control channel is running. void setCCRunning(bool ccRunning); /// Gets a flag indicating whether the DMR control channel is running. - bool getCCHalted() { return m_ccHalted; } + bool getCCHalted() const { return m_ccHalted; } /// Sets a flag indicating whether the DMR control channel is halted. void setCCHalted(bool ccHalted); diff --git a/src/host/dmr/Slot.cpp b/src/host/dmr/Slot.cpp index 3688368e..b5143aa7 100644 --- a/src/host/dmr/Slot.cpp +++ b/src/host/dmr/Slot.cpp @@ -29,7 +29,6 @@ #include "common/dmr/lc/CSBK.h" #include "common/dmr/SlotType.h" #include "common/dmr/Sync.h" -#include "common/edac/BPTC19696.h" #include "common/edac/CRC.h" #include "common/Log.h" #include "common/Utils.h" @@ -42,7 +41,6 @@ using namespace dmr; using namespace dmr::packet; #include -#include #include #include @@ -700,7 +698,7 @@ void Slot::releaseGrantTG(uint32_t dstId) } /// -/// Touchs a granted TG to keep a channel grant alive. +/// Touches a granted TG to keep a channel grant alive. /// /// void Slot::touchGrantTG(uint32_t dstId) diff --git a/src/host/dmr/Slot.h b/src/host/dmr/Slot.h index 869462a3..1ab24dbb 100644 --- a/src/host/dmr/Slot.h +++ b/src/host/dmr/Slot.h @@ -75,11 +75,11 @@ namespace dmr ~Slot(); /// Gets a flag indicating whether the P25 control channel is running. - bool getCCRunning() { return m_ccRunning; } + bool getCCRunning() const { return m_ccRunning; } /// Sets a flag indicating whether the P25 control channel is running. void setCCRunning(bool ccRunning) { m_ccPrevRunning = m_ccRunning; m_ccRunning = ccRunning; } /// Gets a flag indicating whether the DMR control channel is running. - bool getCCHalted() { return m_ccHalted; } + bool getCCHalted() const { return m_ccHalted; } /// Sets a flag indicating whether the DMR control channel is halted. void setCCHalted(bool ccHalted) { m_ccHalted = ccHalted; } @@ -100,7 +100,7 @@ namespace dmr void grantTG(uint32_t srcId, uint32_t dstId, bool grp); /// Releases a granted TG. void releaseGrantTG(uint32_t dstId); - /// Touchs a granted TG to keep a channel grant alive. + /// Touches a granted TG to keep a channel grant alive. void touchGrantTG(uint32_t dstId); /// Gets instance of the ControlSignaling class. diff --git a/src/host/dmr/lc/csbk/CSBK_DVM_GIT_HASH.cpp b/src/host/dmr/lc/csbk/CSBK_DVM_GIT_HASH.cpp index d9136c37..84ce6ad3 100644 --- a/src/host/dmr/lc/csbk/CSBK_DVM_GIT_HASH.cpp +++ b/src/host/dmr/lc/csbk/CSBK_DVM_GIT_HASH.cpp @@ -24,8 +24,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "Defines.h" -#include "common/Log.h" -#include "common/Utils.h" #include "dmr/lc/csbk/CSBK_DVM_GIT_HASH.h" #include "HostMain.h" @@ -34,7 +32,6 @@ using namespace dmr::lc; using namespace dmr; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -56,7 +53,7 @@ CSBK_DVM_GIT_HASH::CSBK_DVM_GIT_HASH() : CSBK() /// True, if CSBK was decoded, otherwise false. bool CSBK_DVM_GIT_HASH::decode(const uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -69,7 +66,7 @@ bool CSBK_DVM_GIT_HASH::decode(const uint8_t* data) /// void CSBK_DVM_GIT_HASH::encode(uint8_t* data) { - assert(data != NULL); + assert(data != nullptr); ulong64_t csbkValue = 0U; diff --git a/src/host/dmr/lc/csbk/CSBK_DVM_GIT_HASH.h b/src/host/dmr/lc/csbk/CSBK_DVM_GIT_HASH.h index a208c587..4202bf94 100644 --- a/src/host/dmr/lc/csbk/CSBK_DVM_GIT_HASH.h +++ b/src/host/dmr/lc/csbk/CSBK_DVM_GIT_HASH.h @@ -46,12 +46,12 @@ namespace dmr CSBK_DVM_GIT_HASH(); /// Decode a control signalling block. - bool decode(const uint8_t* data); + bool decode(const uint8_t* data) override; /// Encode a control signalling block. - void encode(uint8_t* data); + void encode(uint8_t* data) override; /// Returns a string that represents the current CSBK. - virtual std::string toString() override; + std::string toString() override; }; } // namespace csbk } // namespace lc diff --git a/src/host/dmr/lookups/DMRAffiliationLookup.cpp b/src/host/dmr/lookups/DMRAffiliationLookup.cpp index 358d5e60..a175d917 100644 --- a/src/host/dmr/lookups/DMRAffiliationLookup.cpp +++ b/src/host/dmr/lookups/DMRAffiliationLookup.cpp @@ -29,9 +29,6 @@ using namespace dmr::lookups; #include -#include -#include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -52,10 +49,7 @@ DMRAffiliationLookup::DMRAffiliationLookup(bool verbose) : ::lookups::Affiliatio /// /// Finalizes a instance of the DMRAffiliationLookup class. /// -DMRAffiliationLookup::~DMRAffiliationLookup() -{ - /* stub */ -} +DMRAffiliationLookup::~DMRAffiliationLookup() = default; /// /// Helper to grant a channel. diff --git a/src/host/dmr/lookups/DMRAffiliationLookup.h b/src/host/dmr/lookups/DMRAffiliationLookup.h index 6198d4f4..acaa595f 100644 --- a/src/host/dmr/lookups/DMRAffiliationLookup.h +++ b/src/host/dmr/lookups/DMRAffiliationLookup.h @@ -46,7 +46,7 @@ namespace dmr /// Initializes a new instance of the DMRAffiliationLookup class. DMRAffiliationLookup(bool verbose); /// Finalizes a instance of the DMRAffiliationLookup class. - virtual ~DMRAffiliationLookup(); + ~DMRAffiliationLookup() override; /// Helper to grant a channel. bool grantCh(uint32_t dstId, uint32_t srcId, uint32_t grantTimeout, bool grp, bool netGranted) override; diff --git a/src/host/dmr/packet/ControlSignaling.cpp b/src/host/dmr/packet/ControlSignaling.cpp index f0233029..bc5917a9 100644 --- a/src/host/dmr/packet/ControlSignaling.cpp +++ b/src/host/dmr/packet/ControlSignaling.cpp @@ -619,7 +619,7 @@ void ControlSignaling::processNetwork(const data::Data & dmrData) /// Destination radio ID. void ControlSignaling::writeRF_Ext_Func(uint32_t func, uint32_t arg, uint32_t dstId) { - std::unique_ptr csbk = new_unique(CSBK_EXT_FNCT); + std::unique_ptr csbk = std::make_unique(); csbk->setGI(false); csbk->setExtendedFunction(func); csbk->setSrcId(arg); @@ -651,7 +651,7 @@ void ControlSignaling::writeRF_Ext_Func(uint32_t func, uint32_t arg, uint32_t ds /// Destination radio ID. void ControlSignaling::writeRF_Call_Alrt(uint32_t srcId, uint32_t dstId) { - std::unique_ptr csbk = new_unique(CSBK_CALL_ALRT); + std::unique_ptr csbk = std::make_unique(); csbk->setGI(false); csbk->setSrcId(srcId); csbk->setDstId(dstId); @@ -686,10 +686,7 @@ ControlSignaling::ControlSignaling(Slot * slot, network::BaseNetwork * network, /// /// Finalizes a instance of the ControlSignaling class. /// -ControlSignaling::~ControlSignaling() -{ - /* stub */ -} +ControlSignaling::~ControlSignaling() = default; /* ** Modem Frame Queuing @@ -755,7 +752,7 @@ void ControlSignaling::writeRF_CSBK(lc::CSBK* csbk, bool clearBeforeWrite, bool /// void ControlSignaling::writeRF_CSBK_ACK_RSP(uint32_t dstId, uint8_t reason, uint8_t responseInfo) { - std::unique_ptr csbk = new_unique(CSBK_ACK_RSP); + std::unique_ptr csbk = std::make_unique(); csbk->setResponse(responseInfo); csbk->setReason(reason); csbk->setSrcId(DMR_WUID_ALL); // hmmm... @@ -772,7 +769,7 @@ void ControlSignaling::writeRF_CSBK_ACK_RSP(uint32_t dstId, uint8_t reason, uint /// void ControlSignaling::writeRF_CSBK_NACK_RSP(uint32_t dstId, uint8_t reason, uint8_t service) { - std::unique_ptr csbk = new_unique(CSBK_NACK_RSP); + std::unique_ptr csbk = std::make_unique(); csbk->setServiceKind(service); csbk->setReason(reason); csbk->setSrcId(DMR_WUID_ALL); // hmmm... @@ -950,7 +947,7 @@ bool ControlSignaling::writeRF_CSBK_Grant(uint32_t srcId, uint32_t dstId, uint8_ writeRF_CSBK_ACK_RSP(srcId, TS_ACK_RSN_MSG, (grp) ? 1U : 0U); - std::unique_ptr csbk = new_unique(CSBK_TV_GRANT); + std::unique_ptr csbk = std::make_unique(); if (broadcast) csbk->setCSBKO(CSBKO_BTV_GRANT); csbk->setLogicalCh1(chNo); @@ -1028,7 +1025,7 @@ bool ControlSignaling::writeRF_CSBK_Grant(uint32_t srcId, uint32_t dstId, uint8_ writeRF_CSBK_ACK_RSP(srcId, TS_ACK_RSN_MSG, (grp) ? 1U : 0U); - std::unique_ptr csbk = new_unique(CSBK_PV_GRANT); + std::unique_ptr csbk = std::make_unique(); csbk->setLogicalCh1(chNo); csbk->setSlotNo(slot); @@ -1186,7 +1183,7 @@ bool ControlSignaling::writeRF_CSBK_Data_Grant(uint32_t srcId, uint32_t dstId, u writeRF_CSBK_ACK_RSP(srcId, TS_ACK_RSN_MSG, (grp) ? 1U : 0U); - std::unique_ptr csbk = new_unique(CSBK_TD_GRANT); + std::unique_ptr csbk = std::make_unique(); csbk->setLogicalCh1(chNo); csbk->setSlotNo(slot); @@ -1233,7 +1230,7 @@ bool ControlSignaling::writeRF_CSBK_Data_Grant(uint32_t srcId, uint32_t dstId, u writeRF_CSBK_ACK_RSP(srcId, TS_ACK_RSN_MSG, (grp) ? 1U : 0U); - std::unique_ptr csbk = new_unique(CSBK_PD_GRANT); + std::unique_ptr csbk = std::make_unique(); csbk->setLogicalCh1(chNo); csbk->setSlotNo(slot); @@ -1288,7 +1285,7 @@ void ControlSignaling::writeRF_CSBK_U_Reg_Rsp(uint32_t srcId, uint8_t serviceOpt bool dereg = (serviceOptions & 0x01U) == 0x01U; - std::unique_ptr csbk = new_unique(CSBK_ACK_RSP); + std::unique_ptr csbk = std::make_unique(); if (!dereg) { if (m_verbose) { @@ -1345,7 +1342,7 @@ void ControlSignaling::writeRF_CSBK_Grant_LateEntry(uint32_t dstId, uint32_t src uint8_t slot = m_tscc->m_affiliations->getGrantedSlot(dstId); if (grp) { - std::unique_ptr csbk = new_unique(CSBK_TV_GRANT); + std::unique_ptr csbk = std::make_unique(); csbk->setLogicalCh1(chNo); csbk->setSlotNo(slot); @@ -1358,7 +1355,7 @@ void ControlSignaling::writeRF_CSBK_Grant_LateEntry(uint32_t dstId, uint32_t src } else { /* - std::unique_ptr csbk = new_unique(CSBK_PV_GRANT); + std::unique_ptr csbk = std::make_unique(); csbk->setLogicalCh1(chNo); csbk->setSlotNo(slot); @@ -1380,7 +1377,7 @@ void ControlSignaling::writeRF_CSBK_Grant_LateEntry(uint32_t dstId, uint32_t src /// void ControlSignaling::writeRF_CSBK_Payload_Activate(uint32_t dstId, uint32_t srcId, bool grp, bool voice, bool imm) { - std::unique_ptr csbk = new_unique(CSBK_P_GRANT); + std::unique_ptr csbk = std::make_unique(); if (voice) { if (grp) { csbk->setCSBKO(CSBKO_TV_GRANT); @@ -1425,7 +1422,7 @@ void ControlSignaling::writeRF_CSBK_Payload_Activate(uint32_t dstId, uint32_t sr /// void ControlSignaling::writeRF_CSBK_Payload_Clear(uint32_t dstId, uint32_t srcId, bool grp, bool imm) { - std::unique_ptr csbk = new_unique(CSBK_P_CLEAR); + std::unique_ptr csbk = std::make_unique(); csbk->setGI(grp); @@ -1451,7 +1448,7 @@ void ControlSignaling::writeRF_CSBK_Payload_Clear(uint32_t dstId, uint32_t srcId /// void ControlSignaling::writeRF_TSCC_Aloha() { - std::unique_ptr csbk = new_unique(CSBK_ALOHA); + std::unique_ptr csbk = std::make_unique(); DEBUG_LOG_CSBK(csbk->toString()); csbk->setNRandWait(m_slot->m_alohaNRandWait); csbk->setBackoffNo(m_slot->m_alohaBackOff); @@ -1468,7 +1465,7 @@ void ControlSignaling::writeRF_TSCC_Bcast_Ann_Wd(uint32_t channelNo, bool annWd) { m_slot->m_rfSeqNo = 0U; - std::unique_ptr csbk = new_unique(CSBK_BROADCAST); + std::unique_ptr csbk = std::make_unique(); csbk->siteIdenEntry(m_slot->m_idenEntry); csbk->setCdef(false); csbk->setAnncType(BCAST_ANNC_ANN_WD_TSCC); @@ -1488,7 +1485,7 @@ void ControlSignaling::writeRF_TSCC_Bcast_Ann_Wd(uint32_t channelNo, bool annWd) /// void ControlSignaling::writeRF_TSCC_Bcast_Sys_Parm() { - std::unique_ptr csbk = new_unique(CSBK_BROADCAST); + std::unique_ptr csbk = std::make_unique(); DEBUG_LOG_CSBK(csbk->toString()); csbk->setAnncType(BCAST_ANNC_SITE_PARMS); @@ -1500,7 +1497,7 @@ void ControlSignaling::writeRF_TSCC_Bcast_Sys_Parm() /// void ControlSignaling::writeRF_TSCC_Git_Hash() { - std::unique_ptr csbk = new_unique(CSBK_DVM_GIT_HASH); + std::unique_ptr csbk = std::make_unique(); DEBUG_LOG_CSBK(csbk->toString()); writeRF_CSBK(csbk.get()); diff --git a/src/host/dmr/packet/Data.cpp b/src/host/dmr/packet/Data.cpp index 6970a69f..4a3f7915 100644 --- a/src/host/dmr/packet/Data.cpp +++ b/src/host/dmr/packet/Data.cpp @@ -210,7 +210,7 @@ bool Data::process(uint8_t* data, uint32_t len) m_slot->m_rfFrames = dataHeader->getBlocks(); m_slot->m_rfSeqNo = 0U; - m_slot->m_rfLC = new_unique(lc::LC, gi ? FLCO_GROUP : FLCO_PRIVATE, srcId, dstId); + m_slot->m_rfLC = std::make_unique(gi ? FLCO_GROUP : FLCO_PRIVATE, srcId, dstId); // Regenerate the data header dataHeader->encode(data + 2U); @@ -427,7 +427,7 @@ void Data::processNetwork(const data::Data& dmrData) } m_slot->m_netFrames = dataHeader->getBlocks(); - m_slot->m_netLC = new_unique(lc::LC, gi ? FLCO_GROUP : FLCO_PRIVATE, srcId, dstId); + m_slot->m_netLC = std::make_unique(gi ? FLCO_GROUP : FLCO_PRIVATE, srcId, dstId); // Regenerate the data header dataHeader->encode(data + 2U); diff --git a/src/host/dmr/packet/Voice.cpp b/src/host/dmr/packet/Voice.cpp index 74b6c202..a6913ef6 100644 --- a/src/host/dmr/packet/Voice.cpp +++ b/src/host/dmr/packet/Voice.cpp @@ -248,7 +248,7 @@ bool Voice::process(uint8_t* data, uint32_t len) std::unique_ptr lc = fullLC.decodePI(data + 2U); if (lc == nullptr) { LogWarning(LOG_RF, "DMR Slot %u, DT_VOICE_PI_HEADER, bad LC received, replacing", m_slot->m_slotNo); - lc = new_unique(lc::PrivacyLC); + lc = std::make_unique(); lc->setDstId(m_slot->m_rfLC->getDstId()); } @@ -674,7 +674,7 @@ void Voice::processNetwork(const data::Data& dmrData) std::unique_ptr lc = fullLC.decode(data + 2U, DT_VOICE_LC_HEADER); if (lc == nullptr) { LogWarning(LOG_NET, "DMR Slot %u, DT_VOICE_LC_HEADER, bad LC received from the network, replacing", m_slot->m_slotNo); - lc = new_unique(lc::LC, dmrData.getFLCO(), dmrData.getSrcId(), dmrData.getDstId()); + lc = std::make_unique(dmrData.getFLCO(), dmrData.getSrcId(), dmrData.getDstId()); } uint32_t srcId = lc->getSrcId(); @@ -766,7 +766,7 @@ void Voice::processNetwork(const data::Data& dmrData) } else if (dataType == DT_VOICE_PI_HEADER) { if (m_slot->m_netState != RS_NET_AUDIO) { - std::unique_ptr lc = new_unique(lc::LC, dmrData.getFLCO(), dmrData.getSrcId(), dmrData.getDstId()); + std::unique_ptr lc = std::make_unique(dmrData.getFLCO(), dmrData.getSrcId(), dmrData.getDstId()); uint32_t srcId = lc->getSrcId(); uint32_t dstId = lc->getDstId(); @@ -834,7 +834,7 @@ void Voice::processNetwork(const data::Data& dmrData) std::unique_ptr lc = fullLC.decodePI(data + 2U); if (lc == nullptr) { LogWarning(LOG_NET, "DMR Slot %u, DT_VOICE_PI_HEADER, bad LC received, replacing", m_slot->m_slotNo); - lc = new_unique(lc::PrivacyLC); + lc = std::make_unique(); lc->setDstId(dmrData.getDstId()); } @@ -864,7 +864,7 @@ void Voice::processNetwork(const data::Data& dmrData) } else if (dataType == DT_VOICE_SYNC) { if (m_slot->m_netState == RS_NET_IDLE) { - std::unique_ptr lc = new_unique(lc::LC, dmrData.getFLCO(), dmrData.getSrcId(), dmrData.getDstId()); + std::unique_ptr lc = std::make_unique(dmrData.getFLCO(), dmrData.getSrcId(), dmrData.getDstId()); uint32_t dstId = lc->getDstId(); uint32_t srcId = lc->getSrcId(); diff --git a/src/host/modem/port/IModemPort.cpp b/src/host/modem/port/IModemPort.cpp index b5cd453c..d60ee77b 100644 --- a/src/host/modem/port/IModemPort.cpp +++ b/src/host/modem/port/IModemPort.cpp @@ -38,7 +38,4 @@ using namespace modem::port; /// /// Finalizes a instance of the IModemPort class. /// -IModemPort::~IModemPort() -{ - /* stub */ -} +IModemPort::~IModemPort() = default; diff --git a/src/host/modem/port/ISerialPort.cpp b/src/host/modem/port/ISerialPort.cpp index 03d1820c..6c7819f4 100644 --- a/src/host/modem/port/ISerialPort.cpp +++ b/src/host/modem/port/ISerialPort.cpp @@ -38,7 +38,4 @@ using namespace modem::port; /// /// Finalizes a instance of the ISerialPort class. /// -ISerialPort::~ISerialPort() -{ - /* stub */ -} +ISerialPort::~ISerialPort() = default; diff --git a/src/host/modem/port/ModemNullPort.cpp b/src/host/modem/port/ModemNullPort.cpp index 7d09ec2f..29f1b569 100644 --- a/src/host/modem/port/ModemNullPort.cpp +++ b/src/host/modem/port/ModemNullPort.cpp @@ -56,9 +56,7 @@ ModemNullPort::ModemNullPort() : /// /// Finalizes a instance of the ModemNullPort class. /// -ModemNullPort::~ModemNullPort() -{ -} +ModemNullPort::~ModemNullPort() = default; /// /// Opens a connection to the port. diff --git a/src/host/modem/port/ModemNullPort.h b/src/host/modem/port/ModemNullPort.h index ddb99f51..74b54c0e 100644 --- a/src/host/modem/port/ModemNullPort.h +++ b/src/host/modem/port/ModemNullPort.h @@ -50,18 +50,18 @@ namespace modem /// Initializes a new instance of the ModemNullPort class. ModemNullPort(); /// Finalizes a instance of the ModemNullPort class. - virtual ~ModemNullPort(); + ~ModemNullPort() override; /// Opens a connection to the port. - bool open(); + bool open() override; /// Reads data from the port. - int read(uint8_t* buffer, uint32_t length); + int read(uint8_t* buffer, uint32_t length) override; /// Writes data to the port. - int write(const uint8_t* buffer, uint32_t length); + int write(const uint8_t* buffer, uint32_t length) override; /// Closes the connection to the port. - void close(); + void close() override; private: RingBuffer m_buffer; diff --git a/src/host/modem/port/PseudoPTYPort.cpp b/src/host/modem/port/PseudoPTYPort.cpp index 30b5fda5..34fee52d 100644 --- a/src/host/modem/port/PseudoPTYPort.cpp +++ b/src/host/modem/port/PseudoPTYPort.cpp @@ -32,17 +32,11 @@ #include #include -#include using namespace modem::port; -#include -#include -#include #include -#include #include -#include #if defined(__linux__) #include #else @@ -68,10 +62,7 @@ PseudoPTYPort::PseudoPTYPort(const std::string& symlink, SERIAL_SPEED speed, boo /// /// Finalizes a instance of the PseudoPTYPort class. /// -PseudoPTYPort::~PseudoPTYPort() -{ - /* stub */ -} +PseudoPTYPort::~PseudoPTYPort() = default; /// /// Opens a connection to the serial port. @@ -79,29 +70,29 @@ PseudoPTYPort::~PseudoPTYPort() /// True, if connection is opened, otherwise false. bool PseudoPTYPort::open() { - assert(m_fd == -1); + assert(m_fd == -1); - int slavefd; - char slave[300]; - int result = ::openpty(&m_fd, &slavefd, slave, NULL, NULL); - if (result < 0) { - ::LogError(LOG_HOST, "Cannot open the pseudo tty - errno : %d", errno); - return false; - } + int slavefd; + char slave[300]; + int result = ::openpty(&m_fd, &slavefd, slave, NULL, NULL); + if (result < 0) { + ::LogError(LOG_HOST, "Cannot open the pseudo tty - errno : %d", errno); + return false; + } - // remove any previous stale symlink - ::unlink(m_symlink.c_str()); + // remove any previous stale symlink + ::unlink(m_symlink.c_str()); - int ret = ::symlink(slave, m_symlink.c_str()); - if (ret != 0) { - ::LogError(LOG_HOST, "Cannot make symlink to %s with %s", slave, m_symlink.c_str()); - close(); - return false; - } + int ret = ::symlink(slave, m_symlink.c_str()); + if (ret != 0) { + ::LogError(LOG_HOST, "Cannot make symlink to %s with %s", slave, m_symlink.c_str()); + close(); + return false; + } - ::LogMessage(LOG_HOST, "Made symbolic link from %s to %s", slave, m_symlink.c_str()); - m_device = std::string(::ttyname(m_fd)); - return setTermios(); + ::LogMessage(LOG_HOST, "Made symbolic link from %s to %s", slave, m_symlink.c_str()); + m_device = std::string(::ttyname(m_fd)); + return setTermios(); } /// diff --git a/src/host/modem/port/PseudoPTYPort.h b/src/host/modem/port/PseudoPTYPort.h index 92c0cdb0..08842725 100644 --- a/src/host/modem/port/PseudoPTYPort.h +++ b/src/host/modem/port/PseudoPTYPort.h @@ -51,13 +51,13 @@ namespace modem /// Initializes a new instance of the PseudoPTYPort class. PseudoPTYPort(const std::string& symlink, SERIAL_SPEED speed, bool assertRTS = false); /// Finalizes a instance of the PseudoPTYPort class. - virtual ~PseudoPTYPort(); + ~PseudoPTYPort() override; /// Opens a connection to the serial port. - bool open(); + bool open() override; /// Closes the connection to the serial port. - void close(); + void close() override; protected: std::string m_symlink; diff --git a/src/host/modem/port/UARTPort.cpp b/src/host/modem/port/UARTPort.cpp index 0fc46c6e..4f7a851f 100644 --- a/src/host/modem/port/UARTPort.cpp +++ b/src/host/modem/port/UARTPort.cpp @@ -40,9 +40,7 @@ using namespace modem::port; #include -#include #include -#include #include #include #include @@ -71,9 +69,7 @@ UARTPort::UARTPort(const std::string& device, SERIAL_SPEED speed, bool assertRTS /// /// Finalizes a instance of the UARTPort class. /// -UARTPort::~UARTPort() -{ -} +UARTPort::~UARTPort() = default; /// /// Opens a connection to the serial port. diff --git a/src/host/modem/port/UARTPort.h b/src/host/modem/port/UARTPort.h index 3d8ae448..1a47a99f 100644 --- a/src/host/modem/port/UARTPort.h +++ b/src/host/modem/port/UARTPort.h @@ -70,18 +70,18 @@ namespace modem /// Initializes a new instance of the UARTPort class. UARTPort(const std::string& device, SERIAL_SPEED speed, bool assertRTS = false); /// Finalizes a instance of the UARTPort class. - virtual ~UARTPort(); + ~UARTPort() override; /// Opens a connection to the serial port. - bool open(); + bool open() override; /// Reads data from the serial port. - int read(uint8_t* buffer, uint32_t length); + int read(uint8_t* buffer, uint32_t length) override; /// Writes data to the serial port. - int write(const uint8_t* buffer, uint32_t length); + int write(const uint8_t* buffer, uint32_t length) override; /// Closes the connection to the serial port. - void close(); + void close() override; #if defined(__APPLE__) /// diff --git a/src/host/modem/port/UDPPort.cpp b/src/host/modem/port/UDPPort.cpp index 64d7e2e5..e9dafe7c 100644 --- a/src/host/modem/port/UDPPort.cpp +++ b/src/host/modem/port/UDPPort.cpp @@ -30,7 +30,6 @@ */ #include "Defines.h" #include "common/Log.h" -#include "common/Utils.h" #include "modem/port/UDPPort.h" using namespace modem::port; @@ -76,10 +75,7 @@ UDPPort::UDPPort(const std::string& address, uint16_t modemPort) : /// /// Finalizes a instance of the UDPPort class. /// -UDPPort::~UDPPort() -{ - /* stub */ -} +UDPPort::~UDPPort() = default; /// /// Opens a connection to the port. diff --git a/src/host/modem/port/UDPPort.h b/src/host/modem/port/UDPPort.h index 7fc7c9dc..cdb4ad2d 100644 --- a/src/host/modem/port/UDPPort.h +++ b/src/host/modem/port/UDPPort.h @@ -52,18 +52,18 @@ namespace modem /// Initializes a new instance of the UDPPort class. UDPPort(const std::string& modemAddress, uint16_t modemPort); /// Finalizes a instance of the UDPPort class. - virtual ~UDPPort(); + ~UDPPort() override; /// Opens a connection to the serial port. - bool open(); + bool open() override; /// Reads data from the serial port. - int read(uint8_t* buffer, uint32_t length); + int read(uint8_t* buffer, uint32_t length) override; /// Writes data to the serial port. - int write(const uint8_t* buffer, uint32_t length); + int write(const uint8_t* buffer, uint32_t length) override; /// Closes the connection to the serial port. - void close(); + void close() override; protected: network::UDPSocket m_socket; diff --git a/src/host/network/Network.cpp b/src/host/network/Network.cpp index 3a875efd..1fd70605 100644 --- a/src/host/network/Network.cpp +++ b/src/host/network/Network.cpp @@ -34,7 +34,6 @@ #include "common/network/RTPFNEHeader.h" #include "common/network/json/json.h" #include "common/Log.h" -#include "common/StopWatch.h" #include "common/Utils.h" #include "network/Network.h" @@ -42,7 +41,6 @@ using namespace network; #include #include -#include // --------------------------------------------------------------------------- // Public Class Members diff --git a/src/host/network/Network.h b/src/host/network/Network.h index fc38ed2a..76a9f1fb 100644 --- a/src/host/network/Network.h +++ b/src/host/network/Network.h @@ -52,7 +52,7 @@ namespace network Network(const std::string& address, uint16_t port, uint16_t localPort, uint32_t peerId, const std::string& password, bool duplex, bool debug, bool dmr, bool p25, bool nxdn, bool slot1, bool slot2, bool allowActivityTransfer, bool allowDiagnosticTransfer, bool updateLookup); /// Finalizes a instance of the Network class. - ~Network(); + ~Network() override; /// Resets the DMR ring buffer for the given slot. void resetDMR(uint32_t slotNo) override; @@ -72,13 +72,13 @@ namespace network void setPresharedKey(const uint8_t* presharedKey); /// Updates the timer by the passed number of milliseconds. - void clock(uint32_t ms); + void clock(uint32_t ms) override; /// Opens connection to the network. - bool open(); + bool open() override; /// Closes connection to the network. - void close(); + void close() override; /// Sets flag enabling network communication. void enable(bool enabled); diff --git a/src/host/network/RESTAPI.cpp b/src/host/network/RESTAPI.cpp index 2fb030e5..508f59d2 100644 --- a/src/host/network/RESTAPI.cpp +++ b/src/host/network/RESTAPI.cpp @@ -28,7 +28,6 @@ #include "common/lookups/AffiliationLookup.h" #include "common/network/json/json.h" #include "common/Log.h" -#include "common/Thread.h" #include "common/Utils.h" #include "dmr/Control.h" #include "p25/Control.h" @@ -197,10 +196,7 @@ RESTAPI::RESTAPI(const std::string& address, uint16_t port, const std::string& p /// /// Finalizes a instance of the RESTAPI class. /// -RESTAPI::~RESTAPI() -{ - /* stub */ -} +RESTAPI::~RESTAPI() = default; /// /// Sets the instances of the Radio ID and Talkgroup ID lookup tables. @@ -344,7 +340,7 @@ bool RESTAPI::validateAuth(const HTTPPayload& request, HTTPPayload& reply) #if DEBUG_HTTP_PAYLOAD ::LogDebug(LOG_REST, "RESTAPI::validateAuth() token, host = %s, token = %s", host.c_str(), headerToken.c_str()); #endif - if (headerToken == "") { + if (headerToken.empty()) { errorPayload(reply, "no authentication token", HTTPPayload::UNAUTHORIZED); return false; } diff --git a/src/host/network/RESTAPI.h b/src/host/network/RESTAPI.h index e1d85ef4..ab97f6d6 100644 --- a/src/host/network/RESTAPI.h +++ b/src/host/network/RESTAPI.h @@ -58,7 +58,7 @@ public: /// Initializes a new instance of the RESTAPI class. RESTAPI(const std::string& address, uint16_t port, const std::string& password, Host* host, bool debug); /// Finalizes a instance of the RESTAPI class. - ~RESTAPI(); + ~RESTAPI() override; /// Sets the instances of the Radio ID and Talkgroup ID lookup tables. void setLookups(::lookups::RadioIdLookup* ridLookup, ::lookups::TalkgroupRulesLookup* tidLookup); @@ -97,7 +97,7 @@ private: std::unordered_map m_authTokens; /// - virtual void entry(); + void entry() override; /// Helper to initialize REST API endpoints. void initializeEndpoints(); diff --git a/src/host/nxdn/Audio.cpp b/src/host/nxdn/Audio.cpp index ebd81286..5e75429a 100644 --- a/src/host/nxdn/Audio.cpp +++ b/src/host/nxdn/Audio.cpp @@ -35,9 +35,7 @@ using namespace nxdn; using namespace edac; -#include #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -46,18 +44,12 @@ using namespace edac; /// /// Initializes a new instance of the Audio class. /// -Audio::Audio() -{ - /* stub */ -} +Audio::Audio() = default; /// /// Finalizes a instance of the Audio class. /// -Audio::~Audio() -{ - /* stub */ -} +Audio::~Audio() = default; /// /// Decode a NXDN AMBE audio frame. diff --git a/src/host/nxdn/Control.cpp b/src/host/nxdn/Control.cpp index c4baae04..fe0b1756 100644 --- a/src/host/nxdn/Control.cpp +++ b/src/host/nxdn/Control.cpp @@ -37,21 +37,17 @@ #include "common/nxdn/lc/RTCH.h" #include "common/nxdn/Sync.h" #include "common/nxdn/NXDNUtils.h" -#include "common/edac/AMBEFEC.h" #include "common/Log.h" #include "common/Utils.h" #include "nxdn/Control.h" #include "remote/RESTClient.h" #include "ActivityLog.h" -#include "HostMain.h" using namespace nxdn; using namespace nxdn::packet; -#include #include #include -#include // --------------------------------------------------------------------------- // Constants @@ -60,10 +56,10 @@ using namespace nxdn::packet; const uint8_t MAX_SYNC_BYTES_ERRS = 0U; const uint8_t SCRAMBLER[] = { - 0x00U, 0x00U, 0x00U, 0x82U, 0xA0U, 0x88U, 0x8AU, 0x00U, 0xA2U, 0xA8U, 0x82U, 0x8AU, 0x82U, 0x02U, - 0x20U, 0x08U, 0x8AU, 0x20U, 0xAAU, 0xA2U, 0x82U, 0x08U, 0x22U, 0x8AU, 0xAAU, 0x08U, 0x28U, 0x88U, - 0x28U, 0x28U, 0x00U, 0x0AU, 0x02U, 0x82U, 0x20U, 0x28U, 0x82U, 0x2AU, 0xAAU, 0x20U, 0x22U, 0x80U, - 0xA8U, 0x8AU, 0x08U, 0xA0U, 0xAAU, 0x02U }; + 0x00U, 0x00U, 0x00U, 0x82U, 0xA0U, 0x88U, 0x8AU, 0x00U, 0xA2U, 0xA8U, 0x82U, 0x8AU, 0x82U, 0x02U, + 0x20U, 0x08U, 0x8AU, 0x20U, 0xAAU, 0xA2U, 0x82U, 0x08U, 0x22U, 0x8AU, 0xAAU, 0x08U, 0x28U, 0x88U, + 0x28U, 0x28U, 0x00U, 0x0AU, 0x02U, 0x82U, 0x20U, 0x28U, 0x82U, 0x2AU, 0xAAU, 0x20U, 0x22U, 0x80U, + 0xA8U, 0x8AU, 0x08U, 0xA0U, 0xAAU, 0x02U }; // --------------------------------------------------------------------------- @@ -406,7 +402,7 @@ bool Control::processFrame(uint8_t* data, uint32_t len) } } - // have we got RSSI bytes on the end? + // have we got RSSI bytes on the end? if (len == (NXDN_FRAME_LENGTH_BYTES + 4U)) { uint16_t raw = 0U; raw |= (data[50U] << 8) & 0xFF00U; @@ -448,7 +444,7 @@ bool Control::processFrame(uint8_t* data, uint32_t len) LogWarning(LOG_RF, "NXDN, possible sync word, errs = %u, sync word = %02X %02X %02X", errs, syncBytes[0U], syncBytes[1U], syncBytes[2U]); - sync = true; // we found a completly valid sync with no errors... + sync = true; // we found a completely valid sync with no errors... } } @@ -515,12 +511,12 @@ bool Control::processFrame(uint8_t* data, uint32_t len) /// Length of frame data retreived. uint32_t Control::getFrame(uint8_t* data) { - assert(data != nullptr); + assert(data != nullptr); - if (m_txQueue.isEmpty() && m_txImmQueue.isEmpty()) - return 0U; + if (m_txQueue.isEmpty() && m_txImmQueue.isEmpty()) + return 0U; - uint8_t len = 0U; + uint8_t len = 0U; // tx immediate queue takes priority if (!m_txImmQueue.isEmpty()) { @@ -532,7 +528,7 @@ uint32_t Control::getFrame(uint8_t* data) m_txQueue.get(data, len); } - return len; + return len; } /// @@ -760,7 +756,7 @@ void Control::releaseGrantTG(uint32_t dstId) } /// -/// Touchs a granted TG to keep a channel grant alive. +/// Touches a granted TG to keep a channel grant alive. /// /// void Control::touchGrantTG(uint32_t dstId) diff --git a/src/host/nxdn/Control.h b/src/host/nxdn/Control.h index b92adf5a..5ad2bdbd 100644 --- a/src/host/nxdn/Control.h +++ b/src/host/nxdn/Control.h @@ -87,11 +87,11 @@ namespace nxdn 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; } + bool getCCRunning() const { return m_ccRunning; } /// Sets a flag indicating whether the NXDN control channel is running. void setCCRunning(bool ccRunning) { m_ccPrevRunning = m_ccRunning; m_ccRunning = ccRunning; } /// Gets a flag indicating whether the NXDN control channel is running. - bool getCCHalted() { return m_ccHalted; } + bool getCCHalted() const { return m_ccHalted; } /// Sets a flag indicating whether the NXDN control channel is halted. void setCCHalted(bool ccHalted) { m_ccHalted = ccHalted; } @@ -111,7 +111,7 @@ namespace nxdn void grantTG(uint32_t srcId, uint32_t dstId, bool grp); /// Releases a granted TG. void releaseGrantTG(uint32_t dstId); - /// Touchs a granted TG to keep a channel grant alive. + /// Touches a granted TG to keep a channel grant alive. void touchGrantTG(uint32_t dstId); /// Gets instance of the AffiliationLookup class. diff --git a/src/host/nxdn/packet/ControlSignaling.cpp b/src/host/nxdn/packet/ControlSignaling.cpp index c93677d4..8f1f85c2 100644 --- a/src/host/nxdn/packet/ControlSignaling.cpp +++ b/src/host/nxdn/packet/ControlSignaling.cpp @@ -351,10 +351,7 @@ ControlSignaling::ControlSignaling(Control* nxdn, bool debug, bool verbose) : /// /// Finalizes a instance of the ControlSignaling class. /// -ControlSignaling::~ControlSignaling() -{ - /* stub */ -} +ControlSignaling::~ControlSignaling() = default; /// /// Write data processed from RF to the network. @@ -505,7 +502,7 @@ bool ControlSignaling::writeRF_Message_Grant(uint32_t srcId, uint32_t dstId, uin bool encryption = ((serviceOptions & 0xFFU) & 0x40U) == 0x40U; // Encryption Flag uint8_t priority = ((serviceOptions & 0xFFU) & 0x07U); // Priority - std::unique_ptr rcch = new_unique(rcch::MESSAGE_TYPE_VCALL_CONN); + std::unique_ptr rcch = std::make_unique(); // are we skipping checking? if (!skip) { @@ -680,7 +677,7 @@ void ControlSignaling::writeRF_Message_Deny(uint32_t srcId, uint32_t dstId, uint switch (service) { case RTCH_MESSAGE_TYPE_VCALL: - rcch = new_unique(rcch::MESSAGE_TYPE_VCALL_CONN); + rcch = std::make_unique(); rcch->setMessageType(RTCH_MESSAGE_TYPE_VCALL); default: return; @@ -708,7 +705,7 @@ bool ControlSignaling::writeRF_Message_Grp_Reg_Rsp(uint32_t srcId, uint32_t dstI { bool ret = false; - std::unique_ptr rcch = new_unique(rcch::MESSAGE_TYPE_GRP_REG); + std::unique_ptr rcch = std::make_unique(); rcch->setCauseResponse(NXDN_CAUSE_MM_REG_ACCEPTED); // validate the location ID @@ -764,7 +761,7 @@ bool ControlSignaling::writeRF_Message_Grp_Reg_Rsp(uint32_t srcId, uint32_t dstI /// void ControlSignaling::writeRF_Message_U_Reg_Rsp(uint32_t srcId, uint32_t locId) { - std::unique_ptr rcch = new_unique(rcch::MESSAGE_TYPE_REG); + std::unique_ptr rcch = std::make_unique(); rcch->setCauseResponse(NXDN_CAUSE_MM_REG_ACCEPTED); // validate the location ID @@ -822,7 +819,7 @@ void ControlSignaling::writeRF_CC_Message_Site_Info() uint8_t buffer[NXDN_RCCH_LC_LENGTH_BYTES]; ::memset(buffer, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES); - std::unique_ptr rcch = new_unique(rcch::MESSAGE_TYPE_SITE_INFO); + std::unique_ptr rcch = std::make_unique(); DEBUG_LOG_MSG(rcch->toString()); rcch->setBcchCnt(m_bcchCnt); rcch->setRcchGroupingCnt(m_rcchGroupingCnt); @@ -872,7 +869,7 @@ void ControlSignaling::writeRF_CC_Message_Service_Info() uint8_t buffer[NXDN_RCCH_LC_LENGTH_BYTES]; ::memset(buffer, 0x00U, NXDN_RCCH_LC_LENGTH_BYTES); - std::unique_ptr rcch = new_unique(rcch::MESSAGE_TYPE_SRV_INFO); + std::unique_ptr rcch = std::make_unique(); DEBUG_LOG_MSG(rcch->toString()); rcch->encode(buffer, NXDN_RCCH_LC_LENGTH_BITS / 2U); //rcch->encode(buffer, NXDN_RCCH_LC_LENGTH_BITS / 2U, NXDN_RCCH_LC_LENGTH_BITS / 2U); diff --git a/src/host/nxdn/packet/ControlSignaling.h b/src/host/nxdn/packet/ControlSignaling.h index d6ca46d3..438dea2c 100644 --- a/src/host/nxdn/packet/ControlSignaling.h +++ b/src/host/nxdn/packet/ControlSignaling.h @@ -57,9 +57,9 @@ namespace nxdn class HOST_SW_API ControlSignaling { public: /// Process a data frame from the RF interface. - virtual bool process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len); + bool process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len); /// Process a data frame from the network. - virtual bool processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t* data, uint32_t len); + bool processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t* data, uint32_t len); /// Updates the processor by the passed number of milliseconds. void clock(uint32_t ms); @@ -89,7 +89,7 @@ namespace nxdn /// Initializes a new instance of the ControlSignaling class. ControlSignaling(Control* nxdn, bool debug, bool verbose); /// Finalizes a instance of the ControlSignaling class. - virtual ~ControlSignaling(); + ~ControlSignaling(); /// Write data processed from RF to the network. void writeNetwork(const uint8_t* data, uint32_t len); diff --git a/src/host/nxdn/packet/Data.cpp b/src/host/nxdn/packet/Data.cpp index 2b9130d8..0f20ce5e 100644 --- a/src/host/nxdn/packet/Data.cpp +++ b/src/host/nxdn/packet/Data.cpp @@ -34,20 +34,14 @@ #include "common/nxdn/acl/AccessControl.h" #include "common/nxdn/Sync.h" #include "common/nxdn/NXDNUtils.h" -#include "common/edac/CRC.h" #include "common/Log.h" -#include "common/Utils.h" #include "nxdn/packet/Data.h" #include "ActivityLog.h" -#include "HostMain.h" using namespace nxdn; using namespace nxdn::packet; #include -#include -#include -#include // --------------------------------------------------------------------------- // Macros @@ -270,7 +264,7 @@ bool Data::process(uint8_t option, uint8_t* data, uint32_t len) m_nxdn->addFrame(data, NXDN_FRAME_LENGTH_BYTES + 2U); } - m_nxdn->m_voice->m_rfFrames++; + m_nxdn->m_voice->m_rfFrames++; if (data[0U] == modem::TAG_EOT) { ::ActivityLog("NXDN", true, "RF ended RF data transmission"); @@ -382,7 +376,7 @@ bool Data::processNetwork(uint8_t option, lc::RTCH& netLC, uint8_t* data, uint32 m_nxdn->addFrame(data, NXDN_FRAME_LENGTH_BYTES + 2U); } - m_nxdn->m_voice->m_netFrames++; + m_nxdn->m_voice->m_netFrames++; if (data[0U] == modem::TAG_EOT) { ::ActivityLog("NXDN", true, "network ended RF data transmission"); @@ -418,10 +412,7 @@ Data::Data(Control* nxdn, bool debug, bool verbose) : /// /// Finalizes a instance of the Data class. /// -Data::~Data() -{ - /* stub */ -} +Data::~Data() = default; /// /// Write data processed from RF to the network. diff --git a/src/host/nxdn/packet/Data.h b/src/host/nxdn/packet/Data.h index 32d649e9..7e2a36d3 100644 --- a/src/host/nxdn/packet/Data.h +++ b/src/host/nxdn/packet/Data.h @@ -55,14 +55,14 @@ namespace nxdn class HOST_SW_API Data { public: /// Resets the data states for the RF interface. - virtual void resetRF(); + void resetRF(); /// Resets the data states for the network. - virtual void resetNet(); + void resetNet(); /// Process a data frame from the RF interface. - virtual bool process(uint8_t option, uint8_t* data, uint32_t len); + bool process(uint8_t option, uint8_t* data, uint32_t len); /// Process a data frame from the network. - virtual bool processNetwork(uint8_t option, lc::RTCH& netLC, uint8_t* data, uint32_t len); + bool processNetwork(uint8_t option, lc::RTCH& netLC, uint8_t* data, uint32_t len); protected: friend class nxdn::Control; @@ -76,7 +76,7 @@ namespace nxdn /// Initializes a new instance of the Data class. Data(Control* nxdn, bool debug, bool verbose); /// Finalizes a instance of the Data class. - virtual ~Data(); + ~Data(); /// Write data processed from RF to the network. void writeNetwork(const uint8_t* data, uint32_t len); diff --git a/src/host/nxdn/packet/Voice.cpp b/src/host/nxdn/packet/Voice.cpp index da8c26d0..1a9c8748 100644 --- a/src/host/nxdn/packet/Voice.cpp +++ b/src/host/nxdn/packet/Voice.cpp @@ -35,21 +35,15 @@ #include "common/nxdn/acl/AccessControl.h" #include "common/nxdn/Sync.h" #include "common/nxdn/NXDNUtils.h" -#include "common/edac/CRC.h" #include "common/Log.h" -#include "common/Utils.h" -#include "nxdn/Audio.h" #include "nxdn/packet/Voice.h" #include "ActivityLog.h" -#include "HostMain.h" using namespace nxdn; using namespace nxdn::packet; #include -#include #include -#include // --------------------------------------------------------------------------- // Macros @@ -322,7 +316,7 @@ bool Voice::process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len) facch.encode(data + 2U, NXDN_FSW_LENGTH_BITS + NXDN_LICH_LENGTH_BITS + NXDN_SACCH_FEC_LENGTH_BITS); facch.encode(data + 2U, NXDN_FSW_LENGTH_BITS + NXDN_LICH_LENGTH_BITS + NXDN_SACCH_FEC_LENGTH_BITS + NXDN_FACCH1_FEC_LENGTH_BITS); - NXDNUtils::scrambler(data + 2U); + NXDNUtils::scrambler(data + 2U); writeNetwork(data, NXDN_FRAME_LENGTH_BYTES + 2U); @@ -369,7 +363,7 @@ bool Voice::process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len) ::ActivityLog("NXDN", true, "RF %svoice transmission from %u to %s%u", encrypted ? "encrypted " : "", srcId, group ? "TG " : "", dstId); } - return true; + return true; } else { if (m_nxdn->m_rfState == RS_RF_LISTENING) { channel::FACCH1 facch; @@ -776,7 +770,7 @@ bool Voice::processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t facch.encode(data + 2U, NXDN_FSW_LENGTH_BITS + NXDN_LICH_LENGTH_BITS + NXDN_SACCH_FEC_LENGTH_BITS); facch.encode(data + 2U, NXDN_FSW_LENGTH_BITS + NXDN_LICH_LENGTH_BITS + NXDN_SACCH_FEC_LENGTH_BITS + NXDN_FACCH1_FEC_LENGTH_BITS); - NXDNUtils::scrambler(data + 2U); + NXDNUtils::scrambler(data + 2U); if (m_nxdn->m_duplex) { data[0U] = type == RTCH_MESSAGE_TYPE_TX_REL ? modem::TAG_EOT : modem::TAG_DATA; @@ -806,7 +800,7 @@ bool Voice::processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t ::ActivityLog("NXDN", false, "network %svoice transmission from %u to %s%u", encrypted ? "encrypted " : "", srcId, group ? "TG " : "", dstId); } - return true; + return true; } else { if (m_nxdn->m_netState == RS_NET_IDLE) { channel::FACCH1 facch; @@ -1081,10 +1075,7 @@ Voice::Voice(Control* nxdn, bool debug, bool verbose) : /// /// Finalizes a instance of the Voice class. /// -Voice::~Voice() -{ - /* stub */ -} +Voice::~Voice() = default; /// /// Write data processed from RF to the network. diff --git a/src/host/nxdn/packet/Voice.h b/src/host/nxdn/packet/Voice.h index 2c7572b3..1733dd06 100644 --- a/src/host/nxdn/packet/Voice.h +++ b/src/host/nxdn/packet/Voice.h @@ -56,14 +56,14 @@ namespace nxdn class HOST_SW_API Voice { public: /// Resets the data states for the RF interface. - virtual void resetRF(); + void resetRF(); /// Resets the data states for the network. - virtual void resetNet(); + void resetNet(); /// Process a data frame from the RF interface. - virtual bool process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len); + bool process(uint8_t fct, uint8_t option, uint8_t* data, uint32_t len); /// Process a data frame from the network. - virtual bool processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t* data, uint32_t len); + bool processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t* data, uint32_t len); protected: friend class packet::Data; @@ -87,7 +87,7 @@ namespace nxdn /// Initializes a new instance of the Voice class. Voice(Control* nxdn, bool debug, bool verbose); /// Finalizes a instance of the Voice class. - virtual ~Voice(); + ~Voice(); /// Write data processed from RF to the network. void writeNetwork(const uint8_t* data, uint32_t len); diff --git a/src/host/p25/Control.cpp b/src/host/p25/Control.cpp index b9007bd4..cf289922 100644 --- a/src/host/p25/Control.cpp +++ b/src/host/p25/Control.cpp @@ -33,7 +33,6 @@ #include "common/p25/acl/AccessControl.h" #include "common/p25/P25Utils.h" #include "common/p25/Sync.h" -#include "common/edac/CRC.h" #include "common/AESCrypto.h" #include "common/Log.h" #include "common/Utils.h" @@ -46,9 +45,7 @@ using namespace p25; using namespace p25::packet; #include -#include #include -#include // --------------------------------------------------------------------------- // Constants @@ -694,7 +691,7 @@ bool Control::processFrame(uint8_t* data, uint32_t len) /// /// Get the frame data length for the next frame in the data ring buffer. /// -/// Length of frame data retreived. +/// Length of frame data retrieved. uint32_t Control::peekFrameLength() { if (m_txQueue.isEmpty() && m_txImmQueue.isEmpty()) @@ -717,7 +714,7 @@ uint32_t Control::peekFrameLength() /// Get frame data from data ring buffer. /// /// Buffer to store frame data. -/// Length of frame data retreived. +/// Length of frame data retrieved. uint32_t Control::getFrame(uint8_t* data) { assert(data != nullptr); @@ -1021,7 +1018,7 @@ void Control::releaseGrantTG(uint32_t dstId) } /// -/// Touchs a granted TG to keep a channel grant alive. +/// Touches a granted TG to keep a channel grant alive. /// /// void Control::touchGrantTG(uint32_t dstId) @@ -1090,8 +1087,8 @@ uint32_t Control::getLastSrcId() const return m_rfLastSrcId; } - if (m_rfLastSrcId != 0U) { - return m_rfLastSrcId; + if (m_netLastSrcId != 0U) { + return m_netLastSrcId; } return 0U; diff --git a/src/host/p25/Control.h b/src/host/p25/Control.h index 86b96b51..45f6a2aa 100644 --- a/src/host/p25/Control.h +++ b/src/host/p25/Control.h @@ -88,11 +88,11 @@ namespace p25 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; } + bool getCCRunning() const { return m_ccRunning; } /// Sets a flag indicating whether the P25 control channel is running. void setCCRunning(bool ccRunning) { m_ccPrevRunning = m_ccRunning; m_ccRunning = ccRunning; } /// Gets a flag indicating whether the P25 control channel is running. - bool getCCHalted() { return m_ccHalted; } + bool getCCHalted() const { return m_ccHalted; } /// Sets a flag indicating whether the P25 control channel is halted. void setCCHalted(bool ccHalted) { m_ccHalted = ccHalted; } @@ -117,7 +117,7 @@ namespace p25 void grantTG(uint32_t srcId, uint32_t dstId, bool grp); /// Releases a granted TG. void releaseGrantTG(uint32_t dstId); - /// Touchs a granted TG to keep a channel grant alive. + /// Touches a granted TG to keep a channel grant alive. void touchGrantTG(uint32_t dstId); /// Gets instance of the NID class. diff --git a/src/host/p25/lc/tsbk/OSP_DVM_GIT_HASH.cpp b/src/host/p25/lc/tsbk/OSP_DVM_GIT_HASH.cpp index 2f54fd76..427a1a50 100644 --- a/src/host/p25/lc/tsbk/OSP_DVM_GIT_HASH.cpp +++ b/src/host/p25/lc/tsbk/OSP_DVM_GIT_HASH.cpp @@ -24,8 +24,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "Defines.h" -#include "common/Log.h" -#include "common/Utils.h" #include "p25/lc/tsbk/OSP_DVM_GIT_HASH.h" #include "HostMain.h" @@ -34,7 +32,6 @@ using namespace p25::lc; using namespace p25; #include -#include // --------------------------------------------------------------------------- // Public Class Members @@ -57,7 +54,7 @@ OSP_DVM_GIT_HASH::OSP_DVM_GIT_HASH() : TSBK() /// True, if TSBK was decoded, otherwise false. bool OSP_DVM_GIT_HASH::decode(const uint8_t* data, bool rawTSBK) { - assert(data != NULL); + assert(data != nullptr); /* stub */ @@ -72,7 +69,7 @@ bool OSP_DVM_GIT_HASH::decode(const uint8_t* data, bool rawTSBK) /// void OSP_DVM_GIT_HASH::encode(uint8_t* data, bool rawTSBK, bool noTrellis) { - assert(data != NULL); + assert(data != nullptr); ulong64_t tsbkValue = 0U; diff --git a/src/host/p25/lc/tsbk/OSP_DVM_GIT_HASH.h b/src/host/p25/lc/tsbk/OSP_DVM_GIT_HASH.h index 311fbbfe..0af37dea 100644 --- a/src/host/p25/lc/tsbk/OSP_DVM_GIT_HASH.h +++ b/src/host/p25/lc/tsbk/OSP_DVM_GIT_HASH.h @@ -46,12 +46,12 @@ namespace p25 OSP_DVM_GIT_HASH(); /// Decode a trunking signalling block. - bool decode(const uint8_t* data, bool rawTSBK = false); + bool decode(const uint8_t* data, bool rawTSBK = false) override; /// Encode a trunking signalling block. - void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false); + void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false) override; /// Returns a string that represents the current TSBK. - virtual std::string toString(bool isp = false) override; + std::string toString(bool isp = false) override; }; } // namespace tsbk } // namespace lc diff --git a/src/host/p25/lookups/P25AffiliationLookup.cpp b/src/host/p25/lookups/P25AffiliationLookup.cpp index fa81314d..ee3b207a 100644 --- a/src/host/p25/lookups/P25AffiliationLookup.cpp +++ b/src/host/p25/lookups/P25AffiliationLookup.cpp @@ -25,16 +25,10 @@ */ #include "common/Log.h" #include "p25/lookups/P25AffiliationLookup.h" -#include "p25/packet/ControlSignaling.h" #include "p25/Control.h" using namespace p25::lookups; -#include -#include -#include -#include - // --------------------------------------------------------------------------- // Public Class Members // --------------------------------------------------------------------------- @@ -53,10 +47,7 @@ P25AffiliationLookup::P25AffiliationLookup(Control* p25, bool verbose) : ::looku /// /// Finalizes a instance of the P25AffiliationLookup class. /// -P25AffiliationLookup::~P25AffiliationLookup() -{ - /* stub */ -} +P25AffiliationLookup::~P25AffiliationLookup() = default; /// /// Helper to release the channel grant for the destination ID. diff --git a/src/host/p25/lookups/P25AffiliationLookup.h b/src/host/p25/lookups/P25AffiliationLookup.h index 885f3466..2bb292f0 100644 --- a/src/host/p25/lookups/P25AffiliationLookup.h +++ b/src/host/p25/lookups/P25AffiliationLookup.h @@ -50,7 +50,7 @@ namespace p25 /// Initializes a new instance of the P25AffiliationLookup class. P25AffiliationLookup(Control* p25, bool verbose); /// Finalizes a instance of the P25AffiliationLookup class. - virtual ~P25AffiliationLookup(); + ~P25AffiliationLookup() override; /// Helper to release the channel grant for the destination ID. bool releaseGrant(uint32_t dstId, bool releaseAll) override; diff --git a/src/host/p25/packet/ControlSignaling.cpp b/src/host/p25/packet/ControlSignaling.cpp index 19940134..3e7b4bd6 100644 --- a/src/host/p25/packet/ControlSignaling.cpp +++ b/src/host/p25/packet/ControlSignaling.cpp @@ -989,7 +989,7 @@ void ControlSignaling::writeAdjSSNetwork() } // transmit adjacent site broadcast - std::unique_ptr osp = new_unique(OSP_ADJ_STS_BCAST); + std::unique_ptr osp = std::make_unique(); osp->setSrcId(P25_WUID_FNE); osp->setAdjSiteCFVA(cfva); osp->setAdjSiteSysId(m_p25->m_siteData.sysId()); @@ -1068,7 +1068,7 @@ void ControlSignaling::clock(uint32_t ms) /// void ControlSignaling::writeRF_TSDU_Call_Alrt(uint32_t srcId, uint32_t dstId) { - std::unique_ptr iosp = new_unique(IOSP_CALL_ALRT); + std::unique_ptr iosp = std::make_unique(); iosp->setSrcId(srcId); iosp->setDstId(dstId); @@ -1086,7 +1086,7 @@ void ControlSignaling::writeRF_TSDU_Call_Alrt(uint32_t srcId, uint32_t dstId) /// void ControlSignaling::writeRF_TSDU_Radio_Mon(uint32_t srcId, uint32_t dstId, uint8_t txMult) { - std::unique_ptr iosp = new_unique(IOSP_RAD_MON); + std::unique_ptr iosp = std::make_unique(); iosp->setSrcId(srcId); iosp->setDstId(dstId); iosp->setTxMult(txMult); @@ -1108,7 +1108,7 @@ void ControlSignaling::writeRF_TSDU_Radio_Mon(uint32_t srcId, uint32_t dstId, ui /// void ControlSignaling::writeRF_TSDU_Ext_Func(uint32_t func, uint32_t arg, uint32_t dstId) { - std::unique_ptr iosp = new_unique(IOSP_EXT_FNCT); + std::unique_ptr iosp = std::make_unique(); iosp->setExtendedFunction(func); iosp->setSrcId(arg); iosp->setDstId(dstId); @@ -1138,7 +1138,7 @@ void ControlSignaling::writeRF_TSDU_Ext_Func(uint32_t func, uint32_t arg, uint32 /// void ControlSignaling::writeRF_TSDU_Grp_Aff_Q(uint32_t dstId) { - std::unique_ptr osp = new_unique(OSP_GRP_AFF_Q); + std::unique_ptr osp = std::make_unique(); osp->setSrcId(P25_WUID_FNE); osp->setDstId(dstId); @@ -1154,7 +1154,7 @@ void ControlSignaling::writeRF_TSDU_Grp_Aff_Q(uint32_t dstId) /// void ControlSignaling::writeRF_TSDU_U_Reg_Cmd(uint32_t dstId) { - std::unique_ptr osp = new_unique(OSP_U_REG_CMD); + std::unique_ptr osp = std::make_unique(); osp->setSrcId(P25_WUID_FNE); osp->setDstId(dstId); @@ -1171,7 +1171,7 @@ void ControlSignaling::writeRF_TSDU_U_Reg_Cmd(uint32_t dstId) /// void ControlSignaling::writeRF_TSDU_Emerg_Alrm(uint32_t srcId, uint32_t dstId) { - std::unique_ptr isp = new_unique(ISP_EMERG_ALRM_REQ); + std::unique_ptr isp = std::make_unique(); isp->setSrcId(srcId); isp->setDstId(dstId); @@ -1189,7 +1189,7 @@ void ControlSignaling::writeRF_TSDU_Raw(const uint8_t* tsbk) return; } - std::unique_ptr osp = new_unique(OSP_TSBK_RAW); + std::unique_ptr osp = std::make_unique(); osp->setTSBK(tsbk); writeRF_TSDU_SBF(osp.get(), true); @@ -1205,7 +1205,7 @@ void ControlSignaling::setConvFallback(bool fallback) if (m_convFallback && m_p25->m_enableControl) { m_convFallbackPacketDelay = 0U; - std::unique_ptr osp = new_unique(OSP_MOT_PSH_CCH); + std::unique_ptr osp = std::make_unique(); for (uint8_t i = 0U; i < 3U; i++) { writeRF_TSDU_SBF(osp.get(), true); } @@ -1741,9 +1741,9 @@ void ControlSignaling::writeRF_TDULC_ChanRelease(bool grp, uint32_t srcId, uint3 for (uint32_t i = 0; i < count; i++) { if ((srcId != 0U) && (dstId != 0U)) { if (grp) { - lc = new_unique(lc::tdulc::LC_GROUP); + lc = std::make_unique(); } else { - lc = new_unique(lc::tdulc::LC_PRIVATE); + lc = std::make_unique(); } lc->setSrcId(srcId); @@ -1753,9 +1753,9 @@ void ControlSignaling::writeRF_TDULC_ChanRelease(bool grp, uint32_t srcId, uint3 writeRF_TDULC(lc.get(), true); } - lc = new_unique(lc::tdulc::LC_NET_STS_BCAST); + lc = std::make_unique(); writeRF_TDULC(lc.get(), true); - lc = new_unique(lc::tdulc::LC_RFSS_STS_BCAST); + lc = std::make_unique(); writeRF_TDULC(lc.get(), true); } } @@ -1764,7 +1764,7 @@ void ControlSignaling::writeRF_TDULC_ChanRelease(bool grp, uint32_t srcId, uint3 LogMessage(LOG_RF, P25_TDULC_STR ", LC_CALL_TERM (Call Termination), srcId = %u, dstId = %u", srcId, dstId); } - lc = new_unique(lc::tdulc::LC_CALL_TERM); + lc = std::make_unique(); writeRF_TDULC(lc.get(), true); if (m_p25->m_enableControl) { @@ -1792,7 +1792,7 @@ void ControlSignaling::writeRF_ControlData(uint8_t frameCnt, uint8_t n, bool adj bool fallbackTx = (frameCnt % 253U) == 0U; if (fallbackTx && n == 8U) { if (m_convFallbackPacketDelay >= CONV_FALLBACK_PACKET_DELAY) { - std::unique_ptr lc = new_unique(lc::tdulc::LC_CONV_FALLBACK); + std::unique_ptr lc = std::make_unique(); for (uint8_t i = 0U; i < 3U; i++) { writeRF_TDULC(lc.get(), true); } @@ -1804,7 +1804,7 @@ void ControlSignaling::writeRF_ControlData(uint8_t frameCnt, uint8_t n, bool adj } else { if (n == 8U) { - std::unique_ptr lc = new_unique(lc::tdulc::LC_FAILSOFT); + std::unique_ptr lc = std::make_unique(); writeRF_TDULC(lc.get(), true); } } @@ -1963,7 +1963,7 @@ void ControlSignaling::queueRF_TSBK_Ctrl(uint8_t lco) // handle 700/800/900 identities if (entry.baseFrequency() >= 762000000U) { - std::unique_ptr osp = new_unique(OSP_IDEN_UP); + std::unique_ptr osp = std::make_unique(); DEBUG_LOG_TSBK(osp->toString()); osp->siteIdenEntry(entry); @@ -1971,7 +1971,7 @@ void ControlSignaling::queueRF_TSBK_Ctrl(uint8_t lco) tsbk = std::move(osp); } else { - std::unique_ptr osp = new_unique(OSP_IDEN_UP_VU); + std::unique_ptr osp = std::make_unique(); DEBUG_LOG_TSBK(osp->toString()); osp->siteIdenEntry(entry); @@ -1987,12 +1987,12 @@ void ControlSignaling::queueRF_TSBK_Ctrl(uint8_t lco) break; case TSBK_OSP_NET_STS_BCAST: // transmit net status burst - tsbk = new_unique(OSP_NET_STS_BCAST); + tsbk = std::make_unique(); DEBUG_LOG_TSBK(tsbk->toString()); break; case TSBK_OSP_RFSS_STS_BCAST: // transmit rfss status burst - tsbk = new_unique(OSP_RFSS_STS_BCAST); + tsbk = std::make_unique(); DEBUG_LOG_TSBK(tsbk->toString()); break; case TSBK_OSP_ADJ_STS_BCAST: @@ -2001,7 +2001,7 @@ void ControlSignaling::queueRF_TSBK_Ctrl(uint8_t lco) if (m_mbfAdjSSCnt >= m_adjSiteTable.size()) m_mbfAdjSSCnt = 0U; - std::unique_ptr osp = new_unique(OSP_ADJ_STS_BCAST); + std::unique_ptr osp = std::make_unique(); DEBUG_LOG_TSBK(osp->toString()); uint8_t i = 0U; @@ -2052,7 +2052,7 @@ void ControlSignaling::queueRF_TSBK_Ctrl(uint8_t lco) if (m_mbfSCCBCnt >= m_sccbTable.size()) m_mbfSCCBCnt = 0U; - std::unique_ptr osp = new_unique(OSP_SCCB_EXP); + std::unique_ptr osp = std::make_unique(); DEBUG_LOG_TSBK(osp->toString()); uint8_t i = 0U; @@ -2082,13 +2082,13 @@ void ControlSignaling::queueRF_TSBK_Ctrl(uint8_t lco) break; case TSBK_OSP_SNDCP_CH_ANN: // transmit SNDCP announcement - tsbk = new_unique(OSP_SNDCP_CH_ANN); + tsbk = std::make_unique(); DEBUG_LOG_TSBK(tsbk->toString()); break; case TSBK_OSP_SYNC_BCAST: { // transmit sync broadcast - std::unique_ptr osp = new_unique(OSP_SYNC_BCAST); + std::unique_ptr osp = std::make_unique(); DEBUG_LOG_TSBK(osp->toString()); osp->setMicroslotCount(m_microslotCount); tsbk = std::move(osp); @@ -2098,7 +2098,7 @@ void ControlSignaling::queueRF_TSBK_Ctrl(uint8_t lco) { if (m_ctrlTimeDateAnn) { // transmit time/date announcement - tsbk = new_unique(OSP_TIME_DATE_ANN); + tsbk = std::make_unique(); DEBUG_LOG_TSBK(tsbk->toString()); } } @@ -2107,20 +2107,20 @@ void ControlSignaling::queueRF_TSBK_Ctrl(uint8_t lco) /** Motorola CC data */ case TSBK_OSP_MOT_PSH_CCH: // transmit motorola PSH CCH burst - tsbk = new_unique(OSP_MOT_PSH_CCH); + tsbk = std::make_unique(); DEBUG_LOG_TSBK(tsbk->toString()); break; case TSBK_OSP_MOT_CC_BSI: // transmit motorola CC BSI burst - tsbk = new_unique(OSP_MOT_CC_BSI); + tsbk = std::make_unique(); DEBUG_LOG_TSBK(tsbk->toString()); break; /** DVM CC data */ case TSBK_OSP_DVM_GIT_HASH: // transmit git hash burst - tsbk = new_unique(OSP_DVM_GIT_HASH); + tsbk = std::make_unique(); DEBUG_LOG_TSBK(tsbk->toString()); break; } @@ -2332,7 +2332,7 @@ bool ControlSignaling::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_ } } - std::unique_ptr iosp = new_unique(IOSP_GRP_VCH); + std::unique_ptr iosp = std::make_unique(); iosp->setMFId(m_lastMFID); iosp->setSrcId(srcId); iosp->setDstId(dstId); @@ -2386,7 +2386,7 @@ bool ControlSignaling::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_ } } - std::unique_ptr iosp = new_unique(IOSP_UU_VCH); + std::unique_ptr iosp = std::make_unique(); iosp->setMFId(m_lastMFID); iosp->setSrcId(srcId); iosp->setDstId(dstId); @@ -2451,7 +2451,7 @@ void ControlSignaling::writeRF_TSDU_Grant_Update() } else { if (grp) { - osp = new_unique(OSP_GRP_VCH_GRANT_UPD); + osp = std::make_unique(); DEBUG_LOG_TSBK(osp->toString()); // transmit group voice grant update @@ -2465,7 +2465,7 @@ void ControlSignaling::writeRF_TSDU_Grant_Update() } else { uint32_t srcId = m_p25->m_affiliations.getGrantedSrcId(dstId); - osp = new_unique(OSP_UU_VCH_GRANT_UPD); + osp = std::make_unique(); DEBUG_LOG_TSBK(osp->toString()); // transmit group voice grant update @@ -2503,7 +2503,7 @@ void ControlSignaling::writeRF_TSDU_Grant_Update() /// bool ControlSignaling::writeRF_TSDU_SNDCP_Grant(uint32_t srcId, uint32_t dstId, bool skip, bool net) { - std::unique_ptr osp = new_unique(OSP_SNDCP_CH_GNT); + std::unique_ptr osp = std::make_unique(); osp->setMFId(m_lastMFID); osp->setSrcId(srcId); osp->setDstId(dstId); @@ -2583,7 +2583,7 @@ bool ControlSignaling::writeRF_TSDU_SNDCP_Grant(uint32_t srcId, uint32_t dstId, /// void ControlSignaling::writeRF_TSDU_UU_Ans_Req(uint32_t srcId, uint32_t dstId) { - std::unique_ptr iosp = new_unique(IOSP_UU_ANS); + std::unique_ptr iosp = std::make_unique(); iosp->setMFId(m_lastMFID); iosp->setSrcId(srcId); iosp->setDstId(dstId); @@ -2600,7 +2600,7 @@ void ControlSignaling::writeRF_TSDU_UU_Ans_Req(uint32_t srcId, uint32_t dstId) /// void ControlSignaling::writeRF_TSDU_ACK_FNE(uint32_t srcId, uint32_t service, bool extended, bool noNetwork) { - std::unique_ptr iosp = new_unique(IOSP_ACK_RSP); + std::unique_ptr iosp = std::make_unique(); iosp->setSrcId(srcId); iosp->setService(service); @@ -2626,7 +2626,7 @@ void ControlSignaling::writeRF_TSDU_ACK_FNE(uint32_t srcId, uint32_t service, bo /// void ControlSignaling::writeRF_TSDU_Deny(uint32_t srcId, uint32_t dstId, uint8_t reason, uint8_t service, bool aiv) { - std::unique_ptr osp = new_unique(OSP_DENY_RSP); + std::unique_ptr osp = std::make_unique(); osp->setAIV(aiv); osp->setSrcId(srcId); osp->setDstId(dstId); @@ -2650,7 +2650,7 @@ bool ControlSignaling::writeRF_TSDU_Grp_Aff_Rsp(uint32_t srcId, uint32_t dstId) { bool ret = false; - std::unique_ptr iosp = new_unique(IOSP_GRP_AFF); + std::unique_ptr iosp = std::make_unique(); iosp->setMFId(m_lastMFID); iosp->setAnnounceGroup(m_announcementGroup); iosp->setSrcId(srcId); @@ -2712,7 +2712,7 @@ bool ControlSignaling::writeRF_TSDU_Grp_Aff_Rsp(uint32_t srcId, uint32_t dstId) /// void ControlSignaling::writeRF_TSDU_U_Reg_Rsp(uint32_t srcId, uint32_t sysId) { - std::unique_ptr iosp = new_unique(IOSP_U_REG); + std::unique_ptr iosp = std::make_unique(); iosp->setMFId(m_lastMFID); iosp->setResponse(P25_RSP_ACCEPT); iosp->setSrcId(srcId); @@ -2765,7 +2765,7 @@ void ControlSignaling::writeRF_TSDU_U_Dereg_Ack(uint32_t srcId) dereged = m_p25->m_affiliations.unitDereg(srcId); if (dereged) { - std::unique_ptr osp = new_unique(OSP_U_DEREG_ACK); + std::unique_ptr osp = std::make_unique(); osp->setMFId(m_lastMFID); osp->setSrcId(P25_WUID_FNE); osp->setDstId(srcId); @@ -2790,7 +2790,7 @@ void ControlSignaling::writeRF_TSDU_U_Dereg_Ack(uint32_t srcId) /// void ControlSignaling::writeRF_TSDU_Queue(uint32_t srcId, uint32_t dstId, uint8_t reason, uint8_t service, bool aiv, bool grp) { - std::unique_ptr osp = new_unique(OSP_QUE_RSP); + std::unique_ptr osp = std::make_unique(); osp->setAIV(aiv); osp->setSrcId(srcId); osp->setDstId(dstId); @@ -2816,7 +2816,7 @@ bool ControlSignaling::writeRF_TSDU_Loc_Reg_Rsp(uint32_t srcId, uint32_t dstId, { bool ret = false; - std::unique_ptr osp = new_unique(OSP_LOC_REG_RSP); + std::unique_ptr osp = std::make_unique(); osp->setMFId(m_lastMFID); osp->setResponse(P25_RSP_ACCEPT); osp->setDstId(dstId); @@ -2874,7 +2874,7 @@ bool ControlSignaling::writeRF_TSDU_Loc_Reg_Rsp(uint32_t srcId, uint32_t dstId, /// void ControlSignaling::writeRF_TSDU_Auth_Dmd(uint32_t srcId) { - std::unique_ptr osp = new_unique(MBT_OSP_AUTH_DMD); + std::unique_ptr osp = std::make_unique(); osp->setSrcId(P25_WUID_FNE); osp->setDstId(srcId); osp->setAuthRS(m_p25->m_llaRS); @@ -2914,7 +2914,7 @@ bool ControlSignaling::writeNet_TSDU_Call_Term(uint32_t srcId, uint32_t dstId) m_p25->m_affiliations.releaseGrant(dstId, false); } - std::unique_ptr osp = new_unique(OSP_DVM_LC_CALL_TERM); + std::unique_ptr osp = std::make_unique(); osp->setGrpVchId(m_p25->m_siteData.channelId()); osp->setGrpVchNo(m_p25->m_siteData.channelNo()); osp->setDstId(dstId); diff --git a/src/host/p25/packet/ControlSignaling.h b/src/host/p25/packet/ControlSignaling.h index 6f6ea424..db88175b 100644 --- a/src/host/p25/packet/ControlSignaling.h +++ b/src/host/p25/packet/ControlSignaling.h @@ -61,9 +61,9 @@ namespace p25 class HOST_SW_API ControlSignaling { public: /// Process a data frame from the RF interface. - virtual bool process(uint8_t* data, uint32_t len, std::unique_ptr preDecodedTSBK = nullptr); + bool process(uint8_t* data, uint32_t len, std::unique_ptr preDecodedTSBK = nullptr); /// Process a data frame from the network. - virtual bool processNetwork(uint8_t* data, uint32_t len, lc::LC& control, data::LowSpeedData& lsd, uint8_t& duid); + bool processNetwork(uint8_t* data, uint32_t len, lc::LC& control, data::LowSpeedData& lsd, uint8_t& duid); /// Helper used to process AMBTs from PDU data. bool processMBT(data::DataHeader& dataHeader, data::DataBlock* blocks); @@ -173,20 +173,20 @@ namespace p25 */ /// Helper to write a P25 TDU w/ link control packet. - virtual void writeRF_TDULC(lc::TDULC* lc, bool noNetwork); + void writeRF_TDULC(lc::TDULC* lc, bool noNetwork); /// Helper to write a network P25 TDU w/ link control packet. - virtual void writeNet_TDULC(lc::TDULC* lc); + void writeNet_TDULC(lc::TDULC* lc); /// Helper to write a immediate single-block P25 TSDU packet. - virtual void writeRF_TSDU_SBF_Imm(lc::TSBK *tsbk, bool noNetwork) { writeRF_TSDU_SBF(tsbk, noNetwork, false, false, true); } + void writeRF_TSDU_SBF_Imm(lc::TSBK *tsbk, bool noNetwork) { writeRF_TSDU_SBF(tsbk, noNetwork, false, false, true); } /// Helper to write a single-block P25 TSDU packet. - virtual void writeRF_TSDU_SBF(lc::TSBK* tsbk, bool noNetwork, bool clearBeforeWrite = false, bool force = false, bool imm = false); + void writeRF_TSDU_SBF(lc::TSBK* tsbk, bool noNetwork, bool clearBeforeWrite = false, bool force = false, bool imm = false); /// Helper to write a network single-block P25 TSDU packet. - virtual void writeNet_TSDU(lc::TSBK* tsbk); + void writeNet_TSDU(lc::TSBK* tsbk); /// Helper to write a multi-block (3-block) P25 TSDU packet. void writeRF_TSDU_MBF(lc::TSBK* tsbk, bool clearBeforeWrite = false); /// Helper to write a alternate multi-block PDU packet. - virtual void writeRF_TSDU_AMBT(lc::AMBT* ambt, bool clearBeforeWrite = false); + void writeRF_TSDU_AMBT(lc::AMBT* ambt, bool clearBeforeWrite = false); /* ** Control Signalling Logic diff --git a/src/host/p25/packet/Data.cpp b/src/host/p25/packet/Data.cpp index a8d56997..dcc082e0 100644 --- a/src/host/p25/packet/Data.cpp +++ b/src/host/p25/packet/Data.cpp @@ -36,19 +36,15 @@ #include "common/edac/CRC.h" #include "common/Log.h" #include "common/Utils.h" -#include "p25/packet/ControlSignaling.h" #include "p25/packet/Data.h" #include "ActivityLog.h" -#include "HostMain.h" using namespace p25; using namespace p25::data; using namespace p25::packet; #include -#include #include -#include // --------------------------------------------------------------------------- // Constants diff --git a/src/host/p25/packet/Voice.cpp b/src/host/p25/packet/Voice.cpp index e4556a05..b7249636 100644 --- a/src/host/p25/packet/Voice.cpp +++ b/src/host/p25/packet/Voice.cpp @@ -439,7 +439,7 @@ bool Voice::process(uint8_t* data, uint32_t len) std::unique_ptr osp; if (grp) { - osp = new_unique(lc::tsbk::OSP_GRP_VCH_GRANT_UPD); + osp = std::make_unique(); // transmit group voice grant update osp->setLCO(TSBK_OSP_GRP_VCH_GRANT_UPD); @@ -450,7 +450,7 @@ bool Voice::process(uint8_t* data, uint32_t len) else { uint32_t srcId = m_p25->m_affiliations.getGrantedSrcId(dstId); - osp = new_unique(lc::tsbk::OSP_UU_VCH_GRANT_UPD); + osp = std::make_unique(); // transmit group voice grant update osp->setLCO(TSBK_OSP_UU_VCH_GRANT_UPD); @@ -542,7 +542,7 @@ bool Voice::process(uint8_t* data, uint32_t len) std::unique_ptr osp; if (grp) { - osp = new_unique(lc::tsbk::OSP_GRP_VCH_GRANT_UPD); + osp = std::make_unique(); // transmit group voice grant update osp->setLCO(TSBK_OSP_GRP_VCH_GRANT_UPD); @@ -553,7 +553,7 @@ bool Voice::process(uint8_t* data, uint32_t len) else { uint32_t srcId = m_p25->m_affiliations.getGrantedSrcId(dstId); - osp = new_unique(lc::tsbk::OSP_UU_VCH_GRANT_UPD); + osp = std::make_unique(); // transmit group voice grant update osp->setLCO(TSBK_OSP_UU_VCH_GRANT_UPD); @@ -1360,7 +1360,7 @@ void Voice::checkNet_LDU1() if (m_p25->m_netState == RS_NET_IDLE) return; - // Check for an unflushed LDU1 + // check for an unflushed LDU1 if (m_netLDU1[10U] != 0x00U || m_netLDU1[26U] != 0x00U || m_netLDU1[55U] != 0x00U || m_netLDU1[80U] != 0x00U || m_netLDU1[105U] != 0x00U || m_netLDU1[130U] != 0x00U || m_netLDU1[155U] != 0x00U || m_netLDU1[180U] != 0x00U || m_netLDU1[204U] != 0x00U) @@ -1531,7 +1531,7 @@ void Voice::writeNet_LDU1() std::unique_ptr osp; if (grp) { - osp = new_unique(lc::tsbk::OSP_GRP_VCH_GRANT_UPD); + osp = std::make_unique(); // transmit group voice grant update osp->setLCO(TSBK_OSP_GRP_VCH_GRANT_UPD); @@ -1542,7 +1542,7 @@ void Voice::writeNet_LDU1() else { uint32_t srcId = m_p25->m_affiliations.getGrantedSrcId(dstId); - osp = new_unique(lc::tsbk::OSP_UU_VCH_GRANT_UPD); + osp = std::make_unique(); // transmit group voice grant update osp->setLCO(TSBK_OSP_UU_VCH_GRANT_UPD); @@ -1719,7 +1719,7 @@ void Voice::checkNet_LDU2() if (m_p25->m_netState == RS_NET_IDLE) return; - // Check for an unflushed LDU2 + // check for an unflushed LDU2 if (m_netLDU2[10U] != 0x00U || m_netLDU2[26U] != 0x00U || m_netLDU2[55U] != 0x00U || m_netLDU2[80U] != 0x00U || m_netLDU2[105U] != 0x00U || m_netLDU2[130U] != 0x00U || m_netLDU2[155U] != 0x00U || m_netLDU2[180U] != 0x00U || m_netLDU2[204U] != 0x00U) @@ -1986,7 +1986,6 @@ void Voice::getNextMI(uint8_t lastMI[9U], uint8_t nextMI[9U]) // shift all the list elements, except the last one for (i = 0; i < 7; i++) { - // grab high bit from the next element and use it as our low bit nextMI[i] = ((nextMI[i] & 0x7F) << 1) | (nextMI[i + 1] >> 7); } diff --git a/src/host/p25/packet/Voice.h b/src/host/p25/packet/Voice.h index 071c143b..efdfc0d0 100644 --- a/src/host/p25/packet/Voice.h +++ b/src/host/p25/packet/Voice.h @@ -60,14 +60,14 @@ namespace p25 class HOST_SW_API Voice { public: /// Resets the data states for the RF interface. - virtual void resetRF(); + void resetRF(); /// Resets the data states for the network. - virtual void resetNet(); + void resetNet(); /// Process a data frame from the RF interface. - virtual bool process(uint8_t* data, uint32_t len); + bool process(uint8_t* data, uint32_t len); /// Process a data frame from the network. - virtual bool processNetwork(uint8_t* data, uint32_t len, lc::LC& control, data::LowSpeedData& lsd, uint8_t& duid, uint8_t& frameType); + bool processNetwork(uint8_t* data, uint32_t len, lc::LC& control, data::LowSpeedData& lsd, uint8_t& duid, uint8_t& frameType); protected: friend class packet::ControlSignaling; @@ -117,7 +117,7 @@ namespace p25 /// Initializes a new instance of the Voice class. Voice(Control* p25, bool debug, bool verbose); /// Finalizes a instance of the Voice class. - virtual ~Voice(); + ~Voice(); /// Write data processed from RF to the network. void writeNetwork(const uint8_t* data, uint8_t duid, uint8_t frameType = P25_FT_DATA_UNIT); @@ -126,15 +126,15 @@ namespace p25 void writeRF_EndOfVoice(); /// Helper to write a network P25 TDU packet. - virtual void writeNet_TDU(); + void writeNet_TDU(); /// Helper to check for an unflushed LDU1 packet. void checkNet_LDU1(); /// Helper to write a network P25 LDU1 packet. - virtual void writeNet_LDU1(); + void writeNet_LDU1(); /// Helper to check for an unflushed LDU2 packet. void checkNet_LDU2(); /// Helper to write a network P25 LDU1 packet. - virtual void writeNet_LDU2(); + void writeNet_LDU2(); /// Helper to insert IMBE silence frames for missing audio. void insertMissingAudio(uint8_t* data); diff --git a/src/host/setup/AdjustWndBase.h b/src/host/setup/AdjustWndBase.h index 36305a8f..f676fb9b 100644 --- a/src/host/setup/AdjustWndBase.h +++ b/src/host/setup/AdjustWndBase.h @@ -56,7 +56,7 @@ protected: /// /// /// - virtual void initLayout() override + void initLayout() override { FDialog::setMinimizable(true); FDialog::setShadow(); @@ -135,7 +135,7 @@ protected: /// /// /// - virtual void adjustSize() override + void adjustSize() override { FDialog::adjustSize(); } @@ -148,7 +148,7 @@ protected: /// /// /// - virtual void onKeyPress(finalcut::FKeyEvent* e) + void onKeyPress(finalcut::FKeyEvent* e) override { const auto key = e->key(); if (key == FKey::F12) { @@ -163,7 +163,7 @@ protected: /// /// /// - virtual void onClose(FCloseEvent* e) override + void onClose(FCloseEvent* e) override { hide(); } diff --git a/src/host/setup/CloseWndBase.h b/src/host/setup/CloseWndBase.h index be72b7f4..ac592a16 100644 --- a/src/host/setup/CloseWndBase.h +++ b/src/host/setup/CloseWndBase.h @@ -59,7 +59,7 @@ protected: /// /// /// - virtual void initLayout() override + void initLayout() override { FDialog::setMinimizable(true); FDialog::setShadow(); @@ -114,7 +114,7 @@ protected: /// /// /// - virtual void adjustSize() override + void adjustSize() override { FDialog::adjustSize(); } @@ -127,7 +127,7 @@ protected: /// /// /// - virtual void onKeyPress(finalcut::FKeyEvent* e) + void onKeyPress(finalcut::FKeyEvent* e) override { const auto key = e->key(); if (key == FKey::F2) { @@ -139,7 +139,7 @@ protected: /// /// /// - virtual void onClose(FCloseEvent* e) override + void onClose(FCloseEvent* e) override { hide(); } diff --git a/src/host/setup/HostSetup.cpp b/src/host/setup/HostSetup.cpp index d5eb895c..84555930 100644 --- a/src/host/setup/HostSetup.cpp +++ b/src/host/setup/HostSetup.cpp @@ -24,7 +24,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "common/dmr/DMRDefines.h" -#include "common/dmr/DMRUtils.h" #include "common/p25/P25Defines.h" #include "common/p25/data/DataHeader.h" #include "common/p25/lc/LC.h" diff --git a/src/host/setup/SetupApplication.h b/src/host/setup/SetupApplication.h index 64d29f3d..1c94c966 100644 --- a/src/host/setup/SetupApplication.h +++ b/src/host/setup/SetupApplication.h @@ -56,7 +56,7 @@ protected: /// /// /// - virtual void processExternalUserEvent() + void processExternalUserEvent() override { if (m_setup->m_isConnected) { if (m_setup->m_p25TduTest && m_setup->m_queue.hasSpace(p25::P25_TDU_FRAME_LENGTH_BYTES + 2U)) { @@ -67,7 +67,7 @@ protected: p25::Sync::addP25Sync(data + 2U); // Generate NID - std::unique_ptr nid = new_unique(p25::NID, 1U); + std::unique_ptr nid = std::make_unique(1U); nid->encode(data + 2U, p25::P25_DUID_TDU); // Add busy bits diff --git a/src/monitor/MonitorApplication.h b/src/monitor/MonitorApplication.h index 5e2106a9..8bc07573 100644 --- a/src/monitor/MonitorApplication.h +++ b/src/monitor/MonitorApplication.h @@ -54,7 +54,7 @@ protected: /// /// /// - virtual void processExternalUserEvent() + void processExternalUserEvent() override { /* stub */ } diff --git a/src/monitor/MonitorMain.cpp b/src/monitor/MonitorMain.cpp index e0ea8861..5022ef94 100644 --- a/src/monitor/MonitorMain.cpp +++ b/src/monitor/MonitorMain.cpp @@ -26,7 +26,6 @@ #include "Defines.h" #include "common/yaml/Yaml.h" #include "common/Log.h" -#include "common/Utils.h" #include "MonitorMain.h" #include "MonitorApplication.h" #include "MonitorMainWnd.h" @@ -146,7 +145,7 @@ int checkArgs(int argc, char* argv[]) usage("error: %s", "must specify the monitor configuration file to use"); g_iniFile = std::string(argv[++i]); - if (g_iniFile == "") + if (g_iniFile.empty()) usage("error: %s", "monitor configuration file cannot be blank!"); p += 2; diff --git a/src/monitor/TransmitWndBase.h b/src/monitor/TransmitWndBase.h index 974e1ef2..254f3af6 100644 --- a/src/monitor/TransmitWndBase.h +++ b/src/monitor/TransmitWndBase.h @@ -62,7 +62,7 @@ protected: /// /// /// - virtual void initLayout() override + void initLayout() override { FDialog::setMinimizable(true); FDialog::setShadow(); @@ -231,7 +231,7 @@ protected: /// /// /// - virtual void adjustSize() override + void adjustSize() override { FDialog::adjustSize(); } @@ -244,7 +244,7 @@ protected: /// /// /// - virtual void onKeyPress(finalcut::FKeyEvent* e) + void onKeyPress(finalcut::FKeyEvent* e) override { const auto key = e->key(); if (key == FKey::F12) { @@ -256,7 +256,7 @@ protected: /// /// /// - virtual void onClose(FCloseEvent* e) override + void onClose(FCloseEvent* e) override { hide(); } diff --git a/src/remote/RESTClient.cpp b/src/remote/RESTClient.cpp index ae2eaabc..537254cb 100644 --- a/src/remote/RESTClient.cpp +++ b/src/remote/RESTClient.cpp @@ -34,7 +34,6 @@ #include "common/network/rest/RequestDispatcher.h" #include "common/Thread.h" #include "common/Log.h" -#include "common/Utils.h" #include "remote/RESTClient.h" using namespace network; @@ -129,10 +128,7 @@ RESTClient::RESTClient(const std::string& address, uint32_t port, const std::str /// /// Finalizes a instance of the RESTClient class. /// -RESTClient::~RESTClient() -{ - /* stub */ -} +RESTClient::~RESTClient() = default; /// /// Sends remote control command to the specified modem. diff --git a/src/remote/RESTClientMain.cpp b/src/remote/RESTClientMain.cpp index 0cbe5dd8..e11d3435 100644 --- a/src/remote/RESTClientMain.cpp +++ b/src/remote/RESTClientMain.cpp @@ -28,10 +28,8 @@ #include "fne/network/RESTDefines.h" #include "common/Thread.h" #include "common/Log.h" -#include "common/Utils.h" #include -#include #include #include #include @@ -278,7 +276,7 @@ int checkArgs(int argc, char* argv[]) usage("error: %s", "must specify the address to connect to"); g_remoteAddress = std::string(argv[++i]); - if (g_remoteAddress == "") + if (g_remoteAddress.empty()) usage("error: %s", "remote address cannot be blank!"); p += 2; @@ -298,7 +296,7 @@ int checkArgs(int argc, char* argv[]) usage("error: %s", "must specify the auth password"); g_remotePassword = std::string(argv[++i]); - if (g_remotePassword == "") + if (g_remotePassword.empty()) usage("error: %s", "remote auth password cannot be blank!"); p += 2;