Compare commits

...

3 Commits

Author SHA1 Message Date
Carsten Schmiemann 7a551ddf04 Show whitelist on start 2022-07-29 23:08:25 +02:00
Carsten Schmiemann f8ad2e28ca Change prefix length 2022-07-29 22:37:10 +02:00
Carsten Schmiemann ca8571c276 Rename DMR access control 2022-07-29 22:33:32 +02:00
3 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,7 @@
{
"files.associations": {
"fstream": "cpp",
"cstring": "cpp"
"cstring": "cpp",
"string": "cpp"
}
}

View File

@ -61,7 +61,7 @@ bool CDMRAccessControl::validateSrcId(unsigned int id)
return false;
unsigned int prefix = id / 10000U;
if (prefix == 0U || prefix > 999U)
if (prefix == 0U || prefix > 9999U)
return false;
if (!m_prefixes.empty()) {

View File

@ -38,6 +38,11 @@ m_lookup(lookup)
// Load black and white lists to DMRAccessControl
CDMRAccessControl::init(blacklist, whitelist, slot1TGWhitelist, slot2TGWhitelist, selfOnly, prefixes, id);
//Print whitelisted IDs
LogMessage("Allowed radio ids: ");
for (unsigned int i: whitelist)
LogMessage((char*)i);
CDMRSlot::init(colorCode, embeddedLCOnly, dumpTAData, callHang, modem, network, display, duplex, m_lookup, rssi, jitter, ovcm);
}
@ -67,11 +72,11 @@ bool CDMRControl::processWakeup(const unsigned char* data)
bool ret = CDMRAccessControl::validateSrcId(srcId);
if (!ret) {
LogMessage("Invalid Downlink Activate received from %s", src.c_str());
LogMessage("Blocked downlink activation from %s", src.c_str());
return false;
}
LogMessage("Downlink Activate received from %s", src.c_str());
LogMessage("Downlink request received from %s", src.c_str());
return true;
}