mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 06:55:52 +08:00
Optional non Embedded LC data suppression
This commit is contained in:
8
Conf.cpp
8
Conf.cpp
@@ -104,6 +104,7 @@ m_dmrBeacons(false),
|
|||||||
m_dmrId(0U),
|
m_dmrId(0U),
|
||||||
m_dmrColorCode(2U),
|
m_dmrColorCode(2U),
|
||||||
m_dmrSelfOnly(false),
|
m_dmrSelfOnly(false),
|
||||||
|
m_dmrEmbeddedLCOnly(false),
|
||||||
m_dmrPrefixes(),
|
m_dmrPrefixes(),
|
||||||
m_dmrBlackList(),
|
m_dmrBlackList(),
|
||||||
m_dmrWhiteList(),
|
m_dmrWhiteList(),
|
||||||
@@ -370,6 +371,8 @@ bool CConf::read()
|
|||||||
m_dmrColorCode = (unsigned int)::atoi(value);
|
m_dmrColorCode = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "SelfOnly") == 0)
|
else if (::strcmp(key, "SelfOnly") == 0)
|
||||||
m_dmrSelfOnly = ::atoi(value) == 1;
|
m_dmrSelfOnly = ::atoi(value) == 1;
|
||||||
|
else if (::strcmp(key, "EmbeddedLCOnly") == 0)
|
||||||
|
m_dmrEmbeddedLCOnly = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "Prefixes") == 0) {
|
else if (::strcmp(key, "Prefixes") == 0) {
|
||||||
char* p = ::strtok(value, ",\r\n");
|
char* p = ::strtok(value, ",\r\n");
|
||||||
while (p != NULL) {
|
while (p != NULL) {
|
||||||
@@ -801,6 +804,11 @@ bool CConf::getDMRSelfOnly() const
|
|||||||
return m_dmrSelfOnly;
|
return m_dmrSelfOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CConf::getDMREmbeddedLCOnly() const
|
||||||
|
{
|
||||||
|
return m_dmrEmbeddedLCOnly;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<unsigned int> CConf::getDMRPrefixes() const
|
std::vector<unsigned int> CConf::getDMRPrefixes() const
|
||||||
{
|
{
|
||||||
return m_dmrPrefixes;
|
return m_dmrPrefixes;
|
||||||
|
|||||||
2
Conf.h
2
Conf.h
@@ -96,6 +96,7 @@ public:
|
|||||||
bool getDMRBeacons() const;
|
bool getDMRBeacons() const;
|
||||||
unsigned int getDMRId() const;
|
unsigned int getDMRId() const;
|
||||||
unsigned int getDMRColorCode() const;
|
unsigned int getDMRColorCode() const;
|
||||||
|
bool getDMREmbeddedLCOnly() const;
|
||||||
bool getDMRSelfOnly() const;
|
bool getDMRSelfOnly() const;
|
||||||
std::vector<unsigned int> getDMRPrefixes() const;
|
std::vector<unsigned int> getDMRPrefixes() const;
|
||||||
std::vector<unsigned int> getDMRBlackList() const;
|
std::vector<unsigned int> getDMRBlackList() const;
|
||||||
@@ -243,6 +244,7 @@ private:
|
|||||||
unsigned int m_dmrId;
|
unsigned int m_dmrId;
|
||||||
unsigned int m_dmrColorCode;
|
unsigned int m_dmrColorCode;
|
||||||
bool m_dmrSelfOnly;
|
bool m_dmrSelfOnly;
|
||||||
|
bool m_dmrEmbeddedLCOnly;
|
||||||
std::vector<unsigned int> m_dmrPrefixes;
|
std::vector<unsigned int> m_dmrPrefixes;
|
||||||
std::vector<unsigned int> m_dmrBlackList;
|
std::vector<unsigned int> m_dmrBlackList;
|
||||||
std::vector<unsigned int> m_dmrWhiteList;
|
std::vector<unsigned int> m_dmrWhiteList;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
CDMRControl::CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& blacklist, const std::vector<unsigned int>& whitelist, const std::vector<unsigned int>& slot1TGWhitelist, const std::vector<unsigned int>& slot2TGWhitelist, unsigned int timeout, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssi, unsigned int jitter) :
|
CDMRControl::CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, bool embeddedLCOnly, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& blacklist, const std::vector<unsigned int>& whitelist, const std::vector<unsigned int>& slot1TGWhitelist, const std::vector<unsigned int>& slot2TGWhitelist, unsigned int timeout, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssi, unsigned int jitter) :
|
||||||
m_id(id),
|
m_id(id),
|
||||||
m_colorCode(colorCode),
|
m_colorCode(colorCode),
|
||||||
m_modem(modem),
|
m_modem(modem),
|
||||||
@@ -39,7 +39,7 @@ m_lookup(lookup)
|
|||||||
// Load black and white lists to DMRAccessControl
|
// Load black and white lists to DMRAccessControl
|
||||||
CDMRAccessControl::init(blacklist, whitelist, slot1TGWhitelist, slot2TGWhitelist, selfOnly, prefixes, id);
|
CDMRAccessControl::init(blacklist, whitelist, slot1TGWhitelist, slot2TGWhitelist, selfOnly, prefixes, id);
|
||||||
|
|
||||||
CDMRSlot::init(colorCode, callHang, modem, network, display, duplex, m_lookup, rssi, jitter);
|
CDMRSlot::init(colorCode, embeddedLCOnly, callHang, modem, network, display, duplex, m_lookup, rssi, jitter);
|
||||||
}
|
}
|
||||||
|
|
||||||
CDMRControl::~CDMRControl()
|
CDMRControl::~CDMRControl()
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
class CDMRControl {
|
class CDMRControl {
|
||||||
public:
|
public:
|
||||||
CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& blacklist, const std::vector<unsigned int>& whitelist, const std::vector<unsigned int>& slot1TGWhitelist, const std::vector<unsigned int>& slot2TGWhitelist, unsigned int timeout, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssi, unsigned int jitter);
|
CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, bool embeddedLCOnly, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& blacklist, const std::vector<unsigned int>& whitelist, const std::vector<unsigned int>& slot1TGWhitelist, const std::vector<unsigned int>& slot2TGWhitelist, unsigned int timeout, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssi, unsigned int jitter);
|
||||||
~CDMRControl();
|
~CDMRControl();
|
||||||
|
|
||||||
bool processWakeup(const unsigned char* data);
|
bool processWakeup(const unsigned char* data);
|
||||||
|
|||||||
52
DMRSlot.cpp
52
DMRSlot.cpp
@@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
unsigned int CDMRSlot::m_colorCode = 0U;
|
unsigned int CDMRSlot::m_colorCode = 0U;
|
||||||
|
|
||||||
|
bool CDMRSlot::m_embeddedLCOnly = false;
|
||||||
|
|
||||||
CModem* CDMRSlot::m_modem = NULL;
|
CModem* CDMRSlot::m_modem = NULL;
|
||||||
CDMRNetwork* CDMRSlot::m_network = NULL;
|
CDMRNetwork* CDMRSlot::m_network = NULL;
|
||||||
CDisplay* CDMRSlot::m_display = NULL;
|
CDisplay* CDMRSlot::m_display = NULL;
|
||||||
@@ -584,10 +586,20 @@ void CDMRSlot::writeModem(unsigned char *data, unsigned int len)
|
|||||||
data[0U] = TAG_DATA;
|
data[0U] = TAG_DATA;
|
||||||
data[1U] = 0x00U;
|
data[1U] = 0x00U;
|
||||||
|
|
||||||
|
writeNetworkRF(data, DT_VOICE, errors);
|
||||||
|
|
||||||
|
if (m_embeddedLCOnly) {
|
||||||
|
// Only send the previously received LC
|
||||||
|
lcss = m_rfEmbeddedLC.getData(data + 2U, m_rfN);
|
||||||
|
|
||||||
|
// Regenerate the EMB
|
||||||
|
emb.setColorCode(m_colorCode);
|
||||||
|
emb.setLCSS(lcss);
|
||||||
|
emb.getData(data + 2U);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_duplex)
|
if (m_duplex)
|
||||||
writeQueueRF(data);
|
writeQueueRF(data);
|
||||||
|
|
||||||
writeNetworkRF(data, DT_VOICE, errors);
|
|
||||||
} else if (m_rfState == RS_RF_LATE_ENTRY) {
|
} else if (m_rfState == RS_RF_LATE_ENTRY) {
|
||||||
CDMREMB emb;
|
CDMREMB emb;
|
||||||
emb.putData(data + 2U);
|
emb.putData(data + 2U);
|
||||||
@@ -1297,11 +1309,16 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regenerate the previous super blocks Embedded Data or substitude the LC for it
|
if (m_embeddedLCOnly) {
|
||||||
if (m_netEmbeddedData[m_netEmbeddedReadN].isValid())
|
// Only send the previously received LC
|
||||||
lcss = m_netEmbeddedData[m_netEmbeddedReadN].getData(data + 2U, dmrData.getN());
|
|
||||||
else
|
|
||||||
lcss = m_netEmbeddedLC.getData(data + 2U, dmrData.getN());
|
lcss = m_netEmbeddedLC.getData(data + 2U, dmrData.getN());
|
||||||
|
} else {
|
||||||
|
// Regenerate the previous super blocks Embedded Data or substitude the LC for it
|
||||||
|
if (m_netEmbeddedData[m_netEmbeddedReadN].isValid())
|
||||||
|
lcss = m_netEmbeddedData[m_netEmbeddedReadN].getData(data + 2U, dmrData.getN());
|
||||||
|
else
|
||||||
|
lcss = m_netEmbeddedLC.getData(data + 2U, dmrData.getN());
|
||||||
|
}
|
||||||
|
|
||||||
// Regenerate the EMB
|
// Regenerate the EMB
|
||||||
emb.setColorCode(m_colorCode);
|
emb.setColorCode(m_colorCode);
|
||||||
@@ -1571,25 +1588,26 @@ void CDMRSlot::writeQueueNet(const unsigned char *data)
|
|||||||
m_queue.addData(data, len);
|
m_queue.addData(data, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDMRSlot::init(unsigned int colorCode, unsigned int callHang, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssiMapper, unsigned int jitter)
|
void CDMRSlot::init(unsigned int colorCode, bool embeddedLCOnly, unsigned int callHang, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssiMapper, unsigned int jitter)
|
||||||
{
|
{
|
||||||
assert(modem != NULL);
|
assert(modem != NULL);
|
||||||
assert(display != NULL);
|
assert(display != NULL);
|
||||||
assert(lookup != NULL);
|
assert(lookup != NULL);
|
||||||
assert(rssiMapper != NULL);
|
assert(rssiMapper != NULL);
|
||||||
|
|
||||||
m_colorCode = colorCode;
|
m_colorCode = colorCode;
|
||||||
m_modem = modem;
|
m_embeddedLCOnly = embeddedLCOnly;
|
||||||
m_network = network;
|
m_modem = modem;
|
||||||
m_display = display;
|
m_network = network;
|
||||||
m_duplex = duplex;
|
m_display = display;
|
||||||
m_lookup = lookup;
|
m_duplex = duplex;
|
||||||
m_hangCount = callHang * 17U;
|
m_lookup = lookup;
|
||||||
|
m_hangCount = callHang * 17U;
|
||||||
|
|
||||||
m_rssiMapper = rssiMapper;
|
m_rssiMapper = rssiMapper;
|
||||||
|
|
||||||
m_jitterTime = jitter;
|
m_jitterTime = jitter;
|
||||||
m_jitterSlots = jitter / DMR_SLOT_TIME;
|
m_jitterSlots = jitter / DMR_SLOT_TIME;
|
||||||
|
|
||||||
m_idle = new unsigned char[DMR_FRAME_LENGTH_BYTES + 2U];
|
m_idle = new unsigned char[DMR_FRAME_LENGTH_BYTES + 2U];
|
||||||
::memcpy(m_idle, DMR_IDLE_DATA, DMR_FRAME_LENGTH_BYTES + 2U);
|
::memcpy(m_idle, DMR_IDLE_DATA, DMR_FRAME_LENGTH_BYTES + 2U);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
|
|
||||||
void clock();
|
void clock();
|
||||||
|
|
||||||
static void init(unsigned int colorCode, unsigned int callHang, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssiMapper, unsigned int jitter);
|
static void init(unsigned int colorCode, bool embeddedLCOnly, unsigned int callHang, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssiMapper, unsigned int jitter);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int m_slotNo;
|
unsigned int m_slotNo;
|
||||||
@@ -98,6 +98,8 @@ private:
|
|||||||
|
|
||||||
static unsigned int m_colorCode;
|
static unsigned int m_colorCode;
|
||||||
|
|
||||||
|
static bool m_embeddedLCOnly;
|
||||||
|
|
||||||
static CModem* m_modem;
|
static CModem* m_modem;
|
||||||
static CDMRNetwork* m_network;
|
static CDMRNetwork* m_network;
|
||||||
static CDisplay* m_display;
|
static CDisplay* m_display;
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ Beacons=1
|
|||||||
Id=123456
|
Id=123456
|
||||||
ColorCode=1
|
ColorCode=1
|
||||||
SelfOnly=0
|
SelfOnly=0
|
||||||
|
EmbeddedLCOnly=0
|
||||||
# Prefixes=234,235
|
# Prefixes=234,235
|
||||||
# Slot1TGWhiteList=
|
# Slot1TGWhiteList=
|
||||||
# Slot2TGWhiteList=
|
# Slot2TGWhiteList=
|
||||||
|
|||||||
@@ -345,6 +345,7 @@ int CMMDVMHost::run()
|
|||||||
unsigned int id = m_conf.getDMRId();
|
unsigned int id = m_conf.getDMRId();
|
||||||
unsigned int colorCode = m_conf.getDMRColorCode();
|
unsigned int colorCode = m_conf.getDMRColorCode();
|
||||||
bool selfOnly = m_conf.getDMRSelfOnly();
|
bool selfOnly = m_conf.getDMRSelfOnly();
|
||||||
|
bool embeddedLCOnly = m_conf.getDMREmbeddedLCOnly();
|
||||||
std::vector<unsigned int> prefixes = m_conf.getDMRPrefixes();
|
std::vector<unsigned int> prefixes = m_conf.getDMRPrefixes();
|
||||||
std::vector<unsigned int> blackList = m_conf.getDMRBlackList();
|
std::vector<unsigned int> blackList = m_conf.getDMRBlackList();
|
||||||
std::vector<unsigned int> whiteList = m_conf.getDMRWhiteList();
|
std::vector<unsigned int> whiteList = m_conf.getDMRWhiteList();
|
||||||
@@ -366,6 +367,7 @@ int CMMDVMHost::run()
|
|||||||
LogInfo(" Id: %u", id);
|
LogInfo(" Id: %u", id);
|
||||||
LogInfo(" Color Code: %u", colorCode);
|
LogInfo(" Color Code: %u", colorCode);
|
||||||
LogInfo(" Self Only: %s", selfOnly ? "yes" : "no");
|
LogInfo(" Self Only: %s", selfOnly ? "yes" : "no");
|
||||||
|
LogInfo(" Embedded LC Only: %s", embeddedLCOnly ? "yes" : "no");
|
||||||
LogInfo(" Prefixes: %u", prefixes.size());
|
LogInfo(" Prefixes: %u", prefixes.size());
|
||||||
|
|
||||||
if (blackList.size() > 0U)
|
if (blackList.size() > 0U)
|
||||||
@@ -380,7 +382,7 @@ int CMMDVMHost::run()
|
|||||||
LogInfo(" Call Hang: %us", callHang);
|
LogInfo(" Call Hang: %us", callHang);
|
||||||
LogInfo(" TX Hang: %us", txHang);
|
LogInfo(" TX Hang: %us", txHang);
|
||||||
|
|
||||||
dmr = new CDMRControl(id, colorCode, callHang, selfOnly, prefixes, blackList, whiteList, slot1TGWhiteList, slot2TGWhiteList, m_timeout, m_modem, m_dmrNetwork, m_display, m_duplex, m_lookup, rssi, jitter);
|
dmr = new CDMRControl(id, colorCode, callHang, selfOnly, embeddedLCOnly, prefixes, blackList, whiteList, slot1TGWhiteList, slot2TGWhiteList, m_timeout, m_modem, m_dmrNetwork, m_display, m_duplex, m_lookup, rssi, jitter);
|
||||||
|
|
||||||
m_dmrTXTimer.setTimeout(txHang);
|
m_dmrTXTimer.setTimeout(txHang);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user