correct some issues with NXDN channel identification and some incorrect restriction calculations;

3.56-maint
Bryan Biedenkapp 2 years ago
parent 234279fe80
commit 01dfa15173

@ -286,11 +286,11 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw
** Site Data ** Site Data
*/ */
// calculate the NXDN location ID // calculate the NXDN location ID
uint32_t locId = NXDN_LOC_CAT_LOCAL; // DVM is currently fixed to "local" category uint32_t locId = NXDN_LOC_CAT_GLOBAL; // DVM is currently fixed to "global" category
locId = (locId << 17) + sysId; locId = (locId << 10) + (sysId & 0x3FFU);
locId = (locId << 5) + (siteId & 0x1FU); locId = (locId << 12) + (siteId & 0xFFFU);
m_siteData = SiteData(locId, channelId, channelNo, serviceClass, false); m_siteData = SiteData(locId, channelId, (channelNo & 0x3FF), serviceClass, false);
m_siteData.setCallsign(cwCallsign); m_siteData.setCallsign(cwCallsign);
for (uint32_t ch : voiceChNo) { for (uint32_t ch : voiceChNo) {

@ -63,8 +63,8 @@ namespace nxdn
/// <param name="requireReg"></param> /// <param name="requireReg"></param>
SiteData(uint32_t locId, uint8_t channelId, uint32_t channelNo, uint8_t serviceClass, bool requireReq) : SiteData(uint32_t locId, uint8_t channelId, uint32_t channelNo, uint8_t serviceClass, bool requireReq) :
m_locId(locId), m_locId(locId),
m_channelId(1U), m_channelId(channelId),
m_channelNo(1U), m_channelNo(channelNo),
m_serviceClass(NXDN_SIF1_VOICE_CALL_SVC | NXDN_SIF1_DATA_CALL_SVC), m_serviceClass(NXDN_SIF1_VOICE_CALL_SVC | NXDN_SIF1_DATA_CALL_SVC),
m_isAdjSite(false), m_isAdjSite(false),
m_callsign("CHANGEME"), m_callsign("CHANGEME"),
@ -75,8 +75,8 @@ namespace nxdn
m_locId = 0xFFFFFFU; m_locId = 0xFFFFFFU;
// channel id clamping // channel id clamping
if (channelId > 15U) if (m_channelId > 15U)
channelId = 15U; m_channelId = 15U;
// channel number clamping // channel number clamping
if (m_channelNo == 0U) { // clamp to 1 if (m_channelNo == 0U) { // clamp to 1

@ -96,11 +96,11 @@ void MESSAGE_TYPE_SITE_INFO::encode(uint8_t* data, uint32_t length, uint32_t off
// bryanb: this is currently fixed -- maybe dynamic in the future // bryanb: this is currently fixed -- maybe dynamic in the future
rcch[8U] = 0U; // Restriction Information - No access restriction / No cycle restriction rcch[8U] = 0U; // Restriction Information - No access restriction / No cycle restriction
rcch[9U] = 0x08U; // ... - No group restriction / GMS; Location Registration Restriction rcch[9U] = 0U; // ... - No group restriction / No Location Registration Restriction
rcch[10U] = (!m_siteData.netActive() ? 0x01U : 0x00U); // ... - No group ratio restriction / No delay time extension / ISO rcch[10U] = (!m_siteData.netActive() ? 0x01U : 0x00U); // ... - No group ratio restriction / No delay time extension / ISO
// bryanb: this is currently fixed -- maybe dynamic in the future // bryanb: this is currently fixed -- maybe dynamic in the future
rcch[11U] = NXDN_CH_ACCESS_BASE_FREQ_SYS_DEFINED; // Channel Access Information - Channel Version / Sys Defined Step / Sys Defined Base Freq rcch[11U] = NXDN_CH_ACCESS_BASE_FREQ_SYS_DEFINED << 2; // Channel Access Information - Channel Version / Sys Defined Step / Sys Defined Base Freq
rcch[14U] = 1U; // Version rcch[14U] = 1U; // Version

@ -83,9 +83,9 @@ void MESSAGE_TYPE_SRV_INFO::encode(uint8_t* data, uint32_t length, uint32_t offs
rcch[5U] = (m_siteData.netActive() ? NXDN_SIF2_IP_NETWORK : 0x00U); // ... rcch[5U] = (m_siteData.netActive() ? NXDN_SIF2_IP_NETWORK : 0x00U); // ...
// bryanb: this is currently fixed -- maybe dynamic in the future // bryanb: this is currently fixed -- maybe dynamic in the future
rcch[6U] = 0U; // Restriction Information - No access restriction / No cycle restriction rcch[8U] = 0U; // Restriction Information - No access restriction / No cycle restriction
rcch[7U] = 0x08U; // ... - No group restriction / GMS; Location Registration Restriction rcch[9U] = 0U; // ... - No group restriction / No Location Registration Restriction
rcch[8U] = (!m_siteData.netActive() ? 0x01U : 0x00U); // ... - No group ratio restriction / No delay time extension / ISO rcch[10U] = (!m_siteData.netActive() ? 0x01U : 0x00U); // ... - No group ratio restriction / No delay time extension / ISO
RCCH::encode(data, rcch, length, offset); RCCH::encode(data, rcch, length, offset);
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.