Skip to content

Commit

Permalink
Also set the OVCM bit in the two supported CSBKs: "Unit to Unit Voice…
Browse files Browse the repository at this point in the history
… Service Request CSBK" and "Unit to Unit Voice Service Answer Response CSBK"
  • Loading branch information
maierp committed Oct 18, 2019
1 parent 73bf04a commit 1993262
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
25 changes: 25 additions & 0 deletions DMRCSBK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions DMRCSBK.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ class CDMRCSBK
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;

Expand Down
6 changes: 6 additions & 0 deletions DMRSlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 1993262

Please sign in to comment.