Initial removal of TG rewrite code.
This commit is contained in:
parent
a15636f98c
commit
a28508b8b1
32
Conf.cpp
32
Conf.cpp
|
@ -105,10 +105,6 @@ m_dmrBeacons(false),
|
||||||
m_dmrId(0U),
|
m_dmrId(0U),
|
||||||
m_dmrColorCode(2U),
|
m_dmrColorCode(2U),
|
||||||
m_dmrSelfOnly(false),
|
m_dmrSelfOnly(false),
|
||||||
m_dmrTGRewriteSlot1(false),
|
|
||||||
m_dmrTGRewriteSlot2(false),
|
|
||||||
m_dmrBMAutoRewrite(false),
|
|
||||||
m_dmrBMRewriteReflectorVoicePrompts(false),
|
|
||||||
m_dmrPrefixes(),
|
m_dmrPrefixes(),
|
||||||
m_dmrBlackList(),
|
m_dmrBlackList(),
|
||||||
m_dmrDstIdBlacklistSlot1RF(),
|
m_dmrDstIdBlacklistSlot1RF(),
|
||||||
|
@ -467,14 +463,6 @@ bool CConf::read()
|
||||||
m_dmrTXHang = (unsigned int)::atoi(value);
|
m_dmrTXHang = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "CallHang") == 0)
|
else if (::strcmp(key, "CallHang") == 0)
|
||||||
m_dmrCallHang = (unsigned int)::atoi(value);
|
m_dmrCallHang = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "TGRewriteSlot1") == 0)
|
|
||||||
m_dmrTGRewriteSlot1 = ::atoi(value) == 1;
|
|
||||||
else if (::strcmp(key, "TGRewriteSlot2") == 0)
|
|
||||||
m_dmrTGRewriteSlot2 = ::atoi(value) == 1;
|
|
||||||
else if (::strcmp(key, "BMAutoRewrite") == 0)
|
|
||||||
m_dmrBMAutoRewrite = ::atoi(value) == 1;
|
|
||||||
else if (::strcmp(key, "BMRewriteReflectorVoicePrompts") == 0)
|
|
||||||
m_dmrBMRewriteReflectorVoicePrompts = ::atoi(value) == 1;
|
|
||||||
} else if (section == SECTION_FUSION) {
|
} else if (section == SECTION_FUSION) {
|
||||||
if (::strcmp(key, "Enable") == 0)
|
if (::strcmp(key, "Enable") == 0)
|
||||||
m_fusionEnabled = ::atoi(value) == 1;
|
m_fusionEnabled = ::atoi(value) == 1;
|
||||||
|
@ -869,26 +857,6 @@ bool CConf::getDMRSelfOnly() const
|
||||||
return m_dmrSelfOnly;
|
return m_dmrSelfOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CConf::getDMRTGRewriteSlot1() const
|
|
||||||
{
|
|
||||||
return m_dmrTGRewriteSlot1;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CConf::getDMRTGRewriteSlot2() const
|
|
||||||
{
|
|
||||||
return m_dmrTGRewriteSlot2;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CConf::getDMRBMAutoRewrite() const
|
|
||||||
{
|
|
||||||
return m_dmrBMAutoRewrite;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CConf::getDMRBMRewriteReflectorVoicePrompts() const
|
|
||||||
{
|
|
||||||
return m_dmrBMRewriteReflectorVoicePrompts;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<unsigned int> CConf::getDMRPrefixes() const
|
std::vector<unsigned int> CConf::getDMRPrefixes() const
|
||||||
{
|
{
|
||||||
return m_dmrPrefixes;
|
return m_dmrPrefixes;
|
||||||
|
|
8
Conf.h
8
Conf.h
|
@ -98,10 +98,6 @@ public:
|
||||||
unsigned int getDMRId() const;
|
unsigned int getDMRId() const;
|
||||||
unsigned int getDMRColorCode() const;
|
unsigned int getDMRColorCode() const;
|
||||||
bool getDMRSelfOnly() const;
|
bool getDMRSelfOnly() const;
|
||||||
bool getDMRTGRewriteSlot1() const;
|
|
||||||
bool getDMRTGRewriteSlot2() const;
|
|
||||||
bool getDMRBMAutoRewrite() const;
|
|
||||||
bool getDMRBMRewriteReflectorVoicePrompts() 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;
|
||||||
std::vector<unsigned int> getDMRDstIdBlacklistSlot1RF() const;
|
std::vector<unsigned int> getDMRDstIdBlacklistSlot1RF() const;
|
||||||
|
@ -255,10 +251,6 @@ 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_dmrTGRewriteSlot1;
|
|
||||||
bool m_dmrTGRewriteSlot2;
|
|
||||||
bool m_dmrBMAutoRewrite;
|
|
||||||
bool m_dmrBMRewriteReflectorVoicePrompts;
|
|
||||||
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_dmrDstIdBlacklistSlot1RF;
|
std::vector<unsigned int> m_dmrDstIdBlacklistSlot1RF;
|
||||||
|
|
|
@ -39,19 +39,7 @@ bool CDMRAccessControl::m_selfOnly = false;
|
||||||
|
|
||||||
unsigned int CDMRAccessControl::m_id = 0U;
|
unsigned int CDMRAccessControl::m_id = 0U;
|
||||||
|
|
||||||
unsigned int CDMRAccessControl::m_dstRewriteID[2];
|
void CDMRAccessControl::init(const std::vector<unsigned int>& dstIdBlacklistSlot1RF, const std::vector<unsigned int>& dstIdWhitelistSlot1RF, const std::vector<unsigned int>& dstIdBlacklistSlot2RF, const std::vector<unsigned int>& dstIdWhitelistSlot2RF, const std::vector<unsigned int>& dstIdBlacklistSlot1NET, const std::vector<unsigned int>& dstIdWhitelistSlot1NET, const std::vector<unsigned int>& dstIdBlacklistSlot2NET, const std::vector<unsigned int>& dstIdWhitelistSlot2NET, const std::vector<unsigned int>& srcIdBlacklist, bool selfOnly, const std::vector<unsigned int>& prefixes, unsigned int id)
|
||||||
unsigned int CDMRAccessControl::m_srcID[2];
|
|
||||||
|
|
||||||
time_t CDMRAccessControl::m_time[2];
|
|
||||||
|
|
||||||
int CDMRAccessControl::m_callHang;
|
|
||||||
|
|
||||||
bool CDMRAccessControl::m_tgRewriteSlot1;
|
|
||||||
bool CDMRAccessControl::m_tgRewriteSlot2;
|
|
||||||
bool CDMRAccessControl::m_bmAutoRewrite;
|
|
||||||
bool CDMRAccessControl::m_bmRewriteReflectorVoicePrompts;
|
|
||||||
|
|
||||||
void CDMRAccessControl::init(const std::vector<unsigned int>& dstIdBlacklistSlot1RF, const std::vector<unsigned int>& dstIdWhitelistSlot1RF, const std::vector<unsigned int>& dstIdBlacklistSlot2RF, const std::vector<unsigned int>& dstIdWhitelistSlot2RF, const std::vector<unsigned int>& dstIdBlacklistSlot1NET, const std::vector<unsigned int>& dstIdWhitelistSlot1NET, const std::vector<unsigned int>& dstIdBlacklistSlot2NET, const std::vector<unsigned int>& dstIdWhitelistSlot2NET, const std::vector<unsigned int>& srcIdBlacklist, bool selfOnly, const std::vector<unsigned int>& prefixes, unsigned int id, unsigned int callHang, bool tgRewriteSlot1, bool tgRewriteSlot2, bool bmAutoRewrite, bool bmRewriteReflectorVoicePrompts)
|
|
||||||
{
|
{
|
||||||
m_dstBlackListSlot1RF = dstIdBlacklistSlot1RF;
|
m_dstBlackListSlot1RF = dstIdBlacklistSlot1RF;
|
||||||
m_dstWhiteListSlot1RF = dstIdWhitelistSlot1RF;
|
m_dstWhiteListSlot1RF = dstIdWhitelistSlot1RF;
|
||||||
|
@ -61,11 +49,6 @@ void CDMRAccessControl::init(const std::vector<unsigned int>& dstIdBlacklistSlot
|
||||||
m_dstWhiteListSlot1NET = dstIdWhitelistSlot1NET;
|
m_dstWhiteListSlot1NET = dstIdWhitelistSlot1NET;
|
||||||
m_dstBlackListSlot2NET = dstIdBlacklistSlot2NET;
|
m_dstBlackListSlot2NET = dstIdBlacklistSlot2NET;
|
||||||
m_dstWhiteListSlot2NET = dstIdWhitelistSlot2NET;
|
m_dstWhiteListSlot2NET = dstIdWhitelistSlot2NET;
|
||||||
m_callHang = callHang;
|
|
||||||
m_tgRewriteSlot1 = tgRewriteSlot1;
|
|
||||||
m_tgRewriteSlot2 = tgRewriteSlot2;
|
|
||||||
m_bmAutoRewrite = bmAutoRewrite;
|
|
||||||
m_bmRewriteReflectorVoicePrompts = bmRewriteReflectorVoicePrompts;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CDMRAccessControl::dstIdBlacklist(unsigned int did, unsigned int slot, bool network)
|
bool CDMRAccessControl::dstIdBlacklist(unsigned int did, unsigned int slot, bool network)
|
||||||
|
@ -199,68 +182,3 @@ bool CDMRAccessControl::validateAccess(unsigned int src_id, unsigned int dst_id,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int CDMRAccessControl::dstIdRewrite(unsigned int did, unsigned int sid, unsigned int slot, bool network, CDMRLC* dmrLC)
|
|
||||||
{
|
|
||||||
if (slot == 1U && !m_tgRewriteSlot1)
|
|
||||||
return 0U;
|
|
||||||
|
|
||||||
if (slot == 2U && !m_tgRewriteSlot2)
|
|
||||||
return 0U;
|
|
||||||
|
|
||||||
time_t currenttime = ::time(NULL);
|
|
||||||
|
|
||||||
if (network) {
|
|
||||||
m_dstRewriteID[slot - 1U] = did;
|
|
||||||
m_srcID[slot - 1U] = sid;
|
|
||||||
|
|
||||||
//deal with values of did we should never rewrite for
|
|
||||||
if(did == 0U || did == 9U) {
|
|
||||||
return 0U;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
if (m_bmAutoRewrite && (did < 4000U || did > 5000U) && dmrLC->getFLCO() == FLCO_GROUP) {
|
|
||||||
LogMessage("DMR Slot %u, Rewrite DST ID (TG) of of inbound network traffic from %u to 9", slot, did);
|
|
||||||
return 9U;
|
|
||||||
// Rewrite incoming BM voice prompts to TG 9
|
|
||||||
} else if (m_bmRewriteReflectorVoicePrompts && (sid >= 4000U && sid <= 5000U) && dmrLC->getFLCO() == FLCO_USER_USER) {
|
|
||||||
dmrLC->setFLCO(FLCO_GROUP);
|
|
||||||
LogMessage("DMR Slot %u, Rewrite inbound private call to %u to Group Call on TG 9 (BM reflector voice prompt)", slot, did);
|
|
||||||
return 9U;
|
|
||||||
} else {
|
|
||||||
return 0U;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
//deal with values of did we should never rewrite for
|
|
||||||
switch(did) {
|
|
||||||
case 0U :
|
|
||||||
return 0U;
|
|
||||||
break;
|
|
||||||
case 9990U :
|
|
||||||
LogMessage("DMR Slot %u, Outbound call to Echo on 9990 by %u", slot, sid);
|
|
||||||
return 0U;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_bmAutoRewrite && did == 9U && m_dstRewriteID[slot - 1U] != 9U && m_dstRewriteID[slot - 1U] != 0U && (m_time[slot - 1U] + m_callHang) > currenttime && dmrLC->getFLCO() == FLCO_GROUP) {
|
|
||||||
LogMessage("DMR Slot %u, Rewrite DST ID (TG) of outbound network traffic from %u to %u (return traffic during CallHang)", slot, did, m_dstRewriteID[slot - 1U]);
|
|
||||||
return m_dstRewriteID[slot - 1U];
|
|
||||||
} else if (m_bmAutoRewrite && (did < 4000U || did > 5000U) && did != 9U && did < 999999U && dmrLC->getFLCO() == FLCO_USER_USER) {
|
|
||||||
m_dstRewriteID[slot - 1U] = did;
|
|
||||||
dmrLC->setFLCO(FLCO_GROUP);
|
|
||||||
LogMessage("DMR Slot %u, Rewrite outbound private call to %u Group Call (Connect talkgroup by private call)", slot, did);
|
|
||||||
return did;
|
|
||||||
} else if (m_bmAutoRewrite && (did < 4000U || did > 5000U) && did != 9U && did > 999999U) {
|
|
||||||
m_dstRewriteID[slot - 1U] = did;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0U;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDMRAccessControl::setOverEndTime(unsigned int slot)
|
|
||||||
{
|
|
||||||
m_time[slot - 1U] = ::time(NULL);
|
|
||||||
}
|
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#define DMRAccessControl_H
|
#define DMRAccessControl_H
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <ctime>
|
|
||||||
|
|
||||||
#include "DMRLC.h"
|
#include "DMRLC.h"
|
||||||
|
|
||||||
|
@ -26,12 +25,8 @@ public:
|
||||||
|
|
||||||
static bool validateSrcId(unsigned int id);
|
static bool validateSrcId(unsigned int id);
|
||||||
|
|
||||||
static void init(const std::vector<unsigned int>& dstIdBlacklistSlot1RF, const std::vector<unsigned int>& dstIdWhitelistSlot1RF, const std::vector<unsigned int>& dstIdBlacklistSlot2RF, const std::vector<unsigned int>& dstIdWhitelistSlot2RF, const std::vector<unsigned int>& dstIdBlacklistSlot1NET, const std::vector<unsigned int>& dstIdWhitelistSlot1NET, const std::vector<unsigned int>& dstIdBlacklistSlot2NET, const std::vector<unsigned int>& dstIdWhitelistSlot2NET, const std::vector<unsigned int>& srcIdBlacklist, bool selfOnly, const std::vector<unsigned int>& prefixes,unsigned int id,unsigned int callHang, bool tgRewrteSlot1, bool tgRewrteSlot2, bool m_bmAutoRewrite, bool m_bmRewriteReflectorVoicePrompts);
|
static void init(const std::vector<unsigned int>& dstIdBlacklistSlot1RF, const std::vector<unsigned int>& dstIdWhitelistSlot1RF, const std::vector<unsigned int>& dstIdBlacklistSlot2RF, const std::vector<unsigned int>& dstIdWhitelistSlot2RF, const std::vector<unsigned int>& dstIdBlacklistSlot1NET, const std::vector<unsigned int>& dstIdWhitelistSlot1NET, const std::vector<unsigned int>& dstIdBlacklistSlot2NET, const std::vector<unsigned int>& dstIdWhitelistSlot2NET, const std::vector<unsigned int>& srcIdBlacklist, bool selfOnly, const std::vector<unsigned int>& prefixes, unsigned int id);
|
||||||
|
|
||||||
static unsigned int dstIdRewrite(unsigned int id, unsigned int sid, unsigned int slot, bool network, CDMRLC* dmrLC);
|
|
||||||
|
|
||||||
static void setOverEndTime(unsigned int slot);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::vector<unsigned int> m_dstBlackListSlot1RF;
|
static std::vector<unsigned int> m_dstBlackListSlot1RF;
|
||||||
static std::vector<unsigned int> m_dstBlackListSlot2RF;
|
static std::vector<unsigned int> m_dstBlackListSlot2RF;
|
||||||
|
@ -47,25 +42,11 @@ private:
|
||||||
|
|
||||||
static std::vector<unsigned int> m_prefixes;
|
static std::vector<unsigned int> m_prefixes;
|
||||||
|
|
||||||
static int m_callHang;
|
|
||||||
|
|
||||||
static bool m_selfOnly;
|
static bool m_selfOnly;
|
||||||
static unsigned int m_id;
|
static unsigned int m_id;
|
||||||
|
|
||||||
static bool dstIdBlacklist(unsigned int did, unsigned int slot, bool network);
|
static bool dstIdBlacklist(unsigned int did, unsigned int slot, bool network);
|
||||||
static bool dstIdWhitelist(unsigned int did, unsigned int slot, bool gt4k, bool network);
|
static bool dstIdWhitelist(unsigned int did, unsigned int slot, bool gt4k, bool network);
|
||||||
|
|
||||||
static time_t m_time[2];
|
|
||||||
|
|
||||||
static unsigned int m_dstRewriteID[2];
|
|
||||||
static unsigned int m_srcID[2];
|
|
||||||
|
|
||||||
static bool m_tgRewriteSlot1;
|
|
||||||
static bool m_tgRewriteSlot2;
|
|
||||||
static bool m_bmAutoRewrite;
|
|
||||||
static bool m_bmRewriteReflectorVoicePrompts;
|
|
||||||
|
|
||||||
static CDMRLC* m_lastdmrLC;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -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>& dstIdBlacklistSlot1RF, const std::vector<unsigned int>& dstIdWhitelistSlot1RF, const std::vector<unsigned int>& dstIdBlacklistSlot2RF, const std::vector<unsigned int>& dstIdWhitelistSlot2RF, const std::vector<unsigned int>& dstIdBlacklistSlot1NET, const std::vector<unsigned int>& dstIdWhitelistSlot1NET, const std::vector<unsigned int>& dstIdBlacklistSlot2NET, const std::vector<unsigned int>& dstIdWhitelistSlot2NET, unsigned int timeout, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, int rssiMultiplier, int rssiOffset, unsigned int jitter, bool tgRewriteSlot1, bool tgRewriteSlot2, bool bmAutoRewrite, bool bmRewriteReflectorVoicePrompts) :
|
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>& dstIdBlacklistSlot1RF, const std::vector<unsigned int>& dstIdWhitelistSlot1RF, const std::vector<unsigned int>& dstIdBlacklistSlot2RF, const std::vector<unsigned int>& dstIdWhitelistSlot2RF, const std::vector<unsigned int>& dstIdBlacklistSlot1NET, const std::vector<unsigned int>& dstIdWhitelistSlot1NET, const std::vector<unsigned int>& dstIdBlacklistSlot2NET, const std::vector<unsigned int>& dstIdWhitelistSlot2NET, unsigned int timeout, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, int rssiMultiplier, int rssiOffset, unsigned int jitter) :
|
||||||
m_id(id),
|
m_id(id),
|
||||||
m_colorCode(colorCode),
|
m_colorCode(colorCode),
|
||||||
m_modem(modem),
|
m_modem(modem),
|
||||||
|
@ -36,7 +36,7 @@ m_lookup(lookup)
|
||||||
assert(lookup != NULL);
|
assert(lookup != NULL);
|
||||||
|
|
||||||
// Load black and white lists to DMRAccessControl
|
// Load black and white lists to DMRAccessControl
|
||||||
CDMRAccessControl::init(dstIdBlacklistSlot1RF, dstIdWhitelistSlot1RF, dstIdBlacklistSlot2RF, dstIdWhitelistSlot2RF, dstIdBlacklistSlot1NET, dstIdWhitelistSlot1NET, dstIdBlacklistSlot2NET, dstIdWhitelistSlot2NET, blacklist, selfOnly, prefixes, id, callHang, tgRewriteSlot1, tgRewriteSlot2, bmAutoRewrite, bmRewriteReflectorVoicePrompts);
|
CDMRAccessControl::init(dstIdBlacklistSlot1RF, dstIdWhitelistSlot1RF, dstIdBlacklistSlot2RF, dstIdWhitelistSlot2RF, dstIdBlacklistSlot1NET, dstIdWhitelistSlot1NET, dstIdBlacklistSlot2NET, dstIdWhitelistSlot2NET, blacklist, selfOnly, prefixes, id);
|
||||||
|
|
||||||
CDMRSlot::init(colorCode, callHang, modem, network, display, duplex, m_lookup, rssiMultiplier, rssiOffset, jitter);
|
CDMRSlot::init(colorCode, callHang, modem, network, display, duplex, m_lookup, rssiMultiplier, rssiOffset, jitter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,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>& dstIdBlacklistSlot1RF, const std::vector<unsigned int>& dstIdWhitelistSlot1RF, const std::vector<unsigned int>& dstIdBlacklistSlot2RF, const std::vector<unsigned int>& dstIdWhitelistSlot2RF,const std::vector<unsigned int>& dstIdBlacklistSlot1NET, const std::vector<unsigned int>& dstIdWhitelistSlot1NET, const std::vector<unsigned int>& dstIdBlacklistSlot2NET, const std::vector<unsigned int>& dstIdWhitelistSlot2NET, unsigned int timeout, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, int rssiMultiplier, int rssiOffset, unsigned int jitter, bool tgRewriteSlot1, bool tgRewriteSlot2, bool bmAutoRewrite, bool bmRewriteReflectorVoicePrompts);
|
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>& dstIdBlacklistSlot1RF, const std::vector<unsigned int>& dstIdWhitelistSlot1RF, const std::vector<unsigned int>& dstIdBlacklistSlot2RF, const std::vector<unsigned int>& dstIdWhitelistSlot2RF,const std::vector<unsigned int>& dstIdBlacklistSlot1NET, const std::vector<unsigned int>& dstIdWhitelistSlot1NET, const std::vector<unsigned int>& dstIdBlacklistSlot2NET, const std::vector<unsigned int>& dstIdWhitelistSlot2NET, unsigned int timeout, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, int rssiMultiplier, int rssiOffset, unsigned int jitter);
|
||||||
~CDMRControl();
|
~CDMRControl();
|
||||||
|
|
||||||
bool processWakeup(const unsigned char* data);
|
bool processWakeup(const unsigned char* data);
|
||||||
|
|
35
DMRSlot.cpp
35
DMRSlot.cpp
|
@ -155,12 +155,6 @@ void CDMRSlot::writeModem(unsigned char *data, unsigned int len)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int rewriteId = CDMRAccessControl::dstIdRewrite(dstId, srcId, m_slotNo, false, lc);
|
|
||||||
if (rewriteId != 0U) {
|
|
||||||
lc->setDstId(rewriteId);
|
|
||||||
dstId = rewriteId;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_rfLC = lc;
|
m_rfLC = lc;
|
||||||
|
|
||||||
// Regenerate the LC data
|
// Regenerate the LC data
|
||||||
|
@ -255,7 +249,6 @@ void CDMRSlot::writeModem(unsigned char *data, unsigned int len)
|
||||||
LogMessage("DMR Slot %u, received RF end of voice transmission, %.1f seconds, BER: %.1f%%", m_slotNo, float(m_rfFrames) / 16.667F, float(m_rfErrs * 100U) / float(m_rfBits));
|
LogMessage("DMR Slot %u, received RF end of voice transmission, %.1f seconds, BER: %.1f%%", m_slotNo, float(m_rfFrames) / 16.667F, float(m_rfErrs * 100U) / float(m_rfBits));
|
||||||
|
|
||||||
writeEndRF();
|
writeEndRF();
|
||||||
CDMRAccessControl::setOverEndTime(m_slotNo);
|
|
||||||
} else if (dataType == DT_DATA_HEADER) {
|
} else if (dataType == DT_DATA_HEADER) {
|
||||||
if (m_rfState == RS_RF_DATA)
|
if (m_rfState == RS_RF_DATA)
|
||||||
return;
|
return;
|
||||||
|
@ -485,12 +478,6 @@ void CDMRSlot::writeModem(unsigned char *data, unsigned int len)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int rewriteId = CDMRAccessControl::dstIdRewrite(dstId, srcId, m_slotNo, false, lc);
|
|
||||||
if (rewriteId != 0U) {
|
|
||||||
lc->setDstId(rewriteId);
|
|
||||||
dstId = rewriteId;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_rfLC = lc;
|
m_rfLC = lc;
|
||||||
|
|
||||||
// Create a dummy start frame to replace the received frame
|
// Create a dummy start frame to replace the received frame
|
||||||
|
@ -767,13 +754,6 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
||||||
|
|
||||||
m_netLC = lc;
|
m_netLC = lc;
|
||||||
|
|
||||||
// Test dst rewrite
|
|
||||||
unsigned int rewriteId = CDMRAccessControl::dstIdRewrite(dstId, srcId, m_slotNo, true, m_netLC);
|
|
||||||
if (rewriteId != 0U) {
|
|
||||||
m_netLC->setDstId(rewriteId);
|
|
||||||
dstId = rewriteId;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Regenerate the LC data
|
// Regenerate the LC data
|
||||||
fullLC.encode(*m_netLC, data + 2U, DT_VOICE_LC_HEADER);
|
fullLC.encode(*m_netLC, data + 2U, DT_VOICE_LC_HEADER);
|
||||||
|
|
||||||
|
@ -839,13 +819,6 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
||||||
|
|
||||||
m_netLC = lc;
|
m_netLC = lc;
|
||||||
|
|
||||||
// Test dst rewrite
|
|
||||||
unsigned int rewriteId = CDMRAccessControl::dstIdRewrite(dstId, srcId, m_slotNo, true, m_netLC);
|
|
||||||
if (rewriteId != 0U) {
|
|
||||||
m_netLC->setDstId(rewriteId);
|
|
||||||
dstId = rewriteId;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_lastFrameValid = false;
|
m_lastFrameValid = false;
|
||||||
|
|
||||||
m_netTimeoutTimer.start();
|
m_netTimeoutTimer.start();
|
||||||
|
@ -958,7 +931,6 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
||||||
LogMessage("DMR Slot %u, received network end of voice transmission, %.1f seconds, %u%% packet loss, BER: %.1f%%", m_slotNo, float(m_netFrames) / 16.667F, (m_netLost * 100U) / m_netFrames, float(m_netErrs * 100U) / float(m_netBits));
|
LogMessage("DMR Slot %u, received network end of voice transmission, %.1f seconds, %u%% packet loss, BER: %.1f%%", m_slotNo, float(m_netFrames) / 16.667F, (m_netLost * 100U) / m_netFrames, float(m_netErrs * 100U) / float(m_netBits));
|
||||||
|
|
||||||
writeEndNet();
|
writeEndNet();
|
||||||
CDMRAccessControl::setOverEndTime(m_slotNo);
|
|
||||||
} else if (dataType == DT_DATA_HEADER) {
|
} else if (dataType == DT_DATA_HEADER) {
|
||||||
if (m_netState == RS_NET_DATA)
|
if (m_netState == RS_NET_DATA)
|
||||||
return;
|
return;
|
||||||
|
@ -1029,13 +1001,6 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
||||||
|
|
||||||
m_netLC = lc;
|
m_netLC = lc;
|
||||||
|
|
||||||
// Test dst rewrite
|
|
||||||
unsigned int rewriteId = CDMRAccessControl::dstIdRewrite(dstId, srcId, m_slotNo, true, m_netLC);
|
|
||||||
if (rewriteId != 0U) {
|
|
||||||
m_netLC->setDstId(rewriteId);
|
|
||||||
dstId = rewriteId;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_lastFrameValid = false;
|
m_lastFrameValid = false;
|
||||||
|
|
||||||
m_netTimeoutTimer.start();
|
m_netTimeoutTimer.start();
|
||||||
|
|
|
@ -82,10 +82,6 @@ TXHang=4
|
||||||
#DstIdBlackListSlot2NET=
|
#DstIdBlackListSlot2NET=
|
||||||
#DstIdWhiteListSlot1NET=
|
#DstIdWhiteListSlot1NET=
|
||||||
#DstIdWhiteListSlot2NET=
|
#DstIdWhiteListSlot2NET=
|
||||||
TGRewriteSlot1=0
|
|
||||||
TGRewriteSlot2=0
|
|
||||||
BMAutoRewrite=0
|
|
||||||
BMRewriteReflectorVoicePrompts=0
|
|
||||||
|
|
||||||
[System Fusion]
|
[System Fusion]
|
||||||
Enable=1
|
Enable=1
|
||||||
|
|
|
@ -334,10 +334,6 @@ 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 tgRewriteSlot1 = m_conf.getDMRTGRewriteSlot1();
|
|
||||||
bool tgRewriteSlot2 = m_conf.getDMRTGRewriteSlot2();
|
|
||||||
bool bmAutoRewrite = m_conf.getDMRBMAutoRewrite();
|
|
||||||
bool bmRewriteReflectorVoicePrompts = m_conf.getDMRBMRewriteReflectorVoicePrompts();
|
|
||||||
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> dstIDBlackListSlot1RF = m_conf.getDMRDstIdBlacklistSlot1RF();
|
std::vector<unsigned int> dstIDBlackListSlot1RF = m_conf.getDMRDstIdBlacklistSlot1RF();
|
||||||
|
@ -394,17 +390,8 @@ int CMMDVMHost::run()
|
||||||
LogInfo(" RSSI Multiplier: %d", rssiMultiplier);
|
LogInfo(" RSSI Multiplier: %d", rssiMultiplier);
|
||||||
LogInfo(" RSSI Offset: %d", rssiOffset);
|
LogInfo(" RSSI Offset: %d", rssiOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tgRewriteSlot1)
|
dmr = new CDMRControl(id, colorCode, callHang, selfOnly, prefixes, blackList, dstIDBlackListSlot1RF, dstIDWhiteListSlot1RF, dstIDBlackListSlot2RF, dstIDWhiteListSlot2RF, dstIDBlackListSlot1NET,dstIDWhiteListSlot1NET, dstIDBlackListSlot2NET, dstIDWhiteListSlot2NET, m_timeout, m_modem, m_dmrNetwork, m_display, m_duplex, m_lookup, rssiMultiplier, rssiOffset, jitter);
|
||||||
LogInfo(" TG Rewrite Slot 1 enabled");
|
|
||||||
if (tgRewriteSlot2)
|
|
||||||
LogInfo(" TG Rewrite Slot 2 enabled");
|
|
||||||
if (bmAutoRewrite)
|
|
||||||
LogInfo(" BrandMeister Auto Rewrite enabled");
|
|
||||||
if (bmRewriteReflectorVoicePrompts)
|
|
||||||
LogInfo(" BrandMeister Rewrite Reflector Voice Prompts enabled");
|
|
||||||
|
|
||||||
dmr = new CDMRControl(id, colorCode, callHang, selfOnly, prefixes, blackList, dstIDBlackListSlot1RF, dstIDWhiteListSlot1RF, dstIDBlackListSlot2RF, dstIDWhiteListSlot2RF, dstIDBlackListSlot1NET,dstIDWhiteListSlot1NET, dstIDBlackListSlot2NET, dstIDWhiteListSlot2NET, m_timeout, m_modem, m_dmrNetwork, m_display, m_duplex, m_lookup, rssiMultiplier, rssiOffset, jitter, tgRewriteSlot1, tgRewriteSlot2, bmAutoRewrite, bmRewriteReflectorVoicePrompts);
|
|
||||||
|
|
||||||
m_dmrTXTimer.setTimeout(txHang);
|
m_dmrTXTimer.setTimeout(txHang);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue