diff --git a/src/dmr/Control.cpp b/src/dmr/Control.cpp
index b13f583b..30a55aa5 100644
--- a/src/dmr/Control.cpp
+++ b/src/dmr/Control.cpp
@@ -412,6 +412,12 @@ void Control::tsccActivateSlot(uint32_t slotNo, uint32_t dstId, bool group)
slotNo, group, dstId);
}
+ // never allow the TSCC to become payload activated
+ if (m_tsccSlotNo == slotNo) {
+ LogError(LOG_DMR, "DMR, cowardly refusing to, TSCC payload activation, slotNo = %u", slotNo);
+ return;
+ }
+
switch (slotNo) {
case 1U:
m_tsccPayloadActive = true;
diff --git a/src/dmr/Slot.cpp b/src/dmr/Slot.cpp
index 9dc223b8..4e659c8b 100644
--- a/src/dmr/Slot.cpp
+++ b/src/dmr/Slot.cpp
@@ -164,7 +164,6 @@ Slot::Slot(uint32_t slotNo, uint32_t timeout, uint32_t tgHang, uint32_t queueSiz
m_ccHalted(false),
m_enableTSCC(false),
m_dedicatedTSCC(false),
- m_tsccActivated(false),
m_tsccPayloadDstId(0U),
m_tsccPayloadGroup(false),
m_verbose(verbose),
@@ -477,14 +476,8 @@ void Slot::clock()
}
}
- // never allow the TSCC to become payload activated
- if (m_tsccActivated && m_slotNo == m_dmr->m_tsccSlotNo) {
- ::LogDebug(LOG_DMR, "DMR Slot %u, BUG BUG tried to payload activate the TSCC slot", m_slotNo);
- clearTSCCActivated();
- }
-
// activate payload channel if requested from the TSCC
- if (m_tsccActivated) {
+ if (m_dmr->m_tsccPayloadActive) {
if (m_rfState == RS_RF_LISTENING && m_netState == RS_NET_IDLE) {
if (m_tsccPayloadDstId > 0U) {
if ((m_tsccCnt % 2) > 0) {
diff --git a/src/dmr/Slot.h b/src/dmr/Slot.h
index 183d4d90..487e6db9 100644
--- a/src/dmr/Slot.h
+++ b/src/dmr/Slot.h
@@ -106,7 +106,7 @@ namespace dmr
/// Helper to enable and configure TSCC support for this slot.
void setTSCC(bool enable, bool dedicated);
/// Sets a flag indicating whether the slot is a TSCC payload slot.
- void setTSCCActivated(uint32_t dstId, bool group) { m_tsccActivated = true; m_tsccPayloadDstId = dstId; m_tsccPayloadGroup = group; }
+ void setTSCCActivated(uint32_t dstId, bool group) { m_tsccPayloadDstId = dstId; m_tsccPayloadGroup = group; }
/// Sets a flag indicating whether the DMR control channel can send permit-tg to voice channels.
void setControlPermitTG(bool controlPermitTG) { m_controlPermitTG = controlPermitTG; }
/// Helper to set the voice error silence threshold.
@@ -192,7 +192,6 @@ namespace dmr
bool m_enableTSCC;
bool m_dedicatedTSCC;
- bool m_tsccActivated;
uint32_t m_tsccPayloadDstId;
bool m_tsccPayloadGroup;
@@ -267,7 +266,7 @@ namespace dmr
void writeRF_ControlData(uint16_t frameCnt, uint8_t n);
/// Clears the flag indicating whether the slot is a TSCC payload slot.
- void clearTSCCActivated() { m_tsccActivated = false; m_tsccPayloadDstId = 0U; m_tsccPayloadGroup = false; }
+ void clearTSCCActivated() { m_tsccPayloadDstId = 0U; m_tsccPayloadGroup = false; }
/// Helper to set the DMR short LC.
static void setShortLC(uint32_t slotNo, uint32_t id, uint8_t flco = FLCO_GROUP, bool voice = true);