Merged branch master into develop

This commit is contained in:
Tony Corbett G0WFV
2016-07-03 11:28:45 +01:00
3 changed files with 19 additions and 18 deletions

View File

@@ -801,13 +801,13 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
// - G7RZU // - G7RZU
unsigned int did = m_netLC->getDstId(); unsigned int did = m_netLC->getDstId();
if (DstIdBlacklist(did, m_slotNo)) { if (DstIdBlacklist(did, m_slotNo)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted)", m_slotNo, did);
return; return;
} }
// true sets allow greater than 4k. Need to add boolean in conf for this later. // true sets allow greater than 4k. Need to add boolean in conf for this later.
if (!DstIdWhitelist(did, m_slotNo, true)) { if (!DstIdWhitelist(did, m_slotNo, true)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist)", m_slotNo, did);
return; return;
} }
@@ -873,13 +873,13 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
// - G7RZU // - G7RZU
unsigned int did = m_netLC->getDstId(); unsigned int did = m_netLC->getDstId();
if (DstIdBlacklist(did, m_slotNo)) { if (DstIdBlacklist(did, m_slotNo)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted)", m_slotNo, did);
return; return;
} }
// true sets allow greater than 4k. Need to add boolean in conf for this later. // true sets allow greater than 4k. Need to add boolean in conf for this later.
if (!DstIdWhitelist(did, m_slotNo, true)) { if (!DstIdWhitelist(did, m_slotNo, true)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist)", m_slotNo, did);
return; return;
} }
@@ -914,14 +914,14 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
// - G7RZU // - G7RZU
unsigned int did = m_netLC->getDstId(); unsigned int did = m_netLC->getDstId();
if (DstIdBlacklist(did, m_slotNo)) { if (DstIdBlacklist(did, m_slotNo)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted)", m_slotNo, did);
writeEndNet(); writeEndNet();
return; return;
} }
// true sets allow greater than 4k. Need to add boolean in conf for this later. // true sets allow greater than 4k. Need to add boolean in conf for this later.
if (!DstIdWhitelist(did, m_slotNo, true)) { if (!DstIdWhitelist(did, m_slotNo, true)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist)", m_slotNo, did);
writeEndNet(); writeEndNet();
return; return;
} }
@@ -983,13 +983,13 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
// - G7RZU // - G7RZU
unsigned int did = dataHeader.getDstId(); unsigned int did = dataHeader.getDstId();
if (DstIdBlacklist(did, m_slotNo)) { if (DstIdBlacklist(did, m_slotNo)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted)", m_slotNo, did);
return; return;
} }
// true sets allow greater than 4k. Need to add boolean in conf for this later. // true sets allow greater than 4k. Need to add boolean in conf for this later.
if (!DstIdWhitelist(did, m_slotNo, true)) { if (!DstIdWhitelist(did, m_slotNo, true)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist)", m_slotNo, did);
return; return;
} }
@@ -1037,13 +1037,13 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
// - G7RZU // - G7RZU
unsigned int did = dmrData.getDstId(); unsigned int did = dmrData.getDstId();
if (DstIdBlacklist(did, m_slotNo)) { if (DstIdBlacklist(did, m_slotNo)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted)", m_slotNo, did);
return; return;
} }
// true sets allow greater than 4k. Need to add boolean in conf for this later. // true sets allow greater than 4k. Need to add boolean in conf for this later.
if (!DstIdWhitelist(did, m_slotNo, true)) { if (!DstIdWhitelist(did, m_slotNo, true)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist)", m_slotNo, did);
return; return;
} }
@@ -1144,13 +1144,13 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
// - G7RZU // - G7RZU
unsigned int did = m_netLC->getDstId(); unsigned int did = m_netLC->getDstId();
if (DstIdBlacklist(did, m_slotNo)) { if (DstIdBlacklist(did, m_slotNo)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted)", m_slotNo, did);
return; return;
} }
// true sets allow greater than 4k. Need to add boolean in conf for this later. // true sets allow greater than 4k. Need to add boolean in conf for this later.
if (!DstIdWhitelist(did, m_slotNo, true)) { if (!DstIdWhitelist(did, m_slotNo, true)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist)", m_slotNo, did);
return; return;
} }
@@ -1215,13 +1215,13 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
// - G7RZU // - G7RZU
unsigned int did = dstId; unsigned int did = dstId;
if (DstIdBlacklist(did, m_slotNo)) { if (DstIdBlacklist(did, m_slotNo)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG blacklisted)", m_slotNo, did);
return; return;
} }
// true sets allow greater than 4k. Need to add boolean in conf for this later. // true sets allow greater than 4k. Need to add boolean in conf for this later.
if (!DstIdWhitelist(did, m_slotNo, true)) { if (!DstIdWhitelist(did, m_slotNo, true)) {
LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist) dataType: %s", m_slotNo, did, dataType); LogMessage("DMR Slot %u, invalid traffic to TG%u (TG not in whitelist)", m_slotNo, did);
return; return;
} }
@@ -1516,11 +1516,12 @@ bool CDMRSlot::DstIdWhitelist(unsigned int did, unsigned int slot, bool gt4k)
return true; return true;
// No reflectors on slot1, so we only allow all IDs over 99999 unless specifically whitelisted. // No reflectors on slot1, so we only allow all IDs over 99999 unless specifically whitelisted.
//Allow traffic to TG0 as I think this is a special case - need to confirm
if (gt4k) { if (gt4k) {
if (std::find(m_dstWhiteListSlot1.begin(), m_dstWhiteListSlot1.end(), did) != m_dstWhiteListSlot1.end() || did >= 99999U) if (std::find(m_dstWhiteListSlot1.begin(), m_dstWhiteListSlot1.end(), did) != m_dstWhiteListSlot1.end() || did >= 99999U || did == 0)
return true; return true;
} else { } else {
if (std::find(m_dstWhiteListSlot1.begin(), m_dstWhiteListSlot1.end(), did) != m_dstWhiteListSlot1.end()) if (std::find(m_dstWhiteListSlot1.begin(), m_dstWhiteListSlot1.end(), did) != m_dstWhiteListSlot1.end() || did == 0)
return true; return true;
} }
} else { } else {

View File

@@ -753,7 +753,7 @@ void CHD44780::clockInt(unsigned int ms)
Time = localtime(&currentTime); Time = localtime(&currentTime);
} }
setlocale(LC_ALL,""); setlocale(LC_TIME,"");
strftime(m_buffer1, 128, "%X", Time); // Time strftime(m_buffer1, 128, "%X", Time); // Time
strftime(m_buffer2, 128, "%x", Time); // Date strftime(m_buffer2, 128, "%x", Time); // Date

View File

@@ -246,7 +246,7 @@ void CNextion::clockInt(unsigned int ms)
else else
Time = ::localtime(&currentTime); Time = ::localtime(&currentTime);
setlocale(LC_ALL,""); setlocale(LC_TIME,"");
char text[50U]; char text[50U];
strftime(text, 50, "t2.txt=\"%x %X\"", Time); strftime(text, 50, "t2.txt=\"%x %X\"", Time);
sendCommand(text); sendCommand(text);