mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 23:45:49 +08:00
Add OVCM support.
This commit is contained in:
8
Conf.cpp
8
Conf.cpp
@@ -146,6 +146,7 @@ m_dmrSlot2TGWhiteList(),
|
|||||||
m_dmrCallHang(10U),
|
m_dmrCallHang(10U),
|
||||||
m_dmrTXHang(4U),
|
m_dmrTXHang(4U),
|
||||||
m_dmrModeHang(10U),
|
m_dmrModeHang(10U),
|
||||||
|
m_dmrOVCM(true),
|
||||||
m_fusionEnabled(false),
|
m_fusionEnabled(false),
|
||||||
m_fusionLowDeviation(false),
|
m_fusionLowDeviation(false),
|
||||||
m_fusionRemoteGateway(false),
|
m_fusionRemoteGateway(false),
|
||||||
@@ -590,6 +591,8 @@ bool CConf::read()
|
|||||||
m_dmrCallHang = (unsigned int)::atoi(value);
|
m_dmrCallHang = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "ModeHang") == 0)
|
else if (::strcmp(key, "ModeHang") == 0)
|
||||||
m_dmrModeHang = (unsigned int)::atoi(value);
|
m_dmrModeHang = (unsigned int)::atoi(value);
|
||||||
|
else if (::strcmp(key, "OVCM") == 0)
|
||||||
|
m_dmrOVCM = ::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;
|
||||||
@@ -1251,6 +1254,11 @@ unsigned int CConf::getDMRModeHang() const
|
|||||||
return m_dmrModeHang;
|
return m_dmrModeHang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CConf::getDMROVCM() const
|
||||||
|
{
|
||||||
|
return m_dmrOVCM;
|
||||||
|
}
|
||||||
|
|
||||||
bool CConf::getFusionEnabled() const
|
bool CConf::getFusionEnabled() const
|
||||||
{
|
{
|
||||||
return m_fusionEnabled;
|
return m_fusionEnabled;
|
||||||
|
|||||||
2
Conf.h
2
Conf.h
@@ -135,6 +135,7 @@ public:
|
|||||||
unsigned int getDMRCallHang() const;
|
unsigned int getDMRCallHang() const;
|
||||||
unsigned int getDMRTXHang() const;
|
unsigned int getDMRTXHang() const;
|
||||||
unsigned int getDMRModeHang() const;
|
unsigned int getDMRModeHang() const;
|
||||||
|
bool getDMROVCM() const;
|
||||||
|
|
||||||
// The System Fusion section
|
// The System Fusion section
|
||||||
bool getFusionEnabled() const;
|
bool getFusionEnabled() const;
|
||||||
@@ -373,6 +374,7 @@ private:
|
|||||||
unsigned int m_dmrCallHang;
|
unsigned int m_dmrCallHang;
|
||||||
unsigned int m_dmrTXHang;
|
unsigned int m_dmrTXHang;
|
||||||
unsigned int m_dmrModeHang;
|
unsigned int m_dmrModeHang;
|
||||||
|
bool m_dmrOVCM;
|
||||||
|
|
||||||
bool m_fusionEnabled;
|
bool m_fusionEnabled;
|
||||||
bool m_fusionLowDeviation;
|
bool m_fusionLowDeviation;
|
||||||
|
|||||||
@@ -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, bool embeddedLCOnly, bool dumpTAData, 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, bool dumpTAData, 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, bool ovcm) :
|
||||||
m_colorCode(colorCode),
|
m_colorCode(colorCode),
|
||||||
m_modem(modem),
|
m_modem(modem),
|
||||||
m_network(network),
|
m_network(network),
|
||||||
@@ -38,7 +38,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, embeddedLCOnly, dumpTAData, callHang, modem, network, display, duplex, m_lookup, rssi, jitter);
|
CDMRSlot::init(colorCode, embeddedLCOnly, dumpTAData, callHang, modem, network, display, duplex, m_lookup, rssi, jitter, ovcm);
|
||||||
}
|
}
|
||||||
|
|
||||||
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, bool embeddedLCOnly, bool dumpTAData, 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, bool dumpTAData, 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, bool ovcm);
|
||||||
~CDMRControl();
|
~CDMRControl();
|
||||||
|
|
||||||
bool processWakeup(const unsigned char* data);
|
bool processWakeup(const unsigned char* data);
|
||||||
|
|||||||
15
DMRLC.cpp
15
DMRLC.cpp
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
|
* Copyright (C) 2015,2016,2019 by Jonathan Naylor G4KLX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -184,6 +184,19 @@ void CDMRLC::setFID(unsigned char fid)
|
|||||||
m_FID = fid;
|
m_FID = fid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CDMRLC::getOVCM() const
|
||||||
|
{
|
||||||
|
return (m_options & 0x20U) == 0x20U;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDMRLC::setOVCM(bool ovcm)
|
||||||
|
{
|
||||||
|
if (ovcm)
|
||||||
|
m_options |= 0x20U;
|
||||||
|
else
|
||||||
|
m_options &= 0xDFU;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int CDMRLC::getSrcId() const
|
unsigned int CDMRLC::getSrcId() const
|
||||||
{
|
{
|
||||||
return m_srcId;
|
return m_srcId;
|
||||||
|
|||||||
5
DMRLC.h
5
DMRLC.h
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
|
* Copyright (C) 2015,2016,2019 by Jonathan Naylor G4KLX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -39,6 +39,9 @@ public:
|
|||||||
FLCO getFLCO() const;
|
FLCO getFLCO() const;
|
||||||
void setFLCO(FLCO flco);
|
void setFLCO(FLCO flco);
|
||||||
|
|
||||||
|
bool getOVCM() const;
|
||||||
|
void setOVCM(bool ovcm);
|
||||||
|
|
||||||
unsigned char getFID() const;
|
unsigned char getFID() const;
|
||||||
void setFID(unsigned char fid);
|
void setFID(unsigned char fid);
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ CDisplay* CDMRSlot::m_display = NULL;
|
|||||||
bool CDMRSlot::m_duplex = true;
|
bool CDMRSlot::m_duplex = true;
|
||||||
CDMRLookup* CDMRSlot::m_lookup = NULL;
|
CDMRLookup* CDMRSlot::m_lookup = NULL;
|
||||||
unsigned int CDMRSlot::m_hangCount = 3U * 17U;
|
unsigned int CDMRSlot::m_hangCount = 3U * 17U;
|
||||||
|
bool CDMRSlot::m_ovcm = true;
|
||||||
|
|
||||||
CRSSIInterpolator* CDMRSlot::m_rssiMapper = NULL;
|
CRSSIInterpolator* CDMRSlot::m_rssiMapper = NULL;
|
||||||
|
|
||||||
@@ -232,6 +233,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lc->setOVCM(m_ovcm);
|
||||||
m_rfLC = lc;
|
m_rfLC = lc;
|
||||||
|
|
||||||
// The standby LC data
|
// The standby LC data
|
||||||
@@ -784,6 +786,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lc->setOVCM(m_ovcm);
|
||||||
m_rfLC = lc;
|
m_rfLC = lc;
|
||||||
|
|
||||||
// The standby LC data
|
// The standby LC data
|
||||||
@@ -1039,6 +1042,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
|||||||
dmrData.getSrcId(), dmrData.getFLCO() == FLCO_GROUP ? "TG" : "", dmrData.getDstId(),
|
dmrData.getSrcId(), dmrData.getFLCO() == FLCO_GROUP ? "TG" : "", dmrData.getDstId(),
|
||||||
srcId, flco == FLCO_GROUP ? "TG" : "", dstId);
|
srcId, flco == FLCO_GROUP ? "TG" : "", dstId);
|
||||||
|
|
||||||
|
lc->setOVCM(m_ovcm);
|
||||||
m_netLC = lc;
|
m_netLC = lc;
|
||||||
|
|
||||||
// The standby LC data
|
// The standby LC data
|
||||||
@@ -1112,6 +1116,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
|||||||
unsigned int dstId = lc->getDstId();
|
unsigned int dstId = lc->getDstId();
|
||||||
unsigned int srcId = lc->getSrcId();
|
unsigned int srcId = lc->getSrcId();
|
||||||
|
|
||||||
|
lc->setOVCM(m_ovcm);
|
||||||
m_netLC = lc;
|
m_netLC = lc;
|
||||||
|
|
||||||
m_lastFrameValid = false;
|
m_lastFrameValid = false;
|
||||||
@@ -1297,6 +1302,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
|||||||
unsigned int dstId = lc->getDstId();
|
unsigned int dstId = lc->getDstId();
|
||||||
unsigned int srcId = lc->getSrcId();
|
unsigned int srcId = lc->getSrcId();
|
||||||
|
|
||||||
|
lc->setOVCM(m_ovcm);
|
||||||
m_netLC = lc;
|
m_netLC = lc;
|
||||||
|
|
||||||
// The standby LC data
|
// The standby LC data
|
||||||
@@ -1869,7 +1875,7 @@ void CDMRSlot::writeQueueNet(const unsigned char *data)
|
|||||||
m_queue.addData(data, len);
|
m_queue.addData(data, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDMRSlot::init(unsigned int colorCode, bool embeddedLCOnly, bool dumpTAData, 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, bool dumpTAData, unsigned int callHang, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssiMapper, unsigned int jitter, bool ovcm)
|
||||||
{
|
{
|
||||||
assert(modem != NULL);
|
assert(modem != NULL);
|
||||||
assert(display != NULL);
|
assert(display != NULL);
|
||||||
@@ -1885,6 +1891,7 @@ void CDMRSlot::init(unsigned int colorCode, bool embeddedLCOnly, bool dumpTAData
|
|||||||
m_duplex = duplex;
|
m_duplex = duplex;
|
||||||
m_lookup = lookup;
|
m_lookup = lookup;
|
||||||
m_hangCount = callHang * 17U;
|
m_hangCount = callHang * 17U;
|
||||||
|
m_ovcm = ovcm;
|
||||||
|
|
||||||
m_rssiMapper = rssiMapper;
|
m_rssiMapper = rssiMapper;
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
|
|
||||||
void enable(bool enabled);
|
void enable(bool enabled);
|
||||||
|
|
||||||
static void init(unsigned int colorCode, bool embeddedLCOnly, bool dumpTAData, 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, bool dumpTAData, unsigned int callHang, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssiMapper, unsigned int jitter, bool ovcm);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int m_slotNo;
|
unsigned int m_slotNo;
|
||||||
@@ -123,6 +123,7 @@ private:
|
|||||||
static bool m_duplex;
|
static bool m_duplex;
|
||||||
static CDMRLookup* m_lookup;
|
static CDMRLookup* m_lookup;
|
||||||
static unsigned int m_hangCount;
|
static unsigned int m_hangCount;
|
||||||
|
static bool m_ovcm;
|
||||||
|
|
||||||
static CRSSIInterpolator* m_rssiMapper;
|
static CRSSIInterpolator* m_rssiMapper;
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ DumpTAData=1
|
|||||||
CallHang=3
|
CallHang=3
|
||||||
TXHang=4
|
TXHang=4
|
||||||
# ModeHang=10
|
# ModeHang=10
|
||||||
|
OVCM=1
|
||||||
|
|
||||||
[System Fusion]
|
[System Fusion]
|
||||||
Enable=1
|
Enable=1
|
||||||
|
|||||||
@@ -444,6 +444,7 @@ int CMMDVMHost::run()
|
|||||||
unsigned int jitter = m_conf.getDMRNetworkJitter();
|
unsigned int jitter = m_conf.getDMRNetworkJitter();
|
||||||
m_dmrRFModeHang = m_conf.getDMRModeHang();
|
m_dmrRFModeHang = m_conf.getDMRModeHang();
|
||||||
bool dmrBeacons = m_conf.getDMRBeacons();
|
bool dmrBeacons = m_conf.getDMRBeacons();
|
||||||
|
bool ovcm = m_conf.getDMROVCM();
|
||||||
|
|
||||||
if (txHang > m_dmrRFModeHang)
|
if (txHang > m_dmrRFModeHang)
|
||||||
txHang = m_dmrRFModeHang;
|
txHang = m_dmrRFModeHang;
|
||||||
@@ -476,6 +477,7 @@ int CMMDVMHost::run()
|
|||||||
LogInfo(" Call Hang: %us", callHang);
|
LogInfo(" Call Hang: %us", callHang);
|
||||||
LogInfo(" TX Hang: %us", txHang);
|
LogInfo(" TX Hang: %us", txHang);
|
||||||
LogInfo(" Mode Hang: %us", m_dmrRFModeHang);
|
LogInfo(" Mode Hang: %us", m_dmrRFModeHang);
|
||||||
|
LogInfo(" OVCM: %s", ovcm ? "on" : "off");
|
||||||
|
|
||||||
if (dmrBeacons) {
|
if (dmrBeacons) {
|
||||||
unsigned int dmrBeaconInterval = m_conf.getDMRBeaconInterval();
|
unsigned int dmrBeaconInterval = m_conf.getDMRBeaconInterval();
|
||||||
@@ -490,7 +492,7 @@ int CMMDVMHost::run()
|
|||||||
dmrBeaconIntervalTimer.start();
|
dmrBeaconIntervalTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_dmr = new CDMRControl(id, colorCode, callHang, selfOnly, embeddedLCOnly, dumpTAData, prefixes, blackList, whiteList, slot1TGWhiteList, slot2TGWhiteList, m_timeout, m_modem, m_dmrNetwork, m_display, m_duplex, m_dmrLookup, rssi, jitter);
|
m_dmr = new CDMRControl(id, colorCode, callHang, selfOnly, embeddedLCOnly, dumpTAData, prefixes, blackList, whiteList, slot1TGWhiteList, slot2TGWhiteList, m_timeout, m_modem, m_dmrNetwork, m_display, m_duplex, m_dmrLookup, rssi, jitter, ovcm);
|
||||||
|
|
||||||
m_dmrTXTimer.setTimeout(txHang);
|
m_dmrTXTimer.setTimeout(txHang);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user