remove grant rsp/req from normal network path (this is being rearchitected); add new plumbing for determining if a DVM is authoritative for repeating traffic and auto-granting;

3.0-rcon_maint
Bryan Biedenkapp 3 years ago
parent 471a00fa04
commit ea84df2228

@ -17,7 +17,6 @@ network:
updateLookups: false
allowActivityTransfer: true
allowDiagnosticTransfer: true
handleChGrants: false
debug: false
rconEnable: false
rconAddress: 127.0.0.1
@ -119,6 +118,7 @@ system:
power: 10
location: "Repeater Site, Antarctica"
config:
authoritative: true
channelId: 2
channelNo: 1
dmrNetId: 1

@ -43,6 +43,7 @@ using namespace dmr;
/// <summary>
/// Initializes a new instance of the Control class.
/// </summary>
/// <param name="authoritative">Flag indicating whether or not the DVM is grant authoritative.</param>
/// <param name="colorCode">DMR access color code.</param>
/// <param name="callHang">Amount of hangtime for a DMR call.</param>
/// <param name="queueSize">Size of DMR data frame ring buffer.</param>
@ -63,10 +64,11 @@ using namespace dmr;
/// <param name="dumpCSBKData"></param>
/// <param name="debug">Flag indicating whether DMR debug is enabled.</param>
/// <param name="verbose">Flag indicating whether DMR verbose logging is enabled.</param>
Control::Control(uint32_t colorCode, uint32_t callHang, uint32_t queueSize, bool embeddedLCOnly,
Control::Control(bool authoritative, uint32_t colorCode, uint32_t callHang, uint32_t queueSize, bool embeddedLCOnly,
bool dumpTAData, uint32_t timeout, uint32_t tgHang, modem::Modem* modem, network::BaseNetwork* network, bool duplex,
lookups::RadioIdLookup* ridLookup, lookups::TalkgroupIdLookup* tidLookup, lookups::IdenTableLookup* idenTable, lookups::RSSIInterpolator* rssiMapper,
uint32_t jitter, bool dumpDataPacket, bool repeatDataPacket, bool dumpCSBKData, bool debug, bool verbose) :
m_authoritative(authoritative),
m_colorCode(colorCode),
m_modem(modem),
m_network(network),
@ -89,7 +91,7 @@ Control::Control(uint32_t colorCode, uint32_t callHang, uint32_t queueSize, bool
assert(rssiMapper != nullptr);
acl::AccessControl::init(m_ridLookup, m_tidLookup);
Slot::init(this, colorCode, SiteData(), embeddedLCOnly, dumpTAData, callHang, modem, network, duplex, m_ridLookup, m_tidLookup, m_idenTable, rssiMapper, jitter, verbose);
Slot::init(this, authoritative, colorCode, SiteData(), embeddedLCOnly, dumpTAData, callHang, modem, network, duplex, m_ridLookup, m_tidLookup, m_idenTable, rssiMapper, jitter, verbose);
m_slot1 = new Slot(1U, timeout, tgHang, queueSize, dumpDataPacket, repeatDataPacket, dumpCSBKData, debug, verbose);
m_slot2 = new Slot(2U, timeout, tgHang, queueSize, dumpDataPacket, repeatDataPacket, dumpCSBKData, debug, verbose);

@ -60,7 +60,7 @@ namespace dmr
class HOST_SW_API Control {
public:
/// <summary>Initializes a new instance of the Control class.</summary>
Control(uint32_t colorCode, uint32_t callHang, uint32_t queueSize, bool embeddedLCOnly,
Control(bool authoritative, uint32_t colorCode, uint32_t callHang, uint32_t queueSize, bool embeddedLCOnly,
bool dumpTAData, uint32_t timeout, uint32_t tgHang, modem::Modem* modem, network::BaseNetwork* network, bool duplex,
lookups::RadioIdLookup* ridLookup, lookups::TalkgroupIdLookup* tidLookup, lookups::IdenTableLookup* idenTable, lookups::RSSIInterpolator* rssi,
uint32_t jitter, bool dumpDataPacket, bool repeatDataPacket, bool dumpCSBKData, bool debug, bool verbose);
@ -115,6 +115,8 @@ namespace dmr
private:
friend class Slot;
bool m_authoritative;
uint32_t m_colorCode;
modem::Modem* m_modem;

@ -56,6 +56,8 @@ const uint16_t TSCC_MAX_CNT = 511U;
Control* Slot::m_dmr = nullptr;
bool Slot::m_authoritative = true;
uint32_t Slot::m_colorCode = 0U;
SiteData Slot::m_siteData = SiteData();
@ -574,6 +576,7 @@ void Slot::setSilenceThreshold(uint32_t threshold)
/// Helper to initialize the DMR slot processor.
/// </summary>
/// <param name="dmr">Instance of the Control class.</param>
/// <param name="authoritative">Flag indicating whether or not the DVM is grant authoritative.</param>
/// <param name="colorCode">DMR access color code.</param>
/// <param name="siteData">DMR site data.</param>
/// <param name="embeddedLCOnly"></param>
@ -588,7 +591,7 @@ void Slot::setSilenceThreshold(uint32_t threshold)
/// <param name="rssi">Instance of the RSSIInterpolator class.</param>
/// <param name="jitter"></param>
/// <param name="verbose"></param>
void Slot::init(Control* dmr, uint32_t colorCode, SiteData siteData, bool embeddedLCOnly, bool dumpTAData, uint32_t callHang, modem::Modem* modem,
void Slot::init(Control* dmr, bool authoritative, uint32_t colorCode, SiteData siteData, bool embeddedLCOnly, bool dumpTAData, uint32_t callHang, modem::Modem* modem,
network::BaseNetwork* network, bool duplex, lookups::RadioIdLookup* ridLookup, lookups::TalkgroupIdLookup* tidLookup,
lookups::IdenTableLookup* idenTable, lookups::RSSIInterpolator* rssiMapper, uint32_t jitter, bool verbose)
{
@ -601,6 +604,8 @@ void Slot::init(Control* dmr, uint32_t colorCode, SiteData siteData, bool embedd
m_dmr = dmr;
m_authoritative = authoritative;
m_colorCode = colorCode;
m_siteData = siteData;

@ -106,7 +106,7 @@ namespace dmr
void setSilenceThreshold(uint32_t threshold);
/// <summary>Helper to initialize the slot processor.</summary>
static void init(Control* dmr, uint32_t colorCode, SiteData siteData, bool embeddedLCOnly, bool dumpTAData, uint32_t callHang, modem::Modem* modem,
static void init(Control* dmr, bool authoritative, uint32_t colorCode, SiteData siteData, bool embeddedLCOnly, bool dumpTAData, uint32_t callHang, modem::Modem* modem,
network::BaseNetwork* network, bool duplex, lookups::RadioIdLookup* ridLookup, lookups::TalkgroupIdLookup* tidLookup,
lookups::IdenTableLookup* idenTable, lookups::RSSIInterpolator* rssiMapper, uint32_t jitter, bool verbose);
/// <summary>Sets local configured site data.</summary>
@ -187,6 +187,8 @@ namespace dmr
static Control* m_dmr;
static bool m_authoritative;
static uint32_t m_colorCode;
static SiteData m_siteData;

@ -738,13 +738,6 @@ bool ControlSignaling::writeRF_CSBK_Grant(uint32_t srcId, uint32_t dstId, uint8_
return true; // do not generate grant packets for $FFFF (All Call) TGID
}
// do we have a network connection and are we handling grants at the network?
if (m_tscc->m_network != nullptr) {
if (m_tscc->m_network->isHandlingChGrants() && m_tscc->m_siteData.netActive() && !skipNetCheck) {
return m_tscc->m_network->writeGrantReq(grp, srcId, dstId);
}
}
// are we skipping checking?
if (!skip) {
if (m_slot->m_rfState != RS_RF_LISTENING && m_slot->m_rfState != RS_RF_DATA) {

@ -134,6 +134,7 @@ Host::Host(const std::string& confFile) :
m_p25SysId(1U),
m_p25RfssId(1U),
m_nxdnRAN(1U),
m_authoritative(true),
m_activeTickDelay(5U),
m_idleTickDelay(5U),
m_remoteControl(nullptr)
@ -441,7 +442,7 @@ int Host::run()
g_fireDMRBeacon = true;
}
dmr = std::unique_ptr<dmr::Control>(new dmr::Control(m_dmrColorCode, callHang, queueSizeBytes, embeddedLCOnly, dumpTAData, m_timeout, m_rfTalkgroupHang,
dmr = std::unique_ptr<dmr::Control>(new dmr::Control(m_authoritative, m_dmrColorCode, callHang, queueSizeBytes, embeddedLCOnly, dumpTAData, m_timeout, m_rfTalkgroupHang,
m_modem, m_network, m_duplex, m_ridLookup, m_tidLookup, m_idenTable, rssi, jitter, dmrDumpDataPacket, dmrRepeatDataPacket,
dmrDumpCsbkData, dmrDebug, dmrVerbose));
dmr->setOptions(m_conf, m_dmrNetId, m_siteId, m_channelId, m_channelNo, true);
@ -531,7 +532,7 @@ int Host::run()
}
}
p25 = std::unique_ptr<p25::Control>(new p25::Control(m_p25NAC, callHang, queueSizeBytes, m_modem, m_network, m_timeout, m_rfTalkgroupHang,
p25 = std::unique_ptr<p25::Control>(new p25::Control(m_authoritative, m_p25NAC, callHang, queueSizeBytes, m_modem, m_network, m_timeout, m_rfTalkgroupHang,
m_duplex, m_ridLookup, m_tidLookup, m_idenTable, rssi, p25DumpDataPacket, p25RepeatDataPacket,
p25DumpTsbkData, p25Debug, p25Verbose));
p25->setOptions(m_conf, m_cwCallsign, m_voiceChNo, m_p25PatchSuperGroup, m_p25NetId, m_p25SysId, m_p25RfssId,
@ -613,7 +614,7 @@ int Host::run()
}
}
nxdn = std::unique_ptr<nxdn::Control>(new nxdn::Control(m_nxdnRAN, callHang, queueSizeBytes, m_timeout, m_rfTalkgroupHang,
nxdn = std::unique_ptr<nxdn::Control>(new nxdn::Control(m_authoritative, m_nxdnRAN, callHang, queueSizeBytes, m_timeout, m_rfTalkgroupHang,
m_modem, m_network, m_duplex, m_ridLookup, m_tidLookup, m_idenTable, rssi,
nxdnDumpRcchData, nxdnDebug, nxdnVerbose));
nxdn->setOptions(m_conf, m_cwCallsign, m_voiceChNo, m_siteId, m_channelId, m_channelNo, true);
@ -1920,7 +1921,10 @@ bool Host::readParams()
m_nxdnRAN = rfssConfig["ran"].as<uint32_t>(1U);
m_authoritative = rfssConfig["authoritative"].as<bool>(true);
LogInfo("System Config Parameters");
LogInfo(" Authoritative: %s", m_authoritative ? "yes" : "no");
LogInfo(" RX Frequency: %uHz", m_rxFrequency);
LogInfo(" TX Frequency: %uHz", m_txFrequency);
LogInfo(" Base Frequency: %uHz", entry.baseFrequency());
@ -2242,7 +2246,6 @@ bool Host::createNetwork()
bool allowActivityTransfer = networkConf["allowActivityTransfer"].as<bool>(false);
bool allowDiagnosticTransfer = networkConf["allowDiagnosticTransfer"].as<bool>(false);
bool updateLookup = networkConf["updateLookups"].as<bool>(false);
bool handleChGrants = networkConf["handleChGrants"].as<bool>(false);
bool debug = networkConf["debug"].as<bool>(false);
if (rconPassword.length() > 64) {
@ -2270,7 +2273,6 @@ bool Host::createNetwork()
LogInfo(" Allow Activity Log Transfer: %s", allowActivityTransfer ? "yes" : "no");
LogInfo(" Allow Diagnostic Log Transfer: %s", allowDiagnosticTransfer ? "yes" : "no");
LogInfo(" Update Lookups: %s", updateLookup ? "yes" : "no");
LogInfo(" Handle Channel Grants: %s", handleChGrants ? "yes" : "no");
if (debug) {
LogInfo(" Debug: yes");
@ -2288,7 +2290,7 @@ bool Host::createNetwork()
// initialize networking
if (netEnable) {
m_network = new Network(address, port, local, id, password, m_duplex, debug, m_dmrEnabled, m_p25Enabled, m_nxdnEnabled, slot1, slot2, allowActivityTransfer, allowDiagnosticTransfer, updateLookup, handleChGrants);
m_network = new Network(address, port, local, id, password, m_duplex, debug, m_dmrEnabled, m_p25Enabled, m_nxdnEnabled, slot1, slot2, allowActivityTransfer, allowDiagnosticTransfer, updateLookup);
m_network->setLookups(m_ridLookup, m_tidLookup);
m_network->setMetadata(m_identity, m_rxFrequency, m_txFrequency, entry.txOffsetMhz(), entry.chBandwidthKhz(), m_channelId, m_channelNo,

@ -133,6 +133,8 @@ private:
uint8_t m_p25RfssId;
uint32_t m_nxdnRAN;
bool m_authoritative;
uint8_t m_activeTickDelay;
uint8_t m_idleTickDelay;

@ -55,14 +55,12 @@ using namespace network;
/// <param name="slot2">Flag indicating whether DMR slot 2 is enabled for network traffic.</param>
/// <param name="allowActivityTransfer">Flag indicating that the system activity logs will be sent to the network.</param>
/// <param name="allowDiagnosticTransfer">Flag indicating that the system diagnostic logs will be sent to the network.</param>
/// <param name="handleChGrants">Flag indicating that the system will handle channel grants from the network.</param>
BaseNetwork::BaseNetwork(uint16_t localPort, uint32_t id, bool duplex, bool debug, bool slot1, bool slot2, bool allowActivityTransfer, bool allowDiagnosticTransfer, bool handleChGrants) :
BaseNetwork::BaseNetwork(uint16_t localPort, uint32_t id, bool duplex, bool debug, bool slot1, bool slot2, bool allowActivityTransfer, bool allowDiagnosticTransfer) :
m_id(id),
m_slot1(slot1),
m_slot2(slot2),
m_allowActivityTransfer(allowActivityTransfer),
m_allowDiagnosticTransfer(allowDiagnosticTransfer),
m_handleChGrants(handleChGrants),
m_duplex(duplex),
m_debug(debug),
m_addr(),
@ -307,39 +305,6 @@ uint8_t* BaseNetwork::readNXDN(bool& ret, nxdn::lc::RTCH& lc, uint32_t& len)
return data;
}
/// <summary>
/// Reads a channel grant request from the network.
/// </summary>
/// <param name="grp"></param>
/// <param name="srcId"></param>
/// <param name="dstId"></param>
/// <param name="grpVchNo"></param>
/// <returns></returns>
bool BaseNetwork::readGrantRsp(bool& grp, uint32_t& srcId, uint32_t& dstId, uint32_t& grpVchNo)
{
if (!m_handleChGrants)
return false;
if (m_status != NET_STAT_RUNNING && m_status != NET_STAT_MST_RUNNING)
return false;
if (m_rxGrantData.isEmpty())
return false;
uint8_t length = 0U;
m_rxGrantData.getData(&length, 1U);
m_rxGrantData.getData(m_buffer, length);
srcId = (m_buffer[5U] << 16) | (m_buffer[6U] << 8) | (m_buffer[7U] << 0);
dstId = (m_buffer[8U] << 16) | (m_buffer[9U] << 8) | (m_buffer[10U] << 0);
grp = m_buffer[11U] == 1U;
grpVchNo = (m_buffer[12U] << 16) | (m_buffer[13U] << 8) | (m_buffer[14U] << 0);
return true;
}
/// <summary>
/// Writes DMR frame data to the network.
/// </summary>
@ -501,40 +466,6 @@ bool BaseNetwork::writeNXDN(const nxdn::lc::RTCH& lc, const uint8_t* data, const
return writeNXDN(m_id, m_nxdnStreamId, lc, data, len);
}
/// <summary>
/// Writes a channel grant request to the network.
/// </summary>
/// <param name="grp"></param>
/// <param name="srcId"></param>
/// <param name="dstId"></param>
/// <returns></returns>
bool BaseNetwork::writeGrantReq(const bool grp, const uint32_t srcId, const uint32_t dstId)
{
if (!m_handleChGrants)
return false;
if (m_status != NET_STAT_RUNNING && m_status != NET_STAT_MST_RUNNING)
return false;
uint8_t buffer[DATA_PACKET_LENGTH];
::memset(buffer, 0x00U, DATA_PACKET_LENGTH);
::memcpy(buffer + 0U, TAG_REPEATER_GRANT, 7U);
__SET_UINT16(srcId, buffer, 5U); // Source Address
__SET_UINT16(dstId, buffer, 8U); // Target Address
buffer[11U] = (grp) ? 1U : 0U; // Group/Individual Grant
__SET_UINT32(m_id, buffer, 12U); // Peer ID
if (m_debug)
Utils::dump(1U, "Network Transmitted, DMR", buffer, (32U + PACKET_PAD));
return write(buffer, (32U + PACKET_PAD));
}
/// <summary>
/// Writes the local activity log to the network.
/// </summary>

@ -83,8 +83,6 @@
#define TAG_REPEATER_CLOSING "RPTCL"
#define TAG_REPEATER_PING "RPTPING"
#define TAG_REPEATER_GRANT "RPTGRNT"
#define TAG_TRANSFER_ACT_LOG "TRNSLOG"
#define TAG_TRANSFER_DIAG_LOG "TRNSDIAG"
@ -127,16 +125,13 @@ namespace network
class HOST_SW_API BaseNetwork {
public:
/// <summary>Initializes a new instance of the BaseNetwork class.</summary>
BaseNetwork(uint16_t localPort, uint32_t id, bool duplex, bool debug, bool slot1, bool slot2, bool allowActivityTransfer, bool allowDiagnosticTransfer, bool handleChGrants);
BaseNetwork(uint16_t localPort, uint32_t id, bool duplex, bool debug, bool slot1, bool slot2, bool allowActivityTransfer, bool allowDiagnosticTransfer);
/// <summary>Finalizes a instance of the BaseNetwork class.</summary>
virtual ~BaseNetwork();
/// <summary>Gets the current status of the network.</summary>
NET_CONN_STATUS getStatus() { return m_status; }
/// <summary>Gets the flag indicating if the network is handling channel grants.</summary>
bool isHandlingChGrants() { return m_handleChGrants; }
/// <summary>Reads DMR frame data from the DMR ring buffer.</summary>
virtual bool readDMR(dmr::data::Data& data);
/// <summary>Reads P25 frame data from the P25 ring buffer.</summary>
@ -144,9 +139,6 @@ namespace network
/// <summary>Reads NXDN frame data from the NXDN ring buffer.</summary>
virtual uint8_t* readNXDN(bool& ret, nxdn::lc::RTCH& lc, uint32_t& len);
/// <summary>Reads a channel grant request from the network.</summary>
virtual bool readGrantRsp(bool& grp, uint32_t& srcId, uint32_t& dstId, uint32_t& grpVchNo);
/// <summary>Writes DMR frame data to the network.</summary>
virtual bool writeDMR(const dmr::data::Data& data);
/// <summary>Writes P25 LDU1 frame data to the network.</summary>
@ -164,9 +156,6 @@ namespace network
/// <summary>Writes NXDN frame data to the network.</summary>
virtual bool writeNXDN(const nxdn::lc::RTCH& lc, const uint8_t* data, const uint32_t len);
/// <summary>Writes a channel grant request to the network.</summary>
virtual bool writeGrantReq(const bool grp, const uint32_t srcId, const uint32_t dstId);
/// <summary>Writes the local activity log to the network.</summary>
virtual bool writeActLog(const char* message);
@ -197,7 +186,6 @@ namespace network
bool m_allowActivityTransfer;
bool m_allowDiagnosticTransfer;
bool m_handleChGrants;
bool m_duplex;
bool m_debug;

@ -63,10 +63,9 @@ using namespace network;
/// <param name="allowActivityTransfer">Flag indicating that the system activity logs will be sent to the network.</param>
/// <param name="allowDiagnosticTransfer">Flag indicating that the system diagnostic logs will be sent to the network.</param>
/// <param name="updateLookup">Flag indicating that the system will accept radio ID and talkgroup ID lookups from the network.</param>
/// <param name="handleChGrants">Flag indicating that the system will handle channel grants from the network.</param>
Network::Network(const std::string& address, uint16_t port, uint16_t local, uint32_t id, const std::string& password,
bool duplex, bool debug, bool dmr, bool p25, bool nxdn, bool slot1, bool slot2, bool allowActivityTransfer, bool allowDiagnosticTransfer, bool updateLookup, bool handleChGrants) :
BaseNetwork(local, id, duplex, debug, slot1, slot2, allowActivityTransfer, allowDiagnosticTransfer, handleChGrants),
bool duplex, bool debug, bool dmr, bool p25, bool nxdn, bool slot1, bool slot2, bool allowActivityTransfer, bool allowDiagnosticTransfer, bool updateLookup) :
BaseNetwork(local, id, duplex, debug, slot1, slot2, allowActivityTransfer, allowDiagnosticTransfer),
m_address(address),
m_port(port),
m_password(password),
@ -367,16 +366,6 @@ void Network::clock(uint32_t ms)
else if (::memcmp(m_buffer, TAG_MASTER_PONG, 7U) == 0) {
m_timeoutTimer.start();
}
else if (::memcmp(m_buffer, TAG_MASTER_GRANT, 7U) == 0) {
if (m_enabled && m_handleChGrants) {
if (m_debug)
Utils::dump(1U, "Network Received, Channel Grant", m_buffer, length);
uint8_t len = length;
m_rxGrantData.addData(&len, 1U);
m_rxGrantData.addData(m_buffer, len);
}
}
else {
Utils::dump("Unknown packet from the master", m_buffer, length);
}

@ -50,7 +50,7 @@ namespace network
public:
/// <summary>Initializes a new instance of the Network class.</summary>
Network(const std::string& address, uint16_t port, uint16_t local, uint32_t id, const std::string& password,
bool duplex, bool debug, bool dmr, bool p25, bool nxdn, bool slot1, bool slot2, bool transferActivityLog, bool transferDiagnosticLog, bool updateLookup, bool handleChGrants);
bool duplex, bool debug, bool dmr, bool p25, bool nxdn, bool slot1, bool slot2, bool transferActivityLog, bool transferDiagnosticLog, bool updateLookup);
/// <summary>Finalizes a instance of the Network class.</summary>
~Network();

@ -71,6 +71,7 @@ const uint8_t SCRAMBLER[] = {
/// <summary>
/// Initializes a new instance of the Control class.
/// </summary>
/// <param name="authoritative">Flag indicating whether or not the DVM is grant authoritative.</param>
/// <param name="ran">NXDN Radio Access Number.</param>
/// <param name="callHang">Amount of hangtime for a NXDN call.</param>
/// <param name="queueSize">Modem frame buffer queue size (bytes).</param>
@ -86,12 +87,13 @@ const uint8_t SCRAMBLER[] = {
/// <param name="dumpRCCHData">Flag indicating whether RCCH data is dumped to the log.</param>
/// <param name="debug">Flag indicating whether P25 debug is enabled.</param>
/// <param name="verbose">Flag indicating whether P25 verbose logging is enabled.</param>
Control::Control(uint32_t ran, uint32_t callHang, uint32_t queueSize, uint32_t timeout, uint32_t tgHang,
Control::Control(bool authoritative, uint32_t ran, uint32_t callHang, uint32_t queueSize, uint32_t timeout, uint32_t tgHang,
modem::Modem* modem, network::BaseNetwork* network, bool duplex, lookups::RadioIdLookup* ridLookup,
lookups::TalkgroupIdLookup* tidLookup, lookups::IdenTableLookup* idenTable, lookups::RSSIInterpolator* rssiMapper,
bool dumpRCCHData, bool debug, bool verbose) :
m_voice(nullptr),
m_data(nullptr),
m_authoritative(authoritative),
m_ran(ran),
m_timeout(timeout),
m_modem(modem),

@ -72,7 +72,7 @@ namespace nxdn
class HOST_SW_API Control {
public:
/// <summary>Initializes a new instance of the Control class.</summary>
Control(uint32_t ran, uint32_t callHang, uint32_t queueSize, uint32_t timeout, uint32_t tgHang,
Control(bool authoritative, uint32_t ran, uint32_t callHang, uint32_t queueSize, uint32_t timeout, uint32_t tgHang,
modem::Modem* modem, network::BaseNetwork* network, bool duplex, lookups::RadioIdLookup* ridLookup,
lookups::TalkgroupIdLookup* tidLookup, lookups::IdenTableLookup* idenTable, lookups::RSSIInterpolator* rssiMapper,
bool dumpRCCHData, bool debug, bool verbose);
@ -125,6 +125,8 @@ namespace nxdn
friend class packet::Trunk;
packet::Trunk* m_trunk;
bool m_authoritative;
uint32_t m_ran;
uint32_t m_timeout;

@ -244,20 +244,6 @@ bool Trunk::processNetwork(uint8_t fct, uint8_t option, lc::RTCH& netLC, uint8_t
void Trunk::clock(uint32_t ms)
{
if (m_nxdn->m_control) {
if (m_nxdn->m_network != nullptr) {
if (m_nxdn->m_network->isHandlingChGrants() && m_nxdn->m_siteData.netActive()) {
bool grp = true;
uint32_t srcId = 0U;
uint32_t dstId = 0U;
uint32_t grpVchNo = 0U;
// do we have a grant response?
if (m_nxdn->m_network->readGrantRsp(grp, srcId, dstId, grpVchNo)) {
writeRF_Message_Grant(srcId, dstId, 0U, grp, true, grpVchNo, true, true);
}
}
}
// clock all the grant timers
m_nxdn->m_affiliations.clock(ms);
}
@ -433,13 +419,6 @@ bool Trunk::writeRF_Message_Grant(uint32_t srcId, uint32_t dstId, uint8_t servic
bool encryption = ((serviceOptions & 0xFFU) & 0x40U) == 0x40U; // Encryption Flag
uint8_t priority = ((serviceOptions & 0xFFU) & 0x07U); // Priority
// do we have a network connection and are we handling grants at the network?
if (m_nxdn->m_network != nullptr) {
if (m_nxdn->m_network->isHandlingChGrants() && m_nxdn->m_siteData.netActive() && !skipNetCheck) {
return m_nxdn->m_network->writeGrantReq(grp, srcId, dstId);
}
}
// are we skipping checking?
if (!skip) {
if (m_nxdn->m_rfState != RS_RF_LISTENING && m_nxdn->m_rfState != RS_RF_DATA) {

@ -64,6 +64,7 @@ const uint32_t MAX_PREAMBLE_TDU_CNT = 64U;
/// <summary>
/// Initializes a new instance of the Control class.
/// </summary>
/// <param name="authoritative">Flag indicating whether or not the DVM is grant authoritative.</param>
/// <param name="nac">P25 Network Access Code.</param>
/// <param name="callHang">Amount of hangtime for a P25 call.</param>
/// <param name="queueSize">Modem frame buffer queue size (bytes).</param>
@ -81,13 +82,14 @@ const uint32_t MAX_PREAMBLE_TDU_CNT = 64U;
/// <param name="dumpTSBKData">Flag indicating whether TSBK data is dumped to the log.</param>
/// <param name="debug">Flag indicating whether P25 debug is enabled.</param>
/// <param name="verbose">Flag indicating whether P25 verbose logging is enabled.</param>
Control::Control(uint32_t nac, uint32_t callHang, uint32_t queueSize, modem::Modem* modem, network::BaseNetwork* network,
Control::Control(bool authoritative, uint32_t nac, uint32_t callHang, uint32_t queueSize, modem::Modem* modem, network::BaseNetwork* network,
uint32_t timeout, uint32_t tgHang, bool duplex, ::lookups::RadioIdLookup* ridLookup,
::lookups::TalkgroupIdLookup* tidLookup, ::lookups::IdenTableLookup* idenTable, ::lookups::RSSIInterpolator* rssiMapper,
bool dumpPDUData, bool repeatPDU, bool dumpTSBKData, bool debug, bool verbose) :
m_voice(nullptr),
m_data(nullptr),
m_trunk(nullptr),
m_authoritative(authoritative),
m_nac(nac),
m_txNAC(nac),
m_timeout(timeout),

@ -72,7 +72,7 @@ namespace p25
class HOST_SW_API Control {
public:
/// <summary>Initializes a new instance of the Control class.</summary>
Control(uint32_t nac, uint32_t callHang, uint32_t queueSize, modem::Modem* modem, network::BaseNetwork* network,
Control(bool authoritative, uint32_t nac, uint32_t callHang, uint32_t queueSize, modem::Modem* modem, network::BaseNetwork* network,
uint32_t timeout, uint32_t tgHang, bool duplex, ::lookups::RadioIdLookup* ridLookup,
::lookups::TalkgroupIdLookup* tidLookup, ::lookups::IdenTableLookup* idenTable, ::lookups::RSSIInterpolator* rssiMapper,
bool dumpPDUData, bool repeatPDU, bool dumpTSBKData, bool debug, bool verbose);
@ -138,6 +138,8 @@ namespace p25
packet::Trunk* m_trunk;
friend class lookups::P25AffiliationLookup;
bool m_authoritative;
uint32_t m_nac;
uint32_t m_txNAC;
uint32_t m_timeout;

@ -943,20 +943,6 @@ void Trunk::writeAdjSSNetwork()
void Trunk::clock(uint32_t ms)
{
if (m_p25->m_control) {
if (m_p25->m_network != nullptr) {
if (m_p25->m_network->isHandlingChGrants() && m_p25->m_siteData.netActive()) {
bool grp = true;
uint32_t srcId = 0U;
uint32_t dstId = 0U;
uint32_t grpVchNo = 0U;
// do we have a grant response?
if (m_p25->m_network->readGrantRsp(grp, srcId, dstId, grpVchNo)) {
writeRF_TSDU_Grant(srcId, dstId, 4U, grp, true, grpVchNo, true, true);
}
}
}
// clock all the grant timers
m_p25->m_affiliations.clock(ms);
@ -2123,13 +2109,6 @@ bool Trunk::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_t serviceOp
return true; // do not generate grant packets for $FFFF (All Call) TGID
}
// do we have a network connection and are we handling grants at the network?
if (m_p25->m_network != nullptr) {
if (m_p25->m_network->isHandlingChGrants() && m_p25->m_siteData.netActive() && !skipNetCheck) {
return m_p25->m_network->writeGrantReq(grp, srcId, dstId);
}
}
// are we skipping checking?
if (!skip) {
if (m_p25->m_rfState != RS_RF_LISTENING && m_p25->m_rfState != RS_RF_DATA) {

Loading…
Cancel
Save

Powered by TurnKey Linux.