Skip to content

Commit

Permalink
Add decode for Call Alert and Call Alert Ack CSBKs.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Mar 2, 2020
1 parent 8d87037 commit ab13f35
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
20 changes: 19 additions & 1 deletion DMRCSBK.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX
* Copyright (C) 2019 by Patrick Maier DK5MP
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -111,6 +111,24 @@ bool CDMRCSBK::put(const unsigned char* bytes)
CUtils::dump(1U, "Negative Acknowledge Response CSBK", m_data, 12U);
break;

case CSBKO_CALL_ALERT:
m_GI = false;
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];
m_dataContent = false;
m_CBF = 0U;
CUtils::dump(1U, "Call Alert CSBK", m_data, 12U);
break;

case CSBKO_CALL_ALERT_ACK:
m_GI = false;
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];
m_dataContent = false;
m_CBF = 0U;
CUtils::dump(1U, "Call Alert Ack CSBK", m_data, 12U);
break;

default:
m_GI = false;
m_srcId = 0U;
Expand Down
16 changes: 9 additions & 7 deletions DMRCSBK.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
#include "DMRDefines.h"

enum CSBKO {
CSBKO_NONE = 0x00,
CSBKO_UUVREQ = 0x04,
CSBKO_UUANSRSP = 0x05,
CSBKO_CTCSBK = 0x07,
CSBKO_NACKRSP = 0x26,
CSBKO_BSDWNACT = 0x38,
CSBKO_PRECCSBK = 0x3D
CSBKO_NONE = 0x00,
CSBKO_UUVREQ = 0x04,
CSBKO_UUANSRSP = 0x05,
CSBKO_CTCSBK = 0x07,
CSBKO_CALL_ALERT = 0x1F,
CSBKO_CALL_ALERT_ACK = 0x20,
CSBKO_NACKRSP = 0x26,
CSBKO_BSDWNACT = 0x38,
CSBKO_PRECCSBK = 0x3D
};

class CDMRCSBK
Expand Down
12 changes: 12 additions & 0 deletions DMRSlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,12 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len)
case CSBKO_PRECCSBK:
LogMessage("DMR Slot %u, received RF %s Preamble CSBK (%u to follow) from %s to %s%s", m_slotNo, csbk.getDataContent() ? "Data" : "CSBK", csbk.getCBF(), src.c_str(), gi ? "TG ": "", dst.c_str());
break;
case CSBKO_CALL_ALERT:
LogMessage("DMR Slot %u, received RF Call Alert CSBK from %s to %s%s", m_slotNo, src.c_str(), gi ? "TG " : "", dst.c_str());
break;
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;
default:
LogWarning("DMR Slot %u, unhandled RF CSBK type - 0x%02X", m_slotNo, csbko);
break;
Expand Down Expand Up @@ -1641,6 +1647,12 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
case CSBKO_PRECCSBK:
LogMessage("DMR Slot %u, received network %s Preamble CSBK (%u to follow) from %s to %s%s", m_slotNo, csbk.getDataContent() ? "Data" : "CSBK", csbk.getCBF(), src.c_str(), gi ? "TG " : "", dst.c_str());
break;
case CSBKO_CALL_ALERT:
LogMessage("DMR Slot %u, received network Call Alert CSBK from %s to %s%s", m_slotNo, src.c_str(), gi ? "TG " : "", dst.c_str());
break;
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;
default:
LogWarning("DMR Slot %u, unhandled network CSBK type - 0x%02X", m_slotNo, csbko);
break;
Expand Down

0 comments on commit ab13f35

Please sign in to comment.