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; section = SECTION_NEXTION;
else if (::strncmp(buffer, "[OLED]", 6U) == 0) else if (::strncmp(buffer, "[OLED]", 6U) == 0)
section = SECTION_OLED; section = SECTION_OLED;
else if (::strncmp(buffer, "[DMR TG Rewrite]", 16U) == 0)
section = SECTION_TGREWRITE;
else else
section = SECTION_NONE; section = SECTION_NONE;
@ -423,6 +422,14 @@ 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);
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) { } 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;
@ -521,15 +528,6 @@ bool CConf::read()
m_oledBrightness = (unsigned char)::atoi(value); m_oledBrightness = (unsigned char)::atoi(value);
else if (::strcmp(key, "Brightness") == 0) else if (::strcmp(key, "Brightness") == 0)
m_oledInvert = (unsigned char)::atoi(value); 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

@ -212,6 +212,7 @@ unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid,
if (slot == 2 && m_TGRewriteSlot2 == false) if (slot == 2 && m_TGRewriteSlot2 == false)
return 0; return 0;
std::time_t currenttime = std::time(nullptr); std::time_t currenttime = std::time(nullptr);
if (network) { if (network) {
@ -226,12 +227,6 @@ unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid,
dmrLC->setFLCO(FLCO_GROUP); 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); LogMessage("DMR Slot %u, Rewrite inbound private call to %u to Group Call on TG 9 (BM reflector voice prompt)",slot,did);
return 9; 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 { } else {
return 0; return 0;
} }
@ -240,10 +235,6 @@ unsigned int DMRAccessControl::DstIdRewrite (unsigned int did, unsigned int sid,
return(m_dstRewriteID); return(m_dstRewriteID);
} else if (m_BMAutoRewrite && (did < 4000 || did > 5000) && did > 0 && did !=9) { } else if (m_BMAutoRewrite && (did < 4000 || did > 5000) && did > 0 && did !=9) {
m_dstRewriteID = did; 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; return 0;
} }

View file

@ -67,6 +67,7 @@ private:
}; };
#endif #endif

View file

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

View file

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

View file

@ -364,6 +364,10 @@ int CMMDVMHost::run()
if (TGRewriteSlot2) if (TGRewriteSlot2)
LogInfo(" TG Rewrite Slot 2 enabled"); 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); 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 It is useful to set the CallHang parameter to a generous amount. I am currently
using seven seconds. 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] TGRewriteSlot1=[0|1]
TGRewriteSlot2=[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 ACL's are applied before the rewrite, so still apply to rewritten traffic on
original (non-rewritten) talk-group. original (non-rewritten) talk-group.