Merge pull request #532 from maierp/maierp_ovcm_in_csbk

Include ovcm also in csbk
This commit is contained in:
Jonathan Naylor 2019-11-06 15:28:34 +00:00 committed by GitHub
commit e74df4875b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 0 deletions

View File

@ -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;

View File

@ -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;

View File

@ -437,6 +437,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();
@ -1571,6 +1574,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();