how did no one find this, like how was this missed? add missing affiliated flag being sent from FNE to host;

pull/72/head
Bryan Biedenkapp 1 year ago
parent cee2995389
commit ff6658cae7

@ -105,13 +105,14 @@ void TalkgroupRulesLookup::clear()
/* Adds a new entry to the lookup table by the specified unique ID. */
void TalkgroupRulesLookup::addEntry(uint32_t id, uint8_t slot, bool enabled, bool nonPreferred)
void TalkgroupRulesLookup::addEntry(uint32_t id, uint8_t slot, bool enabled, bool affiliated, bool nonPreferred)
{
TalkgroupRuleGroupVoiceSource source;
TalkgroupRuleConfig config;
source.tgId(id);
source.tgSlot(slot);
config.active(enabled);
config.affiliated(affiliated);
config.nonPreferred(nonPreferred);
std::lock_guard<std::mutex> lock(m_mutex);
@ -131,6 +132,7 @@ void TalkgroupRulesLookup::addEntry(uint32_t id, uint8_t slot, bool enabled, boo
config = it->config();
config.active(enabled);
config.affiliated(affiliated);
config.nonPreferred(nonPreferred);
TalkgroupRuleGroupVoice entry = *it;

@ -545,9 +545,10 @@ namespace lookups
* @param id Unique ID to add.
* @param slot DMR slot this talkgroup is valid on.
* @param enabled Flag indicating if talkgroup ID is enabled or not.
* @param affiliated Flag indicating if talkgroup ID requires affiliated or not.
* @param nonPreferred Flag indicating if the talkgroup ID is non-preferred.
*/
void addEntry(uint32_t id, uint8_t slot, bool enabled, bool nonPreferred = false);
void addEntry(uint32_t id, uint8_t slot, bool enabled, bool affiliated = false, bool nonPreferred = false);
/**
* @brief Adds a new entry to the lookup table.
* @param groupVoice Group Voice Configuration Block.

@ -1621,9 +1621,14 @@ void FNENetwork::writeTGIDs(uint32_t peerId)
if (entry.config().active()) {
uint8_t slotNo = entry.source().tgSlot();
// set upper bit of the slot number to flag non-preferred
// set the $80 bit of the slot number to flag non-preferred
if (nonPreferred) {
slotNo = 0x80U + (slotNo & 0x03U);
slotNo |= 0x80U;
}
// set the $40 bit of the slot number to identify if this TG is by affiliation or not
if (entry.config().affiliated()) {
slotNo |= 0x40U;
}
tgidList.push_back({ entry.source().tgId(), slotNo });

@ -413,6 +413,7 @@ void Network::clock(uint32_t ms)
for (uint32_t i = 0; i < len; i++) {
uint32_t id = __GET_UINT16(buffer, offs);
uint8_t slot = (buffer[offs + 3U]) & 0x03U;
bool affiliated = (buffer[offs + 3U] & 0x40U) == 0x40U;
bool nonPreferred = (buffer[offs + 3U] & 0x80U) == 0x80U;
lookups::TalkgroupRuleGroupVoice tid = m_tidLookup->find(id, slot);
@ -431,8 +432,9 @@ void Network::clock(uint32_t ms)
m_tidLookup->eraseEntry(id, slot);
}
LogMessage(LOG_NET, "Activated%s TG %u TS %u in TGID table", (nonPreferred) ? " non-preferred" : "", id, slot);
m_tidLookup->addEntry(id, slot, true, nonPreferred);
LogMessage(LOG_NET, "Activated%s%s TG %u TS %u in TGID table",
(nonPreferred) ? " non-preferred" : "", (affiliated) ? " affiliated" : "", id, slot);
m_tidLookup->addEntry(id, slot, true, affiliated, nonPreferred);
}
offs += 5U;

Loading…
Cancel
Save

Powered by TurnKey Linux.