diff --git a/DMRCSBK.cpp b/DMRCSBK.cpp index de7320d..ffa7115 100644 --- a/DMRCSBK.cpp +++ b/DMRCSBK.cpp @@ -149,6 +149,31 @@ unsigned char CDMRCSBK::getFID() const return m_FID; } +bool CDMRCSBK::getOVCM() const +{ + bool bOVCM = false; + // Service options informations are only available in + // "Unit to Unit Voice Service Request CSBK" and + // "Unit to Unit Voice Service Answer Response CSBK" + if (m_CSBKO == CSBKO_UUVREQ || m_CSBKO == CSBKO_UUANSRSP) + { + bOVCM = (m_data[2U] & 0x04U) == 0x04U; + } + return bOVCM; +} + +void CDMRCSBK::setOVCM(bool ovcm) +{ + // Set OVCM only in CSBKs having the service options information + if (m_CSBKO == CSBKO_UUVREQ || m_CSBKO == CSBKO_UUANSRSP) + { + if (ovcm) + m_data[2U] |= 0x04U; + else + m_data[2U] &= 0xFBU; + } +} + bool CDMRCSBK::getGI() const { return m_GI; diff --git a/DMRCSBK.h b/DMRCSBK.h index 5dc62a0..914b44d 100644 --- a/DMRCSBK.h +++ b/DMRCSBK.h @@ -45,6 +45,10 @@ public: CSBKO getCSBKO() const; unsigned char getFID() const; + // Set/Get the OVCM bit in the supported CSBKs + bool getOVCM() const; + void setOVCM(bool ovcm); + // For BS Dwn Act unsigned int getBSId() const; diff --git a/DMRSlot.cpp b/DMRSlot.cpp index 9a6d7ec..58125ad 100644 --- a/DMRSlot.cpp +++ b/DMRSlot.cpp @@ -423,6 +423,9 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len) if (csbko == CSBKO_BSDWNACT) return false; + // set the OVCM bit for the supported csbk + csbk.setOVCM(m_ovcm); + bool gi = csbk.getGI(); unsigned int srcId = csbk.getSrcId(); unsigned int dstId = csbk.getDstId(); @@ -1549,6 +1552,9 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData) if (csbko == CSBKO_BSDWNACT) return; + // set the OVCM bit for the supported csbk + csbk.setOVCM(m_ovcm); + bool gi = csbk.getGI(); unsigned int srcId = csbk.getSrcId(); unsigned int dstId = csbk.getDstId();