Skip to content

Commit

Permalink
Merge pull request g4klx#742 from iddq/master
Browse files Browse the repository at this point in the history
Add Radio Check CSBK
  • Loading branch information
g4klx authored Mar 6, 2022
2 parents d94043e + 82024fa commit 452be45
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions DMRCSBK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,21 @@ bool CDMRCSBK::put(const unsigned char* bytes)
CUtils::dump(1U, "Call Alert Ack CSBK", m_data, 12U);
break;

case CSBKO_RADIO_CHECK:
m_GI = false;
if (m_data[3U] == 0x80) {
m_dstId = m_data[4U] << 16 | m_data[5U] << 8 | m_data[6U];
m_srcId = m_data[7U] << 16 | m_data[8U] << 8 | m_data[9U];
CUtils::dump(1U, "Radio Check Req CSBK", m_data, 12U);
} else {
m_srcId = m_data[4U] << 16 | m_data[5U] << 8 | m_data[6U];
m_dstId = m_data[7U] << 16 | m_data[8U] << 8 | m_data[9U];
CUtils::dump(1U, "Radio Check Ack CSBK", m_data, 12U);
}
m_dataContent = false;
m_CBF = 0U;
break;

default:
m_GI = false;
m_srcId = 0U;
Expand Down
1 change: 1 addition & 0 deletions DMRCSBK.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ enum CSBKO {
CSBKO_CTCSBK = 0x07,
CSBKO_CALL_ALERT = 0x1F,
CSBKO_CALL_ALERT_ACK = 0x20,
CSBKO_RADIO_CHECK = 0x24,
CSBKO_NACKRSP = 0x26,
CSBKO_BSDWNACT = 0x38,
CSBKO_PRECCSBK = 0x3D
Expand Down
6 changes: 6 additions & 0 deletions DMRSlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,9 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len)
case CSBKO_CALL_ALERT_ACK:
LogMessage("DMR Slot %u, received RF Call Alert Ack CSBK from %s to %s%s", m_slotNo, src.c_str(), gi ? "TG " : "", dst.c_str());
break;
case CSBKO_RADIO_CHECK:
LogMessage("DMR Slot %u, received RF Radio Check %s CSBK from %s to %s%s", m_slotNo, /* TBD */ 1 ? "Req" : "Ack", src.c_str(), gi ? "TG " : "", dst.c_str());
break;
default:
LogWarning("DMR Slot %u, unhandled RF CSBK type - 0x%02X", m_slotNo, csbko);
break;
Expand Down Expand Up @@ -1695,6 +1698,9 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
case CSBKO_CALL_ALERT_ACK:
LogMessage("DMR Slot %u, received network Call Alert Ack CSBK from %s to %s%s", m_slotNo, src.c_str(), gi ? "TG " : "", dst.c_str());
break;
case CSBKO_RADIO_CHECK:
LogMessage("DMR Slot %u, received network Radio Check %s CSBK from %s to %s%s", m_slotNo, /* TBD */ 1 ? "Req" : "Ack", src.c_str(), gi ? "TG " : "", dst.c_str());
break;
default:
LogWarning("DMR Slot %u, unhandled network CSBK type - 0x%02X", m_slotNo, csbko);
break;
Expand Down

0 comments on commit 452be45

Please sign in to comment.