refactor how GROUP VCH UPDATEs are sent; ensure notifyEnable is set to true by default;

pull/41/head
Bryan Biedenkapp 2 years ago
parent 4ae6a946f4
commit abb57affe2

@ -359,7 +359,7 @@ system:
# REST API access password for control channel. # REST API access password for control channel.
restPassword: "PASSWORD" restPassword: "PASSWORD"
# Flag indicating voice channels will notify the control channel of traffic status. # Flag indicating voice channels will notify the control channel of traffic status.
notifyEnable: false notifyEnable: true
# #
# Voice Channels # Voice Channels

@ -1798,7 +1798,7 @@ void ControlSignaling::writeRF_ControlData(uint8_t frameCnt, uint8_t n, bool adj
/** update data */ /** update data */
case 5: case 5:
if (m_p25->m_affiliations.grantSize() > 0) { if (m_p25->m_affiliations.grantSize() > 0) {
queueRF_TSBK_Ctrl(TSBK_OSP_GRP_VCH_GRANT_UPD); writeRF_TSDU_Grant_Update();
} }
break; break;
/** extra data */ /** extra data */
@ -1886,55 +1886,6 @@ void ControlSignaling::queueRF_TSBK_Ctrl(uint8_t lco)
std::unique_ptr<lc::TSBK> tsbk; std::unique_ptr<lc::TSBK> tsbk;
switch (lco) { switch (lco) {
case TSBK_OSP_GRP_VCH_GRANT_UPD:
// write group voice grant update
if (m_p25->m_affiliations.grantSize() > 0) {
if (m_mbfGrpGrntCnt >= m_p25->m_affiliations.grantSize())
m_mbfGrpGrntCnt = 0U;
std::unique_ptr<OSP_GRP_VCH_GRANT_UPD> osp = new_unique(OSP_GRP_VCH_GRANT_UPD);
DEBUG_LOG_TSBK(osp->toString());
bool noData = false;
uint8_t i = 0U;
std::unordered_map<uint32_t, uint32_t> grantTable = m_p25->m_affiliations.grantTable();
for (auto entry : grantTable) {
// no good very bad way of skipping entries...
if (i != m_mbfGrpGrntCnt) {
i++;
continue;
}
else {
uint32_t dstId = entry.first;
uint32_t chNo = entry.second;
if (chNo == 0U) {
noData = true;
m_mbfGrpGrntCnt++;
break;
}
else {
// transmit group voice grant update
osp->setLCO(TSBK_OSP_GRP_VCH_GRANT_UPD);
osp->setDstId(dstId);
osp->setGrpVchNo(chNo);
m_mbfGrpGrntCnt++;
break;
}
}
}
if (noData) {
return; // don't create anything
} else {
tsbk = std::move(osp);
}
}
else {
return; // don't create anything
}
break;
case TSBK_OSP_IDEN_UP: case TSBK_OSP_IDEN_UP:
{ {
std::vector<::lookups::IdenTable> entries = m_p25->m_idenTable->list(); std::vector<::lookups::IdenTable> entries = m_p25->m_idenTable->list();
@ -2398,6 +2349,60 @@ bool ControlSignaling::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_
return true; return true;
} }
/// <summary>
/// Helper to write a grant update packet.
/// </summary>
void ControlSignaling::writeRF_TSDU_Grant_Update()
{
// write group voice grant update
if (m_p25->m_affiliations.grantSize() > 0) {
if (m_mbfGrpGrntCnt >= m_p25->m_affiliations.grantSize())
m_mbfGrpGrntCnt = 0U;
std::unique_ptr<OSP_GRP_VCH_GRANT_UPD> osp = new_unique(OSP_GRP_VCH_GRANT_UPD);
DEBUG_LOG_TSBK(osp->toString());
bool noData = false;
uint8_t i = 0U;
std::unordered_map<uint32_t, uint32_t> grantTable = m_p25->m_affiliations.grantTable();
for (auto entry : grantTable) {
// no good very bad way of skipping entries...
if (i != m_mbfGrpGrntCnt) {
i++;
continue;
}
else {
uint32_t dstId = entry.first;
uint32_t chNo = entry.second;
if (chNo == 0U) {
noData = true;
m_mbfGrpGrntCnt++;
break;
}
else {
// transmit group voice grant update
osp->setLCO(TSBK_OSP_GRP_VCH_GRANT_UPD);
osp->setDstId(dstId);
osp->setGrpVchNo(chNo);
m_mbfGrpGrntCnt++;
break;
}
}
}
if (noData) {
return; // don't create anything
} else {
writeRF_TSDU_SBF(osp.get(), true, false, false, true);
}
}
else {
return; // don't create anything
}
}
/// <summary> /// <summary>
/// Helper to write a SNDCP grant packet. /// Helper to write a SNDCP grant packet.
/// </summary> /// </summary>

@ -200,6 +200,8 @@ namespace p25
/// <summary>Helper to write a grant packet.</summary> /// <summary>Helper to write a grant packet.</summary>
bool writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_t serviceOptions, bool grp, bool net = false, bool skip = false, uint32_t chNo = 0U); bool writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_t serviceOptions, bool grp, bool net = false, bool skip = false, uint32_t chNo = 0U);
/// <summary>Helper to write a grant update packet.</summary>
void writeRF_TSDU_Grant_Update();
/// <summary>Helper to write a SNDCP grant packet.</summary> /// <summary>Helper to write a SNDCP grant packet.</summary>
bool writeRF_TSDU_SNDCP_Grant(uint32_t srcId, uint32_t dstId, bool skip = false, bool net = false); bool writeRF_TSDU_SNDCP_Grant(uint32_t srcId, uint32_t dstId, bool skip = false, bool net = false);
/// <summary>Helper to write a unit to unit answer request packet.</summary> /// <summary>Helper to write a unit to unit answer request packet.</summary>

Loading…
Cancel
Save

Powered by TurnKey Linux.