Add RSSI reporting for DMR only.
This commit is contained in:
parent
a60c4bf6f9
commit
059b960959
24
Conf.cpp
24
Conf.cpp
|
@ -79,6 +79,8 @@ m_modemDMRDelay(0U),
|
|||
m_modemRXLevel(100U),
|
||||
m_modemTXLevel(100U),
|
||||
m_modemOscOffset(0),
|
||||
m_modemRSSIMultiplier(0),
|
||||
m_modemRSSIOffset(0),
|
||||
m_modemDebug(false),
|
||||
m_dstarEnabled(true),
|
||||
m_dstarModule("C"),
|
||||
|
@ -116,6 +118,7 @@ m_dmrNetworkPassword(),
|
|||
m_dmrNetworkDebug(false),
|
||||
m_dmrNetworkSlot1(true),
|
||||
m_dmrNetworkSlot2(true),
|
||||
m_dmrNetworkRSSI(false),
|
||||
m_fusionNetworkEnabled(false),
|
||||
m_fusionNetworkMyAddress(),
|
||||
m_fusionNetworkMyPort(0U),
|
||||
|
@ -278,6 +281,10 @@ bool CConf::read()
|
|||
m_modemTXLevel = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "OscOffset") == 0)
|
||||
m_modemOscOffset = ::atoi(value);
|
||||
else if (::strcmp(key, "RSSIMultiplier") == 0)
|
||||
m_modemRSSIMultiplier = ::atoi(value);
|
||||
else if (::strcmp(key, "RSSIOffset") == 0)
|
||||
m_modemRSSIOffset = ::atoi(value);
|
||||
else if (::strcmp(key, "Debug") == 0)
|
||||
m_modemDebug = ::atoi(value) == 1;
|
||||
} else if (section == SECTION_DSTAR) {
|
||||
|
@ -431,6 +438,8 @@ bool CConf::read()
|
|||
m_dmrNetworkSlot1 = ::atoi(value) == 1;
|
||||
else if (::strcmp(key, "Slot2") == 0)
|
||||
m_dmrNetworkSlot2 = ::atoi(value) == 1;
|
||||
else if (::strcmp(key, "RSSI") == 0)
|
||||
m_dmrNetworkRSSI = ::atoi(value) == 1;
|
||||
} else if (section == SECTION_FUSION_NETWORK) {
|
||||
if (::strcmp(key, "Enable") == 0)
|
||||
m_fusionNetworkEnabled = ::atoi(value) == 1;
|
||||
|
@ -658,6 +667,16 @@ int CConf::getModemOscOffset() const
|
|||
return m_modemOscOffset;
|
||||
}
|
||||
|
||||
int CConf::getModemRSSIMultiplier () const
|
||||
{
|
||||
return m_modemRSSIMultiplier;
|
||||
}
|
||||
|
||||
int CConf::getModemRSSIOffset() const
|
||||
{
|
||||
return m_modemRSSIOffset;
|
||||
}
|
||||
|
||||
bool CConf::getModemDebug() const
|
||||
{
|
||||
return m_modemDebug;
|
||||
|
@ -832,6 +851,11 @@ bool CConf::getDMRNetworkSlot2() const
|
|||
return m_dmrNetworkSlot2;
|
||||
}
|
||||
|
||||
bool CConf::getDMRNetworkRSSI() const
|
||||
{
|
||||
return m_dmrNetworkRSSI;
|
||||
}
|
||||
|
||||
bool CConf::getFusionNetworkEnabled() const
|
||||
{
|
||||
return m_fusionNetworkEnabled;
|
||||
|
|
6
Conf.h
6
Conf.h
|
@ -70,6 +70,8 @@ public:
|
|||
unsigned int getModemRXLevel() const;
|
||||
unsigned int getModemTXLevel() const;
|
||||
int getModemOscOffset() const;
|
||||
int getModemRSSIMultiplier() const;
|
||||
int getModemRSSIOffset() const;
|
||||
bool getModemDebug() const;
|
||||
|
||||
// The D-Star section
|
||||
|
@ -117,6 +119,7 @@ public:
|
|||
bool getDMRNetworkDebug() const;
|
||||
bool getDMRNetworkSlot1() const;
|
||||
bool getDMRNetworkSlot2() const;
|
||||
bool getDMRNetworkRSSI() const;
|
||||
|
||||
// The System Fusion Network section
|
||||
bool getFusionNetworkEnabled() const;
|
||||
|
@ -191,6 +194,8 @@ private:
|
|||
unsigned int m_modemRXLevel;
|
||||
unsigned int m_modemTXLevel;
|
||||
int m_modemOscOffset;
|
||||
int m_modemRSSIMultiplier;
|
||||
int m_modemRSSIOffset;
|
||||
bool m_modemDebug;
|
||||
|
||||
bool m_dstarEnabled;
|
||||
|
@ -233,6 +238,7 @@ private:
|
|||
bool m_dmrNetworkDebug;
|
||||
bool m_dmrNetworkSlot1;
|
||||
bool m_dmrNetworkSlot2;
|
||||
bool m_dmrNetworkRSSI;
|
||||
|
||||
bool m_fusionNetworkEnabled;
|
||||
std::string m_fusionNetworkMyAddress;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <cassert>
|
||||
#include <algorithm>
|
||||
|
||||
CDMRControl::CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& blackList, const std::vector<unsigned int>& DstIdBlacklistSlot1RF, const std::vector<unsigned int>& DstIdWhitelistSlot1RF, const std::vector<unsigned int>& DstIdBlacklistSlot2RF, const std::vector<unsigned int>& DstIdWhitelistSlot2RF, const std::vector<unsigned int>& DstIdBlacklistSlot1NET, const std::vector<unsigned int>& DstIdWhitelistSlot1NET, const std::vector<unsigned int>& DstIdBlacklistSlot2NET, const std::vector<unsigned int>& DstIdWhitelistSlot2NET, unsigned int timeout, CModem* modem, CDMRIPSC* network, CDisplay* display, bool duplex, const std::string& lookupFile) :
|
||||
CDMRControl::CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& blackList, const std::vector<unsigned int>& DstIdBlacklistSlot1RF, const std::vector<unsigned int>& DstIdWhitelistSlot1RF, const std::vector<unsigned int>& DstIdBlacklistSlot2RF, const std::vector<unsigned int>& DstIdWhitelistSlot2RF, const std::vector<unsigned int>& DstIdBlacklistSlot1NET, const std::vector<unsigned int>& DstIdWhitelistSlot1NET, const std::vector<unsigned int>& DstIdBlacklistSlot2NET, const std::vector<unsigned int>& DstIdWhitelistSlot2NET, unsigned int timeout, CModem* modem, CDMRIPSC* network, CDisplay* display, bool duplex, const std::string& lookupFile, int rssiMultiplier, int rssiOffset) :
|
||||
m_id(id),
|
||||
m_colorCode(colorCode),
|
||||
m_selfOnly(selfOnly),
|
||||
|
@ -38,7 +38,7 @@ m_lookup(NULL)
|
|||
m_lookup = new CDMRLookup(lookupFile);
|
||||
m_lookup->read();
|
||||
|
||||
CDMRSlot::init(id, colorCode, callHang, selfOnly, prefixes, blackList, DstIdBlacklistSlot1RF, DstIdWhitelistSlot1RF, DstIdBlacklistSlot2RF, DstIdWhitelistSlot2RF, DstIdBlacklistSlot1NET, DstIdWhitelistSlot1NET, DstIdBlacklistSlot2NET, DstIdWhitelistSlot2NET, modem, network, display, duplex, m_lookup);
|
||||
CDMRSlot::init(id, colorCode, callHang, selfOnly, prefixes, blackList, DstIdBlacklistSlot1RF, DstIdWhitelistSlot1RF, DstIdBlacklistSlot2RF, DstIdWhitelistSlot2RF, DstIdBlacklistSlot1NET, DstIdWhitelistSlot1NET, DstIdBlacklistSlot2NET, DstIdWhitelistSlot2NET, modem, network, display, duplex, m_lookup, rssiMultiplier, rssiOffset);
|
||||
}
|
||||
|
||||
CDMRControl::~CDMRControl()
|
||||
|
@ -103,18 +103,18 @@ bool CDMRControl::processWakeup(const unsigned char* data)
|
|||
return false;
|
||||
}
|
||||
|
||||
void CDMRControl::writeModemSlot1(unsigned char *data)
|
||||
void CDMRControl::writeModemSlot1(unsigned char *data, unsigned int len)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
m_slot1.writeModem(data);
|
||||
m_slot1.writeModem(data, len);
|
||||
}
|
||||
|
||||
void CDMRControl::writeModemSlot2(unsigned char *data)
|
||||
void CDMRControl::writeModemSlot2(unsigned char *data, unsigned int len)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
m_slot2.writeModem(data);
|
||||
m_slot2.writeModem(data, len);
|
||||
}
|
||||
|
||||
unsigned int CDMRControl::readModemSlot1(unsigned char *data)
|
||||
|
|
|
@ -30,13 +30,13 @@
|
|||
|
||||
class CDMRControl {
|
||||
public:
|
||||
CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& blackList, const std::vector<unsigned int>& DstIdBlacklistSlot1RF, const std::vector<unsigned int>& DstIdWhitelistSlot1RF, const std::vector<unsigned int>& DstIdBlacklistSlot2RF, const std::vector<unsigned int>& DstIdWhitelistSlot2RF,const std::vector<unsigned int>& DstIdBlacklistSlot1NET, const std::vector<unsigned int>& DstIdWhitelistSlot1NET, const std::vector<unsigned int>& DstIdBlacklistSlot2NET, const std::vector<unsigned int>& DstIdWhitelistSlot2NET, unsigned int timeout, CModem* modem, CDMRIPSC* network, CDisplay* display, bool duplex, const std::string& lookupFile);
|
||||
CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& blackList, const std::vector<unsigned int>& DstIdBlacklistSlot1RF, const std::vector<unsigned int>& DstIdWhitelistSlot1RF, const std::vector<unsigned int>& DstIdBlacklistSlot2RF, const std::vector<unsigned int>& DstIdWhitelistSlot2RF,const std::vector<unsigned int>& DstIdBlacklistSlot1NET, const std::vector<unsigned int>& DstIdWhitelistSlot1NET, const std::vector<unsigned int>& DstIdBlacklistSlot2NET, const std::vector<unsigned int>& DstIdWhitelistSlot2NET, unsigned int timeout, CModem* modem, CDMRIPSC* network, CDisplay* display, bool duplex, const std::string& lookupFile, int rssiMultiplier, int rssiOffset);
|
||||
~CDMRControl();
|
||||
|
||||
bool processWakeup(const unsigned char* data);
|
||||
|
||||
void writeModemSlot1(unsigned char* data);
|
||||
void writeModemSlot2(unsigned char* data);
|
||||
void writeModemSlot1(unsigned char* data, unsigned int len);
|
||||
void writeModemSlot2(unsigned char* data, unsigned int len);
|
||||
|
||||
unsigned int readModemSlot1(unsigned char* data);
|
||||
unsigned int readModemSlot2(unsigned char* data);
|
||||
|
|
|
@ -47,7 +47,7 @@ m_dataType(0U),
|
|||
m_seqNo(0U),
|
||||
m_n(0U),
|
||||
m_ber(0U),
|
||||
m_rssi(0U)
|
||||
m_rssi(0)
|
||||
{
|
||||
m_data = new unsigned char[2U * DMR_FRAME_LENGTH_BYTES];
|
||||
}
|
||||
|
@ -158,12 +158,12 @@ void CDMRData::setBER(unsigned char ber)
|
|||
m_ber = ber;
|
||||
}
|
||||
|
||||
unsigned char CDMRData::getRSSI() const
|
||||
signed char CDMRData::getRSSI() const
|
||||
{
|
||||
return m_rssi;
|
||||
}
|
||||
|
||||
void CDMRData::setRSSI(unsigned char rssi)
|
||||
void CDMRData::setRSSI(signed char rssi)
|
||||
{
|
||||
m_rssi = rssi;
|
||||
}
|
||||
|
|
|
@ -48,8 +48,8 @@ public:
|
|||
unsigned char getBER() const;
|
||||
void setBER(unsigned char ber);
|
||||
|
||||
unsigned char getRSSI() const;
|
||||
void setRSSI(unsigned char ber);
|
||||
signed char getRSSI() const;
|
||||
void setRSSI(signed char ber);
|
||||
|
||||
void setData(const unsigned char* buffer);
|
||||
unsigned int getData(unsigned char* buffer) const;
|
||||
|
@ -64,7 +64,7 @@ private:
|
|||
unsigned char m_seqNo;
|
||||
unsigned char m_n;
|
||||
unsigned char m_ber;
|
||||
unsigned char m_rssi;
|
||||
signed char m_rssi;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -31,7 +31,7 @@ const unsigned int BUFFER_LENGTH = 500U;
|
|||
const unsigned int HOMEBREW_DATA_PACKET_LENGTH = 55U;
|
||||
|
||||
|
||||
CDMRIPSC::CDMRIPSC(const std::string& address, unsigned int port, unsigned int local, unsigned int id, const std::string& password, bool duplex, const char* version, bool debug, bool slot1, bool slot2) :
|
||||
CDMRIPSC::CDMRIPSC(const std::string& address, unsigned int port, unsigned int local, unsigned int id, const std::string& password, bool duplex, const char* version, bool debug, bool slot1, bool slot2, bool rssi) :
|
||||
m_address(),
|
||||
m_port(port),
|
||||
m_id(NULL),
|
||||
|
@ -43,6 +43,7 @@ m_socket(local),
|
|||
m_enabled(false),
|
||||
m_slot1(slot1),
|
||||
m_slot2(slot2),
|
||||
m_rssi(rssi),
|
||||
m_status(WAITING_CONNECT),
|
||||
m_retryTimer(1000U, 10U),
|
||||
m_timeoutTimer(1000U, 60U),
|
||||
|
@ -264,7 +265,10 @@ bool CDMRIPSC::write(const CDMRData& data)
|
|||
|
||||
buffer[53U] = data.getBER();
|
||||
|
||||
buffer[54U] = data.getRSSI();
|
||||
if (m_rssi)
|
||||
buffer[54U] = data.getRSSI();
|
||||
else
|
||||
buffer[54U] = 0x00U;
|
||||
|
||||
if (m_debug)
|
||||
CUtils::dump(1U, "IPSC Transmitted", buffer, HOMEBREW_DATA_PACKET_LENGTH);
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
class CDMRIPSC
|
||||
{
|
||||
public:
|
||||
CDMRIPSC(const std::string& address, unsigned int port, unsigned int local, unsigned int id, const std::string& password, bool duplex, const char* version, bool debug, bool slot1, bool slot2);
|
||||
CDMRIPSC(const std::string& address, unsigned int port, unsigned int local, unsigned int id, const std::string& password, bool duplex, const char* version, bool debug, bool slot1, bool slot2, bool rssi);
|
||||
~CDMRIPSC();
|
||||
|
||||
void setConfig(const std::string& callsign, unsigned int rxFrequency, unsigned int txFrequency, unsigned int power, unsigned int colorCode, float latitude, float longitude, int height, const std::string& location, const std::string& description, const std::string& url);
|
||||
|
@ -61,6 +61,7 @@ private:
|
|||
bool m_enabled;
|
||||
bool m_slot1;
|
||||
bool m_slot2;
|
||||
bool m_rssi;
|
||||
|
||||
enum STATUS {
|
||||
WAITING_CONNECT,
|
||||
|
|
23
DMRSlot.cpp
23
DMRSlot.cpp
|
@ -41,6 +41,9 @@ bool CDMRSlot::m_duplex = true;
|
|||
CDMRLookup* CDMRSlot::m_lookup = NULL;
|
||||
unsigned int CDMRSlot::m_hangCount = 3U * 17U;
|
||||
|
||||
int CDMRSlot::m_rssiMultiplier = 0;
|
||||
int CDMRSlot::m_rssiOffset = 0;
|
||||
|
||||
unsigned char* CDMRSlot::m_idle = NULL;
|
||||
|
||||
FLCO CDMRSlot::m_flco1;
|
||||
|
@ -84,6 +87,7 @@ m_netErrs(0U),
|
|||
m_lastFrame(NULL),
|
||||
m_lastFrameValid(false),
|
||||
m_lastEMB(),
|
||||
m_rssi(0),
|
||||
m_fp(NULL)
|
||||
{
|
||||
m_lastFrame = new unsigned char[DMR_FRAME_LENGTH_BYTES + 2U];
|
||||
|
@ -96,7 +100,7 @@ CDMRSlot::~CDMRSlot()
|
|||
delete[] m_lastFrame;
|
||||
}
|
||||
|
||||
void CDMRSlot::writeModem(unsigned char *data)
|
||||
void CDMRSlot::writeModem(unsigned char *data, unsigned int len)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
|
@ -117,6 +121,15 @@ void CDMRSlot::writeModem(unsigned char *data)
|
|||
return;
|
||||
}
|
||||
|
||||
// Have we got RSSI bytes on the end?
|
||||
if (len > (DMR_FRAME_LENGTH_BYTES + 2U) && m_rssiMultiplier != 0) {
|
||||
uint16_t rssi = 0U;
|
||||
rssi |= (data[33U] << 8) & 0xFF00U;
|
||||
rssi |= (data[34U] << 0) & 0x00FFU;
|
||||
m_rssi = (rssi - m_rssiOffset) / m_rssiMultiplier;
|
||||
LogDebug("DMR Slot %u, raw RSSI: %u, reported RSSI: %d", m_slotNo, rssi, m_rssi);
|
||||
}
|
||||
|
||||
bool dataSync = (data[1U] & DMR_SYNC_DATA) == DMR_SYNC_DATA;
|
||||
bool audioSync = (data[1U] & DMR_SYNC_AUDIO) == DMR_SYNC_AUDIO;
|
||||
|
||||
|
@ -1287,6 +1300,7 @@ void CDMRSlot::writeNetworkRF(const unsigned char* data, unsigned char dataType,
|
|||
dmrData.setN(m_rfN);
|
||||
dmrData.setSeqNo(m_rfSeqNo);
|
||||
dmrData.setBER(errors);
|
||||
dmrData.setRSSI(m_rssi);
|
||||
|
||||
m_rfSeqNo++;
|
||||
|
||||
|
@ -1324,7 +1338,7 @@ void CDMRSlot::writeQueueNet(const unsigned char *data)
|
|||
m_queue.addData(data, len);
|
||||
}
|
||||
|
||||
void CDMRSlot::init(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& SrcIdBlacklist, const std::vector<unsigned int>& DstIdBlacklistSlot1RF, const std::vector<unsigned int>& DstIdWhitelistSlot1RF, const std::vector<unsigned int>& DstIdBlacklistSlot2RF, const std::vector<unsigned int>& DstIdWhitelistSlot2RF, const std::vector<unsigned int>& DstIdBlacklistSlot1NET, const std::vector<unsigned int>& DstIdWhitelistSlot1NET, const std::vector<unsigned int>& DstIdBlacklistSlot2NET, const std::vector<unsigned int>& DstIdWhitelistSlot2NET, CModem* modem, CDMRIPSC* network, CDisplay* display, bool duplex, CDMRLookup* lookup)
|
||||
void CDMRSlot::init(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& SrcIdBlacklist, const std::vector<unsigned int>& DstIdBlacklistSlot1RF, const std::vector<unsigned int>& DstIdWhitelistSlot1RF, const std::vector<unsigned int>& DstIdBlacklistSlot2RF, const std::vector<unsigned int>& DstIdWhitelistSlot2RF, const std::vector<unsigned int>& DstIdBlacklistSlot1NET, const std::vector<unsigned int>& DstIdWhitelistSlot1NET, const std::vector<unsigned int>& DstIdBlacklistSlot2NET, const std::vector<unsigned int>& DstIdWhitelistSlot2NET, CModem* modem, CDMRIPSC* network, CDisplay* display, bool duplex, CDMRLookup* lookup, int rssiMultiplier, int rssiOffset)
|
||||
{
|
||||
assert(id != 0U);
|
||||
assert(modem != NULL);
|
||||
|
@ -1341,7 +1355,10 @@ void CDMRSlot::init(unsigned int id, unsigned int colorCode, unsigned int callHa
|
|||
m_display = display;
|
||||
m_duplex = duplex;
|
||||
m_lookup = lookup;
|
||||
m_hangCount = callHang * 17U,
|
||||
m_hangCount = callHang * 17U;
|
||||
|
||||
m_rssiMultiplier = rssiMultiplier;
|
||||
m_rssiOffset = rssiOffset;
|
||||
|
||||
m_idle = new unsigned char[DMR_FRAME_LENGTH_BYTES + 2U];
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
CDMRSlot(unsigned int slotNo, unsigned int timeout);
|
||||
~CDMRSlot();
|
||||
|
||||
void writeModem(unsigned char* data);
|
||||
void writeModem(unsigned char* data, unsigned int len);
|
||||
|
||||
unsigned int readModem(unsigned char* data);
|
||||
|
||||
|
@ -50,7 +50,7 @@ public:
|
|||
|
||||
void clock();
|
||||
|
||||
static void init(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& SrcIdBlackList, const std::vector<unsigned int>& DstIdBlacklistSlot1RF, const std::vector<unsigned int>& DstIdWhitelistSlot1RF, const std::vector<unsigned int>& DstIdBlacklistSlot2RF, const std::vector<unsigned int>& DstIdWhitelistSlot2RF, const std::vector<unsigned int>& DstIdBlacklistSlot1NET, const std::vector<unsigned int>& DstIdWhitelistSlot1NET, const std::vector<unsigned int>& DstIdBlacklistSlot2NET, const std::vector<unsigned int>& DstIdWhitelistSlot2NET, CModem* modem, CDMRIPSC* network, CDisplay* display, bool duplex, CDMRLookup* lookup);
|
||||
static void init(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& SrcIdBlackList, const std::vector<unsigned int>& DstIdBlacklistSlot1RF, const std::vector<unsigned int>& DstIdWhitelistSlot1RF, const std::vector<unsigned int>& DstIdBlacklistSlot2RF, const std::vector<unsigned int>& DstIdWhitelistSlot2RF, const std::vector<unsigned int>& DstIdBlacklistSlot1NET, const std::vector<unsigned int>& DstIdWhitelistSlot1NET, const std::vector<unsigned int>& DstIdBlacklistSlot2NET, const std::vector<unsigned int>& DstIdWhitelistSlot2NET, CModem* modem, CDMRIPSC* network, CDisplay* display, bool duplex, CDMRLookup* lookup, int rssiMultiplier, int rssiOffset);
|
||||
|
||||
private:
|
||||
unsigned int m_slotNo;
|
||||
|
@ -84,6 +84,7 @@ private:
|
|||
unsigned char* m_lastFrame;
|
||||
bool m_lastFrameValid;
|
||||
CDMREMB m_lastEMB;
|
||||
signed char m_rssi;
|
||||
FILE* m_fp;
|
||||
|
||||
static unsigned int m_id;
|
||||
|
@ -99,6 +100,9 @@ private:
|
|||
static CDMRLookup* m_lookup;
|
||||
static unsigned int m_hangCount;
|
||||
|
||||
static int m_rssiMultiplier;
|
||||
static int m_rssiOffset;
|
||||
|
||||
static unsigned char* m_idle;
|
||||
|
||||
static FLCO m_flco1;
|
||||
|
|
|
@ -104,7 +104,7 @@ CDStarControl::~CDStarControl()
|
|||
delete[] m_lastFrame;
|
||||
}
|
||||
|
||||
bool CDStarControl::writeModem(unsigned char *data)
|
||||
bool CDStarControl::writeModem(unsigned char *data, unsigned int len)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
CDStarControl(const std::string& callsign, const std::string& module, bool selfOnly, const std::vector<std::string>& blackList, CDStarNetwork* network, CDisplay* display, unsigned int timeout, bool duplex);
|
||||
~CDStarControl();
|
||||
|
||||
bool writeModem(unsigned char* data);
|
||||
bool writeModem(unsigned char* data, unsigned int len);
|
||||
|
||||
unsigned int readModem(unsigned char* data);
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ DMRDelay=0
|
|||
RXLevel=50
|
||||
TXLevel=50
|
||||
OscOffset=0
|
||||
RSSIMultiplier=1
|
||||
RSSIOffset=10
|
||||
Debug=0
|
||||
|
||||
[D-Star]
|
||||
|
@ -84,6 +86,7 @@ Address=44.131.4.1
|
|||
Port=62031
|
||||
# Local=3350
|
||||
Password=PASSWORD
|
||||
RSSI=0
|
||||
Slot1=1
|
||||
Slot2=1
|
||||
Debug=0
|
||||
|
|
|
@ -301,6 +301,8 @@ int CMMDVMHost::run()
|
|||
std::string lookupFile = m_conf.getDMRLookupFile();
|
||||
unsigned int callHang = m_conf.getDMRCallHang();
|
||||
unsigned int txHang = m_conf.getDMRTXHang();
|
||||
int rssiMultiplier = m_conf.getModemRSSIMultiplier();
|
||||
int rssiOffset = m_conf.getModemRSSIOffset();
|
||||
|
||||
if (txHang > m_rfModeHang)
|
||||
txHang = m_rfModeHang;
|
||||
|
@ -339,7 +341,12 @@ int CMMDVMHost::run()
|
|||
LogInfo(" Call Hang: %us", callHang);
|
||||
LogInfo(" TX Hang: %us", txHang);
|
||||
|
||||
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);
|
||||
if (rssiMultiplier != 0) {
|
||||
LogInfo(" RSSI Multiplier: %d", rssiMultiplier);
|
||||
LogInfo(" RSSI Offset: %d", rssiOffset);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
m_dmrTXTimer.setTimeout(txHang);
|
||||
}
|
||||
|
@ -372,13 +379,13 @@ int CMMDVMHost::run()
|
|||
len = m_modem->readDStarData(data);
|
||||
if (dstar != NULL && len > 0U) {
|
||||
if (m_mode == MODE_IDLE) {
|
||||
bool ret = dstar->writeModem(data);
|
||||
bool ret = dstar->writeModem(data, len);
|
||||
if (ret) {
|
||||
m_modeTimer.setTimeout(m_rfModeHang);
|
||||
setMode(MODE_DSTAR);
|
||||
}
|
||||
} else if (m_mode == MODE_DSTAR) {
|
||||
dstar->writeModem(data);
|
||||
dstar->writeModem(data, len);
|
||||
m_modeTimer.start();
|
||||
} else if (m_mode != MODE_LOCKOUT) {
|
||||
LogWarning("D-Star modem data received when in mode %u", m_mode);
|
||||
|
@ -398,7 +405,7 @@ int CMMDVMHost::run()
|
|||
} else {
|
||||
m_modeTimer.setTimeout(m_rfModeHang);
|
||||
setMode(MODE_DMR);
|
||||
dmr->writeModemSlot1(data);
|
||||
dmr->writeModemSlot1(data, len);
|
||||
dmrBeaconTimer.stop();
|
||||
}
|
||||
} else if (m_mode == MODE_DMR) {
|
||||
|
@ -409,7 +416,7 @@ int CMMDVMHost::run()
|
|||
m_dmrTXTimer.start();
|
||||
}
|
||||
} else {
|
||||
dmr->writeModemSlot1(data);
|
||||
dmr->writeModemSlot1(data, len);
|
||||
dmrBeaconTimer.stop();
|
||||
m_modeTimer.start();
|
||||
if (m_duplex)
|
||||
|
@ -433,7 +440,7 @@ int CMMDVMHost::run()
|
|||
} else {
|
||||
m_modeTimer.setTimeout(m_rfModeHang);
|
||||
setMode(MODE_DMR);
|
||||
dmr->writeModemSlot2(data);
|
||||
dmr->writeModemSlot2(data, len);
|
||||
dmrBeaconTimer.stop();
|
||||
}
|
||||
} else if (m_mode == MODE_DMR) {
|
||||
|
@ -444,7 +451,7 @@ int CMMDVMHost::run()
|
|||
m_dmrTXTimer.start();
|
||||
}
|
||||
} else {
|
||||
dmr->writeModemSlot2(data);
|
||||
dmr->writeModemSlot2(data, len);
|
||||
dmrBeaconTimer.stop();
|
||||
m_modeTimer.start();
|
||||
if (m_duplex)
|
||||
|
@ -458,13 +465,13 @@ int CMMDVMHost::run()
|
|||
len = m_modem->readYSFData(data);
|
||||
if (ysf != NULL && len > 0U) {
|
||||
if (m_mode == MODE_IDLE) {
|
||||
bool ret = ysf->writeModem(data);
|
||||
bool ret = ysf->writeModem(data, len);
|
||||
if (ret) {
|
||||
m_modeTimer.setTimeout(m_rfModeHang);
|
||||
setMode(MODE_YSF);
|
||||
}
|
||||
} else if (m_mode == MODE_YSF) {
|
||||
ysf->writeModem(data);
|
||||
ysf->writeModem(data, len);
|
||||
m_modeTimer.start();
|
||||
} else if (m_mode != MODE_LOCKOUT) {
|
||||
LogWarning("System Fusion modem data received when in mode %u", m_mode);
|
||||
|
@ -727,6 +734,7 @@ bool CMMDVMHost::createDMRNetwork()
|
|||
bool debug = m_conf.getDMRNetworkDebug();
|
||||
bool slot1 = m_conf.getDMRNetworkSlot1();
|
||||
bool slot2 = m_conf.getDMRNetworkSlot2();
|
||||
bool rssi = m_conf.getDMRNetworkRSSI();
|
||||
|
||||
LogInfo("DMR Network Parameters");
|
||||
LogInfo(" Address: %s", address.c_str());
|
||||
|
@ -737,8 +745,9 @@ bool CMMDVMHost::createDMRNetwork()
|
|||
LogInfo(" Local: random");
|
||||
LogInfo(" Slot 1: %s", slot1 ? "enabled" : "disabled");
|
||||
LogInfo(" Slot 2: %s", slot2 ? "enabled" : "disabled");
|
||||
LogInfo(" RSSI: %s", rssi ? "enabled" : "disabled");
|
||||
|
||||
m_dmrNetwork = new CDMRIPSC(address, port, local, id, password, m_duplex, VERSION, debug, slot1, slot2);
|
||||
m_dmrNetwork = new CDMRIPSC(address, port, local, id, password, m_duplex, VERSION, debug, slot1, slot2, rssi);
|
||||
|
||||
unsigned int rxFrequency = m_conf.getRxFrequency();
|
||||
unsigned int txFrequency = m_conf.getTxFrequency();
|
||||
|
|
|
@ -75,7 +75,7 @@ CYSFControl::~CYSFControl()
|
|||
delete[] m_lastFrame;
|
||||
}
|
||||
|
||||
bool CYSFControl::writeModem(unsigned char *data)
|
||||
bool CYSFControl::writeModem(unsigned char *data, unsigned int len)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
CYSFControl(const std::string& callsign, CYSFNetwork* network, CDisplay* display, unsigned int timeout, bool duplex);
|
||||
~CYSFControl();
|
||||
|
||||
bool writeModem(unsigned char* data);
|
||||
bool writeModem(unsigned char* data, unsigned int len);
|
||||
|
||||
unsigned int readModem(unsigned char* data);
|
||||
|
||||
|
|
Loading…
Reference in a new issue