mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 15:09:23 +08:00
use enum DMR_OVCM_TYPES
This commit is contained in:
19
Conf.cpp
19
Conf.cpp
@@ -146,7 +146,7 @@ m_dmrSlot2TGWhiteList(),
|
|||||||
m_dmrCallHang(10U),
|
m_dmrCallHang(10U),
|
||||||
m_dmrTXHang(4U),
|
m_dmrTXHang(4U),
|
||||||
m_dmrModeHang(10U),
|
m_dmrModeHang(10U),
|
||||||
m_dmrOVCM(0),
|
m_dmrOVCM(DMR_OVCM_OFF),
|
||||||
m_fusionEnabled(false),
|
m_fusionEnabled(false),
|
||||||
m_fusionLowDeviation(false),
|
m_fusionLowDeviation(false),
|
||||||
m_fusionRemoteGateway(false),
|
m_fusionRemoteGateway(false),
|
||||||
@@ -593,7 +593,20 @@ bool CConf::read()
|
|||||||
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)
|
else if (::strcmp(key, "OVCM") == 0)
|
||||||
m_dmrOVCM = ::atoi(value);
|
switch(::atoi(value)) {
|
||||||
|
case 1:
|
||||||
|
m_dmrOVCM = DMR_OVCM_RX_ON;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
m_dmrOVCM = DMR_OVCM_TX_ON;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
m_dmrOVCM = DMR_OVCM_ON;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
m_dmrOVCM = DMR_OVCM_OFF;
|
||||||
|
break;
|
||||||
|
}
|
||||||
} 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;
|
||||||
@@ -1255,7 +1268,7 @@ unsigned int CConf::getDMRModeHang() const
|
|||||||
return m_dmrModeHang;
|
return m_dmrModeHang;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CConf::getDMROVCM() const
|
DMR_OVCM_TYPES CConf::getDMROVCM() const
|
||||||
{
|
{
|
||||||
return m_dmrOVCM;
|
return m_dmrOVCM;
|
||||||
}
|
}
|
||||||
|
|||||||
4
Conf.h
4
Conf.h
@@ -135,7 +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;
|
||||||
int getDMROVCM() const;
|
DMR_OVCM_TYPES getDMROVCM() const;
|
||||||
|
|
||||||
// The System Fusion section
|
// The System Fusion section
|
||||||
bool getFusionEnabled() const;
|
bool getFusionEnabled() const;
|
||||||
@@ -374,7 +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;
|
||||||
int m_dmrOVCM;
|
DMR_OVCM_TYPES 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, int ovcm) :
|
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, DMR_OVCM_TYPES ovcm) :
|
||||||
m_colorCode(colorCode),
|
m_colorCode(colorCode),
|
||||||
m_modem(modem),
|
m_modem(modem),
|
||||||
m_network(network),
|
m_network(network),
|
||||||
|
|||||||
@@ -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, int ovcm);
|
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, DMR_OVCM_TYPES ovcm);
|
||||||
~CDMRControl();
|
~CDMRControl();
|
||||||
|
|
||||||
bool processWakeup(const unsigned char* data);
|
bool processWakeup(const unsigned char* data);
|
||||||
|
|||||||
18
DMRSlot.cpp
18
DMRSlot.cpp
@@ -43,7 +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;
|
||||||
int CDMRSlot::m_ovcm = 0;
|
DMR_OVCM_TYPES CDMRSlot::m_ovcm = DMR_OVCM_OFF;
|
||||||
|
|
||||||
CRSSIInterpolator* CDMRSlot::m_rssiMapper = NULL;
|
CRSSIInterpolator* CDMRSlot::m_rssiMapper = NULL;
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
lc->setOVCM(m_ovcm & 0x02);
|
lc->setOVCM(m_ovcm & DMR_OVCM_TX_ON);
|
||||||
m_rfLC = lc;
|
m_rfLC = lc;
|
||||||
|
|
||||||
// The standby LC data
|
// The standby LC data
|
||||||
@@ -438,7 +438,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// set the OVCM bit for the supported csbk
|
// set the OVCM bit for the supported csbk
|
||||||
csbk.setOVCM(m_ovcm & 0x02);
|
csbk.setOVCM(m_ovcm & DMR_OVCM_TX_ON);
|
||||||
|
|
||||||
bool gi = csbk.getGI();
|
bool gi = csbk.getGI();
|
||||||
unsigned int srcId = csbk.getSrcId();
|
unsigned int srcId = csbk.getSrcId();
|
||||||
@@ -789,7 +789,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
lc->setOVCM(m_ovcm & 0x02);
|
lc->setOVCM(m_ovcm & DMR_OVCM_TX_ON);
|
||||||
m_rfLC = lc;
|
m_rfLC = lc;
|
||||||
|
|
||||||
// The standby LC data
|
// The standby LC data
|
||||||
@@ -1045,7 +1045,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 & 0x01);
|
lc->setOVCM(m_ovcm & DMR_OVCM_RX_ON);
|
||||||
m_netLC = lc;
|
m_netLC = lc;
|
||||||
|
|
||||||
// The standby LC data
|
// The standby LC data
|
||||||
@@ -1119,7 +1119,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 & 0x01);
|
lc->setOVCM(m_ovcm & DMR_OVCM_RX_ON);
|
||||||
m_netLC = lc;
|
m_netLC = lc;
|
||||||
|
|
||||||
m_lastFrameValid = false;
|
m_lastFrameValid = false;
|
||||||
@@ -1305,7 +1305,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 & 0x01);
|
lc->setOVCM(m_ovcm & DMR_OVCM_RX_ON);
|
||||||
m_netLC = lc;
|
m_netLC = lc;
|
||||||
|
|
||||||
// The standby LC data
|
// The standby LC data
|
||||||
@@ -1575,7 +1575,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// set the OVCM bit for the supported csbk
|
// set the OVCM bit for the supported csbk
|
||||||
csbk.setOVCM(m_ovcm & 0x01);
|
csbk.setOVCM(m_ovcm & DMR_OVCM_RX_ON);
|
||||||
|
|
||||||
bool gi = csbk.getGI();
|
bool gi = csbk.getGI();
|
||||||
unsigned int srcId = csbk.getSrcId();
|
unsigned int srcId = csbk.getSrcId();
|
||||||
@@ -1881,7 +1881,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, int ovcm)
|
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, DMR_OVCM_TYPES ovcm)
|
||||||
{
|
{
|
||||||
assert(modem != NULL);
|
assert(modem != NULL);
|
||||||
assert(display != NULL);
|
assert(display != NULL);
|
||||||
|
|||||||
@@ -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, int ovcm);
|
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, DMR_OVCM_TYPES ovcm);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int m_slotNo;
|
unsigned int m_slotNo;
|
||||||
@@ -123,7 +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 int m_ovcm;
|
static DMR_OVCM_TYPES m_ovcm;
|
||||||
|
|
||||||
static CRSSIInterpolator* m_rssiMapper;
|
static CRSSIInterpolator* m_rssiMapper;
|
||||||
|
|
||||||
|
|||||||
@@ -70,4 +70,11 @@ enum DMR_BEACONS {
|
|||||||
DMR_BEACONS_TIMED
|
DMR_BEACONS_TIMED
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum DMR_OVCM_TYPES {
|
||||||
|
DMR_OVCM_OFF,
|
||||||
|
DMR_OVCM_RX_ON,
|
||||||
|
DMR_OVCM_TX_ON,
|
||||||
|
DMR_OVCM_ON
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ DumpTAData=1
|
|||||||
CallHang=3
|
CallHang=3
|
||||||
TXHang=4
|
TXHang=4
|
||||||
# ModeHang=10
|
# ModeHang=10
|
||||||
# OVCM Values, 0=off, 1=net_on, 2=rf_on, 3=both_on
|
# OVCM Values, 0=off, 1=rx_on, 2=tx_on, 3=both_on
|
||||||
# OVCM=0
|
# OVCM=0
|
||||||
|
|
||||||
[System Fusion]
|
[System Fusion]
|
||||||
|
|||||||
@@ -445,7 +445,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();
|
||||||
dmrBeacons = m_conf.getDMRBeacons();
|
dmrBeacons = m_conf.getDMRBeacons();
|
||||||
int ovcm = m_conf.getDMROVCM();
|
DMR_OVCM_TYPES ovcm = m_conf.getDMROVCM();
|
||||||
|
|
||||||
if (txHang > m_dmrRFModeHang)
|
if (txHang > m_dmrRFModeHang)
|
||||||
txHang = m_dmrRFModeHang;
|
txHang = m_dmrRFModeHang;
|
||||||
@@ -478,13 +478,16 @@ 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);
|
||||||
if (ovcm == 0)
|
if (ovcm == DMR_OVCM_OFF)
|
||||||
LogInfo(" OVCM: off");
|
LogInfo(" OVCM: off");
|
||||||
else if (ovcm == 1)
|
else if (ovcm == DMR_OVCM_RX_ON)
|
||||||
LogInfo(" OVCM: on(rx)");
|
LogInfo(" OVCM: on(rx only)");
|
||||||
else
|
else if (ovcm == DMR_OVCM_TX_ON)
|
||||||
|
LogInfo(" OVCM: on(tx only)");
|
||||||
|
else if (ovcm == DMR_OVCM_ON)
|
||||||
LogInfo(" OVCM: on");
|
LogInfo(" OVCM: on");
|
||||||
|
|
||||||
|
|
||||||
switch (dmrBeacons) {
|
switch (dmrBeacons) {
|
||||||
case DMR_BEACONS_NETWORK: {
|
case DMR_BEACONS_NETWORK: {
|
||||||
unsigned int dmrBeaconDuration = m_conf.getDMRBeaconDuration();
|
unsigned int dmrBeaconDuration = m_conf.getDMRBeaconDuration();
|
||||||
|
|||||||
Reference in New Issue
Block a user