Next release of TG Rewrite

This commit is contained in:
Simon 2016-09-21 19:35:13 +01:00
parent 65bdc54997
commit e87eae94a1
7 changed files with 37 additions and 27 deletions

View file

@ -206,8 +206,7 @@ bool CConf::read()
section = SECTION_NEXTION;
else if (::strncmp(buffer, "[OLED]", 6U) == 0)
section = SECTION_OLED;
else if (::strncmp(buffer, "[DMR TG Rewrite]", 16U) == 0)
section = SECTION_TGREWRITE;
else
section = SECTION_NONE;
@ -423,6 +422,14 @@ bool CConf::read()
m_dmrTXHang = (unsigned int)::atoi(value);
else if (::strcmp(key, "CallHang") == 0)
m_dmrCallHang = (unsigned int)::atoi(value);
if (::strcmp(key, "TGRewriteSlot1") == 0)
m_TGRewriteSlot1 = ::atoi(value) == 1;
else if (::strcmp(key, "TGRewriteSlot2") == 0)
m_TGRewriteSlot2 = ::atoi(value) == 1;
else if (::strcmp(key, "BMAutoRewrite") == 0)
m_BMAutoRewrite = ::atoi(value) == 1;
else if (::strcmp(key, "BMRewriteReflectorVoicePrompts") == 0)
m_BMRewriteReflectorVoicePrompts = ::atoi(value) == 1;
} else if (section == SECTION_FUSION) {
if (::strcmp(key, "Enable") == 0)
m_fusionEnabled = ::atoi(value) == 1;
@ -521,15 +528,6 @@ bool CConf::read()
m_oledBrightness = (unsigned char)::atoi(value);
else if (::strcmp(key, "Brightness") == 0)
m_oledInvert = (unsigned char)::atoi(value);
} else if (section == SECTION_TGREWRITE) {
if (::strcmp(key, "TGRewriteSlot1") == 0)
m_TGRewriteSlot1 = ::atoi(value) == 1;
else if (::strcmp(key, "TGRewriteSlot2") == 0)
m_TGRewriteSlot2 = ::atoi(value) == 1;
else if (::strcmp(key, "BMAutoRewrite") == 0)
m_BMAutoRewrite = ::atoi(value) == 1;
else if (::strcmp(key, "BMRewriteReflectorVoicePrompts") == 0)
m_BMAutoRewrite = ::atoi(value) == 1;
}

View file

@ -67,7 +67,7 @@ void DMRAccessControl::init(const std::vector<unsigned int>& DstIdBlacklistSlot1
m_callHang = callHang;
m_TGRewriteSlot1 = TGRewriteSlot1;
m_TGRewriteSlot2 = TGRewriteSlot2;
m_BMAutoRewrite = BMAutoRewrite;
m_BMAutoRewrite = BMAutoRewrite;
m_BMRewriteReflectorVoicePrompts = BMRewriteReflectorVoicePrompts;
}
@ -211,6 +211,7 @@ unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid,
if (slot == 2 && m_TGRewriteSlot2 == false)
return 0;
std::time_t currenttime = std::time(nullptr);
@ -226,12 +227,6 @@ unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid,
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 9;
// commented because BM does not seem to pass Private Call to repeater ID. Will need to ask master devs.
// rewrite direct dial inbound
// } else if (did == 235135 && dmrLC->getFLCO() == FLCO_USER_USER) {
// dmrLC->setFLCO(FLCO_GROUP);
// LogMessage("DMR Slot %u, Rewrite inbound private call to repeater ID to Group Call on TG9 (direct dial)",slot,did);
// return(9);
} else {
return 0;
}
@ -240,10 +235,6 @@ unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid,
return(m_dstRewriteID);
} else if (m_BMAutoRewrite && (did < 4000 || did > 5000) && did > 0 && did !=9) {
m_dstRewriteID = did;
// commented because BM does not seem to pass Private Call to repeater ID. Will need to ask master devs.
/*} else if (m_dstRewriteID == 235135 && m_lastdmrLC->getFLCO() == FLCO_USER_USER) {
LogMessage("DMR Slot %u, Rewrite DST ID of outbound network group call on TG %u to private call %u (direct dial response)",slot,did,m_SrcID);
return(m_SrcID);*/
}
return 0;
}

View file

@ -64,6 +64,7 @@ private:
static bool m_BMRewriteReflectorVoicePrompts;
static CDMRLC* m_lastdmrLC;

View file

@ -255,8 +255,10 @@ void CDMRSlot::writeModem(unsigned char *data, unsigned int len)
writeNetworkRF(data, DT_TERMINATOR_WITH_LC);
if (m_duplex) {
for (unsigned int i = 0U; i < m_hangCount; i++)
writeQueueRF(data);
}
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));
@ -657,9 +659,11 @@ void CDMRSlot::writeEndRF(bool writeEnd)
data[0U] = TAG_EOT;
data[1U] = 0x00U;
for (unsigned int i = 0U; i < m_hangCount; i++)
writeQueueRF(data);
}
}
@ -732,8 +736,10 @@ void CDMRSlot::writeEndNet(bool writeEnd)
data[1U] = 0x00U;
if (m_duplex) {
for (unsigned int i = 0U; i < m_hangCount; i++)
writeQueueNet(data);
} else {
for (unsigned int i = 0U; i < 3U; i++)
writeQueueNet(data);
@ -902,8 +908,10 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
data[1U] = 0x00U;
if (m_duplex) {
for (unsigned int i = 0U; i < m_hangCount; i++)
writeQueueNet(data);
} else {
for (unsigned int i = 0U; i < 3U; i++)
writeQueueNet(data);

View file

@ -72,12 +72,12 @@ TXHang=4
#DstIdBlackListSlot2NET=
#DstIdWhiteListSlot1NET=
#DstIdWhiteListSlot2NET=
[DMR TG Rewrite]
TGRewriteSlot1=0
TGReWriteSlot2=0
TGRewriteSlot2=0
BMAutoRewrite=0
BMRewriteReflectorVoicePrompts=0
DirectDial=0
TargetTG=9
#RewriteMapSlot1=

View file

@ -364,6 +364,10 @@ int CMMDVMHost::run()
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, lookupFile, rssiMultiplier, rssiOffset, jitter, TGRewriteSlot1, TGRewriteSlot2, BMAutoRewrite, BMRewriteReflectorVoicePrompts);

View file

@ -30,11 +30,19 @@ groups, although it will function with permanent talk-groups too.
It is useful to set the CallHang parameter to a generous amount. I am currently
using seven seconds.
In addition to the above, there is also the capability ro rewrite voice prompts
on link/unlink so all users can hear them on TG9.
Two boolean configuration options control the TG Rewrite feature:
Configuration options are as follows:
TGRewriteSlot1=[0|1]
TGRewriteSlot2=[0|1]
BMAutoRewrite=[0|1]
BMRewriteReflectorVoicePrompts=[0|1]
Note at present, Auto rewrite is the only type of rewrite that is implemented so
to do something useful, this option must be set.
ACL's are applied before the rewrite, so still apply to rewritten traffic on
original (non-rewritten) talk-group.