DMR release trunked talkgroup grants;

2.0-maint
Bryan Biedenkapp 3 years ago
parent 73a2f03be4
commit 0d43f68814

@ -323,6 +323,25 @@ void Control::clock()
m_slot2->clock();
}
/// <summary>
/// Helper to return the slot carrying the TSCC.
/// </summary>
/// <returns>Pointer to the TSCC slot instance.</returns>
Slot* Control::getTSCCSlot() const
{
switch (m_tsccSlotNo) {
case 1U:
return m_slot1;
break;
case 2U:
return m_slot2;
break;
default:
LogError(LOG_NET, "DMR, invalid slot, TSCC disabled, slotNo = %u", m_tsccSlotNo);
return NULL;
}
}
/// <summary>
/// Helper to write a DMR extended function packet on the RF interface.
/// </summary>
@ -399,26 +418,3 @@ void Control::setCSBKVerbose(bool verbose)
m_slot1->setCSBKVerbose(verbose);
m_slot2->setCSBKVerbose(verbose);
}
// ---------------------------------------------------------------------------
// Private Class Members
// ---------------------------------------------------------------------------
/// <summary>
/// Helper to return the slot carrying the TSCC.
/// </summary>
/// <returns>Pointer to the TSCC slot instance.</returns>
Slot* Control::getTSCCSlot() const
{
switch (m_tsccSlotNo) {
case 1U:
return m_slot1;
break;
case 2U:
return m_slot2;
break;
default:
LogError(LOG_NET, "DMR, invalid slot, TSCC disabled, slotNo = %u", m_tsccSlotNo);
return NULL;
}
}

@ -90,6 +90,9 @@ namespace dmr
/// <summary>Updates the processor.</summary>
void clock();
/// <summary>Helper to return the slot carrying the TSCC.</summary>
Slot* getTSCCSlot() const;
/// <summary>Helper to write a DMR extended function packet on the RF interface.</summary>
void writeRF_Ext_Func(uint32_t slotNo, uint32_t func, uint32_t arg, uint32_t dstId);
/// <summary>Helper to write a DMR call alert packet on the RF interface.</summary>
@ -111,7 +114,6 @@ namespace dmr
private:
friend class Slot;
friend class packet::ControlSignaling;
uint32_t m_colorCode;
@ -132,9 +134,6 @@ namespace dmr
bool m_dumpCSBKData;
bool m_verbose;
bool m_debug;
/// <summary>Helper to return the slot carrying the TSCC.</summary>
Slot* getTSCCSlot() const;
};
} // namespace dmr

@ -203,6 +203,14 @@ bool Slot::processFrame(uint8_t *data, uint32_t len)
LogMessage(LOG_RF, "DMR Slot %u, total frames: %d, total bits: %d, errors: %d, BER: %.4f%%",
m_slotNo, m_rfFrames, m_rfBits, m_rfErrs, float(m_rfErrs * 100U) / float(m_rfBits));
// release trunked grant (if necessary)
Slot *m_tscc = m_dmr->getTSCCSlot();
if (m_tscc != NULL) {
if (m_tscc->m_enableTSCC && m_rfLC != NULL) {
m_tscc->m_affiliations->releaseGrant(m_rfLC->getDstId(), false);
}
}
if (m_rfTimeout) {
writeEndRF();
return false;

@ -116,6 +116,14 @@ bool Data::process(uint8_t* data, uint32_t len)
LogMessage(LOG_RF, DMR_DT_TERMINATOR_WITH_LC ", slot = %u, dstId = %u", m_slot->m_slotNo, m_slot->m_rfLC->getDstId());
}
// release trunked grant (if necessary)
Slot *m_tscc = m_slot->m_dmr->getTSCCSlot();
if (m_tscc != NULL) {
if (m_tscc->m_enableTSCC) {
m_tscc->m_affiliations->releaseGrant(m_slot->m_rfLC->getDstId(), false);
}
}
if (m_slot->m_rssi != 0U) {
::ActivityLog("DMR", true, "Slot %u RF end of voice transmission, %.1f seconds, BER: %.1f%%, RSSI: -%u/-%u/-%u dBm",
m_slot->m_slotNo, float(m_slot->m_rfFrames) / 16.667F, float(m_slot->m_rfErrs * 100U) / float(m_slot->m_rfBits),

Loading…
Cancel
Save

Powered by TurnKey Linux.