Merge remote-tracking branch 'g4klx/master'

This commit is contained in:
Andy CA6JAU 2017-03-09 13:49:48 -03:00
commit 8bdca1324a
15 changed files with 3197 additions and 251 deletions

View file

@ -90,7 +90,6 @@ m_modemDStarTXLevel(50U),
m_modemDMRTXLevel(50U),
m_modemYSFTXLevel(50U),
m_modemP25TXLevel(50U),
m_modemOscOffset(0),
m_modemRSSIMappingFile(),
m_modemSamplesDir(),
m_modemDebug(false),
@ -107,6 +106,7 @@ m_dmrId(0U),
m_dmrColorCode(2U),
m_dmrSelfOnly(false),
m_dmrEmbeddedLCOnly(false),
m_dmrDumpTAData(true),
m_dmrPrefixes(),
m_dmrBlackList(),
m_dmrWhiteList(),
@ -193,7 +193,7 @@ bool CConf::read()
if (buffer[0U] == '[') {
if (::strncmp(buffer, "[General]", 9U) == 0)
section = SECTION_GENERAL;
section = SECTION_GENERAL;
else if (::strncmp(buffer, "[Info]", 6U) == 0)
section = SECTION_INFO;
else if (::strncmp(buffer, "[Log]", 5U) == 0)
@ -216,9 +216,9 @@ bool CConf::read()
section = SECTION_P25;
else if (::strncmp(buffer, "[D-Star Network]", 16U) == 0)
section = SECTION_DSTAR_NETWORK;
else if (::strncmp(buffer, "[DMR Network]", 13U) == 0)
else if (::strncmp(buffer, "[DMR Network]", 13U) == 0)
section = SECTION_DMR_NETWORK;
else if (::strncmp(buffer, "[System Fusion Network]", 23U) == 0)
else if (::strncmp(buffer, "[System Fusion Network]", 23U) == 0)
section = SECTION_FUSION_NETWORK;
else if (::strncmp(buffer, "[P25 Network]", 13U) == 0)
section = SECTION_P25_NETWORK;
@ -235,15 +235,18 @@ bool CConf::read()
else
section = SECTION_NONE;
continue;
}
continue;
}
char* key = ::strtok(buffer, " \t=\r\n");
if (key == NULL)
continue;
char* key = ::strtok(buffer, " \t=\r\n");
if (key == NULL)
continue;
char* value = ::strtok(NULL, "\r\n");
if (section == SECTION_GENERAL) {
char* value = ::strtok(NULL, "\r\n");
if (value == NULL)
continue;
if (section == SECTION_GENERAL) {
if (::strcmp(key, "Callsign") == 0) {
// Convert the callsign to upper case
for (unsigned int i = 0U; value[i] != 0; i++)
@ -328,8 +331,6 @@ bool CConf::read()
m_modemYSFTXLevel = (unsigned int)::atoi(value);
else if (::strcmp(key, "P25TXLevel") == 0)
m_modemP25TXLevel = (unsigned int)::atoi(value);
else if (::strcmp(key, "OscOffset") == 0)
m_modemOscOffset = ::atoi(value);
else if (::strcmp(key, "RSSIMappingFile") == 0)
m_modemRSSIMappingFile = value;
else if (::strcmp(key, "SamplesDir") == 0)
@ -378,6 +379,8 @@ bool CConf::read()
m_dmrSelfOnly = ::atoi(value) == 1;
else if (::strcmp(key, "EmbeddedLCOnly") == 0)
m_dmrEmbeddedLCOnly = ::atoi(value) == 1;
else if (::strcmp(key, "DumpTAData") == 0)
m_dmrDumpTAData = ::atoi(value) == 1;
else if (::strcmp(key, "Prefixes") == 0) {
char* p = ::strtok(value, ",\r\n");
while (p != NULL) {
@ -739,11 +742,6 @@ unsigned int CConf::getModemP25TXLevel() const
return m_modemP25TXLevel;
}
int CConf::getModemOscOffset() const
{
return m_modemOscOffset;
}
std::string CConf::getModemRSSIMappingFile () const
{
return m_modemRSSIMappingFile;
@ -824,6 +822,11 @@ bool CConf::getDMREmbeddedLCOnly() const
return m_dmrEmbeddedLCOnly;
}
bool CConf::getDMRDumpTAData() const
{
return m_dmrDumpTAData;
}
std::vector<unsigned int> CConf::getDMRPrefixes() const
{
return m_dmrPrefixes;

4
Conf.h
View file

@ -77,7 +77,6 @@ public:
unsigned int getModemDMRTXLevel() const;
unsigned int getModemYSFTXLevel() const;
unsigned int getModemP25TXLevel() const;
int getModemOscOffset() const;
std::string getModemRSSIMappingFile() const;
std::string getModemSamplesDir() const;
bool getModemDebug() const;
@ -99,6 +98,7 @@ public:
unsigned int getDMRId() const;
unsigned int getDMRColorCode() const;
bool getDMREmbeddedLCOnly() const;
bool getDMRDumpTAData() const;
bool getDMRSelfOnly() const;
std::vector<unsigned int> getDMRPrefixes() const;
std::vector<unsigned int> getDMRBlackList() const;
@ -229,7 +229,6 @@ private:
unsigned int m_modemDMRTXLevel;
unsigned int m_modemYSFTXLevel;
unsigned int m_modemP25TXLevel;
int m_modemOscOffset;
std::string m_modemRSSIMappingFile;
std::string m_modemSamplesDir;
bool m_modemDebug;
@ -249,6 +248,7 @@ private:
unsigned int m_dmrColorCode;
bool m_dmrSelfOnly;
bool m_dmrEmbeddedLCOnly;
bool m_dmrDumpTAData;
std::vector<unsigned int> m_dmrPrefixes;
std::vector<unsigned int> m_dmrBlackList;
std::vector<unsigned int> m_dmrWhiteList;

View file

@ -21,7 +21,7 @@
#include <cassert>
#include <algorithm>
CDMRControl::CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, bool embeddedLCOnly, 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) :
m_id(id),
m_colorCode(colorCode),
m_modem(modem),
@ -39,7 +39,7 @@ m_lookup(lookup)
// Load black and white lists to DMRAccessControl
CDMRAccessControl::init(blacklist, whitelist, slot1TGWhitelist, slot2TGWhitelist, selfOnly, prefixes, id);
CDMRSlot::init(colorCode, embeddedLCOnly, callHang, modem, network, display, duplex, m_lookup, rssi, jitter);
CDMRSlot::init(colorCode, embeddedLCOnly, dumpTAData, callHang, modem, network, display, duplex, m_lookup, rssi, jitter);
}
CDMRControl::~CDMRControl()

View file

@ -31,7 +31,7 @@
class CDMRControl {
public:
CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, bool embeddedLCOnly, 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);
~CDMRControl();
bool processWakeup(const unsigned char* data);

3113
DMRIds.dat

File diff suppressed because it is too large Load diff

View file

@ -32,6 +32,7 @@
unsigned int CDMRSlot::m_colorCode = 0U;
bool CDMRSlot::m_embeddedLCOnly = false;
bool CDMRSlot::m_dumpTAData = true;
CModem* CDMRSlot::m_modem = NULL;
CDMRNetwork* CDMRSlot::m_network = NULL;
@ -378,8 +379,10 @@ void CDMRSlot::writeModem(unsigned char *data, unsigned int len)
LogMessage("DMR Slot %u, received RF data header from %s to %s%s, %u blocks", m_slotNo, src.c_str(), gi ? "TG ": "", dst.c_str(), m_rfFrames);
if (m_rfFrames == 0U)
endOfRFData();
if (m_rfFrames == 0U) {
LogMessage("DMR Slot %u, ended RF data transmission", m_slotNo);
writeEndRF();
}
} else if (dataType == DT_CSBK) {
CDMRCSBK csbk;
bool valid = csbk.put(data + 2U);
@ -483,8 +486,10 @@ void CDMRSlot::writeModem(unsigned char *data, unsigned int len)
writeNetworkRF(data, dataType);
if (m_rfFrames == 0U)
endOfRFData();
if (m_rfFrames == 0U) {
LogMessage("DMR Slot %u, ended RF data transmission", m_slotNo);
writeEndRF();
}
}
} else if (audioSync) {
if (m_rfState == RS_RF_AUDIO) {
@ -558,34 +563,48 @@ void CDMRSlot::writeModem(unsigned char *data, unsigned int len)
// CUtils::dump(1U, text, data, 9U);
break;
case FLCO_GPS_INFO:
::sprintf(text, "DMR Slot %u, Embedded GPS Info", m_slotNo);
CUtils::dump(2U, text, data, 9U);
if (m_dumpTAData) {
::sprintf(text, "DMR Slot %u, Embedded GPS Info", m_slotNo);
CUtils::dump(2U, text, data, 9U);
}
break;
case FLCO_TALKER_ALIAS_HEADER:
if (!(m_rfTalkerId & TALKER_ID_HEADER)) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Header", m_slotNo);
CUtils::dump(2U, text, data, 9U);
if (m_dumpTAData) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Header", m_slotNo);
CUtils::dump(2U, text, data, 9U);
}
m_rfTalkerId |= TALKER_ID_HEADER;
}
break;
case FLCO_TALKER_ALIAS_BLOCK1:
if (!(m_rfTalkerId & TALKER_ID_BLOCK1)) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Block 1", m_slotNo);
CUtils::dump(2U, text, data, 9U);
if (m_dumpTAData) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Block 1", m_slotNo);
CUtils::dump(2U, text, data, 9U);
}
m_rfTalkerId |= TALKER_ID_BLOCK1;
}
break;
case FLCO_TALKER_ALIAS_BLOCK2:
if (!(m_rfTalkerId & TALKER_ID_BLOCK2)) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Block 2", m_slotNo);
CUtils::dump(2U, text, data, 9U);
if (m_dumpTAData) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Block 2", m_slotNo);
CUtils::dump(2U, text, data, 9U);
}
m_rfTalkerId |= TALKER_ID_BLOCK2;
}
break;
case FLCO_TALKER_ALIAS_BLOCK3:
if (!(m_rfTalkerId & TALKER_ID_BLOCK3)) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Block 3", m_slotNo);
CUtils::dump(2U, text, data, 9U);
if (m_dumpTAData) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Block 3", m_slotNo);
CUtils::dump(2U, text, data, 9U);
}
m_rfTalkerId |= TALKER_ID_BLOCK3;
}
break;
@ -760,33 +779,6 @@ unsigned int CDMRSlot::readModem(unsigned char* data)
return len;
}
void CDMRSlot::endOfRFData()
{
LogMessage("DMR Slot %u, ended RF data transmission", m_slotNo);
if (m_duplex) {
unsigned char bytes[DMR_FRAME_LENGTH_BYTES + 2U];
CSync::addDMRDataSync(bytes + 2U, m_duplex);
CDMRSlotType slotType;
slotType.setDataType(DT_TERMINATOR_WITH_LC);
slotType.setColorCode(m_colorCode);
slotType.getData(bytes + 2U);
m_rfDataHeader.getTerminator(bytes + 2U);
bytes[0U] = TAG_EOT;
bytes[1U] = 0x00U;
writeQueueRF(bytes);
writeQueueRF(bytes);
writeQueueRF(bytes);
}
writeEndRF();
}
void CDMRSlot::writeEndRF(bool writeEnd)
{
m_rfState = RS_RF_LISTENING;
@ -829,33 +821,6 @@ void CDMRSlot::writeEndRF(bool writeEnd)
m_rfLC = NULL;
}
void CDMRSlot::endOfNetData()
{
LogMessage("DMR Slot %u, ended network data transmission", m_slotNo);
if (m_duplex) {
unsigned char bytes[DMR_FRAME_LENGTH_BYTES + 2U];
CSync::addDMRDataSync(bytes + 2U, m_duplex);
CDMRSlotType slotType;
slotType.setDataType(DT_TERMINATOR_WITH_LC);
slotType.setColorCode(m_colorCode);
slotType.getData(bytes + 2U);
m_netDataHeader.getTerminator(bytes + 2U);
bytes[0U] = TAG_EOT;
bytes[1U] = 0x00U;
writeQueueNet(bytes);
writeQueueNet(bytes);
writeQueueNet(bytes);
}
writeEndNet();
}
void CDMRSlot::writeEndNet(bool writeEnd)
{
m_netState = RS_NET_IDLE;
@ -1169,8 +1134,10 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
LogMessage("DMR Slot %u, received network data header from %s to %s%s, %u blocks", m_slotNo, src.c_str(), gi ? "TG ": "", dst.c_str(), m_netFrames);
if (m_netFrames == 0U)
endOfNetData();
if (m_netFrames == 0U) {
LogMessage("DMR Slot %u, ended network data transmission", m_slotNo);
writeEndNet();
}
} else if (dataType == DT_VOICE_SYNC) {
if (m_netState == RS_NET_IDLE) {
CDMRLC* lc = new CDMRLC(dmrData.getFLCO(), dmrData.getSrcId(), dmrData.getDstId());
@ -1314,34 +1281,48 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
// CUtils::dump(1U, text, data, 9U);
break;
case FLCO_GPS_INFO:
::sprintf(text, "DMR Slot %u, Embedded GPS Info", m_slotNo);
CUtils::dump(2U, text, data, 9U);
if (m_dumpTAData) {
::sprintf(text, "DMR Slot %u, Embedded GPS Info", m_slotNo);
CUtils::dump(2U, text, data, 9U);
}
break;
case FLCO_TALKER_ALIAS_HEADER:
if (!(m_netTalkerId & TALKER_ID_HEADER)) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Header", m_slotNo);
CUtils::dump(2U, text, data, 9U);
if (m_dumpTAData) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Header", m_slotNo);
CUtils::dump(2U, text, data, 9U);
}
m_netTalkerId |= TALKER_ID_HEADER;
}
break;
case FLCO_TALKER_ALIAS_BLOCK1:
if (!(m_netTalkerId & TALKER_ID_BLOCK1)) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Block 1", m_slotNo);
CUtils::dump(2U, text, data, 9U);
if (m_dumpTAData) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Block 1", m_slotNo);
CUtils::dump(2U, text, data, 9U);
}
m_netTalkerId |= TALKER_ID_BLOCK1;
}
break;
case FLCO_TALKER_ALIAS_BLOCK2:
if (!(m_netTalkerId & TALKER_ID_BLOCK2)) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Block 2", m_slotNo);
CUtils::dump(2U, text, data, 9U);
if (m_dumpTAData) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Block 2", m_slotNo);
CUtils::dump(2U, text, data, 9U);
}
m_netTalkerId |= TALKER_ID_BLOCK2;
}
break;
case FLCO_TALKER_ALIAS_BLOCK3:
if (!(m_netTalkerId & TALKER_ID_BLOCK3)) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Block 3", m_slotNo);
CUtils::dump(2U, text, data, 9U);
if (m_dumpTAData) {
::sprintf(text, "DMR Slot %u, Embedded Talker Alias Block 3", m_slotNo);
CUtils::dump(2U, text, data, 9U);
}
m_netTalkerId |= TALKER_ID_BLOCK3;
}
break;
@ -1496,8 +1477,10 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
#endif
writeQueueNet(data);
if (m_netFrames == 0U)
endOfNetData();
if (m_netFrames == 0U) {
LogMessage("DMR Slot %u, ended network data transmission", m_slotNo);
writeEndNet();
}
} else {
// Unhandled data type
LogWarning("DMR Slot %u, unhandled network data type - 0x%02X", m_slotNo, dataType);
@ -1635,7 +1618,7 @@ void CDMRSlot::writeQueueNet(const unsigned char *data)
m_queue.addData(data, len);
}
void CDMRSlot::init(unsigned int colorCode, bool embeddedLCOnly, 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)
{
assert(modem != NULL);
assert(display != NULL);
@ -1644,6 +1627,7 @@ void CDMRSlot::init(unsigned int colorCode, bool embeddedLCOnly, unsigned int ca
m_colorCode = colorCode;
m_embeddedLCOnly = embeddedLCOnly;
m_dumpTAData = dumpTAData;
m_modem = modem;
m_network = network;
m_display = display;

View file

@ -50,7 +50,7 @@ public:
void clock();
static void init(unsigned int colorCode, bool embeddedLCOnly, 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);
private:
unsigned int m_slotNo;
@ -101,6 +101,7 @@ private:
static unsigned int m_colorCode;
static bool m_embeddedLCOnly;
static bool m_dumpTAData;
static CModem* m_modem;
static CDMRNetwork* m_network;
@ -128,9 +129,6 @@ private:
void writeNetworkRF(const unsigned char* data, unsigned char dataType, unsigned char errors = 0U);
void writeNetworkRF(const unsigned char* data, unsigned char dataType, FLCO flco, unsigned int srcId, unsigned int dstId, unsigned char errors = 0U);
void endOfRFData();
void endOfNetData();
void writeEndRF(bool writeEnd = false);
void writeEndNet(bool writeEnd = false);

7
ISSUES.txt Normal file
View file

@ -0,0 +1,7 @@
D-Star: No obvious issues.
DMR: There is an issue where transmitted data (text messages) isnt picked up as reliably from an MMDVM than (say) a Hytera repeater. In order to address this, I need to see a trace from a Hytera repeater transmitting text, both from cold (no tx) and when already running. The DMRRX receiver from the DV4RX code in my GitHub repository would do the job, provided you have a DV4mini and a repeater within range.
YSF: There is an issue that need addressing: The data sent to aprs.fi from southern hemisphere users isnt always correct. Maybe the GPS format used by YSF still has some secrets to reveal.
P25: No obvious issues.

View file

@ -49,7 +49,6 @@ TXLevel=50
# DMRTXLevel=50
# YSFTXLevel=50
# P25TXLevel=50
OscOffset=0
RSSIMappingFile=RSSI.dat
SamplesDir=.
Debug=0
@ -72,6 +71,7 @@ Id=123456
ColorCode=1
SelfOnly=0
EmbeddedLCOnly=0
DumpTAData=1
# Prefixes=234,235
# Slot1TGWhiteList=
# Slot2TGWhiteList=

View file

@ -347,13 +347,14 @@ int CMMDVMHost::run()
unsigned int id = m_conf.getDMRId();
unsigned int colorCode = m_conf.getDMRColorCode();
bool selfOnly = m_conf.getDMRSelfOnly();
bool embeddedLCOnly = m_conf.getDMREmbeddedLCOnly();
bool embeddedLCOnly = m_conf.getDMREmbeddedLCOnly();
bool dumpTAData = m_conf.getDMRDumpTAData();
std::vector<unsigned int> prefixes = m_conf.getDMRPrefixes();
std::vector<unsigned int> blackList = m_conf.getDMRBlackList();
std::vector<unsigned int> whiteList = m_conf.getDMRWhiteList();
std::vector<unsigned int> slot1TGWhiteList = m_conf.getDMRSlot1TGWhiteList();
std::vector<unsigned int> slot2TGWhiteList = m_conf.getDMRSlot2TGWhiteList();
unsigned int callHang = m_conf.getDMRCallHang();
unsigned int callHang = m_conf.getDMRCallHang();
unsigned int txHang = m_conf.getDMRTXHang();
unsigned int jitter = m_conf.getDMRNetworkJitter();
@ -370,6 +371,7 @@ int CMMDVMHost::run()
LogInfo(" Color Code: %u", colorCode);
LogInfo(" Self Only: %s", selfOnly ? "yes" : "no");
LogInfo(" Embedded LC Only: %s", embeddedLCOnly ? "yes" : "no");
LogInfo(" Dump Talker Alias Data: %s", dumpTAData ? "yes" : "no");
LogInfo(" Prefixes: %u", prefixes.size());
if (blackList.size() > 0U)
@ -384,7 +386,7 @@ int CMMDVMHost::run()
LogInfo(" Call Hang: %us", callHang);
LogInfo(" TX Hang: %us", txHang);
dmr = new CDMRControl(id, colorCode, callHang, selfOnly, embeddedLCOnly, prefixes, blackList, whiteList, slot1TGWhiteList, slot2TGWhiteList, m_timeout, m_modem, m_dmrNetwork, m_display, m_duplex, m_lookup, rssi, jitter);
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_lookup, rssi, jitter);
m_dmrTXTimer.setTimeout(txHang);
}
@ -794,7 +796,6 @@ bool CMMDVMHost::createModem()
unsigned int colorCode = m_conf.getDMRColorCode();
unsigned int rxFrequency = m_conf.getRxFrequency();
unsigned int txFrequency = m_conf.getTxFrequency();
int oscOffset = m_conf.getModemOscOffset();
std::string samplesDir = m_conf.getModemSamplesDir();
LogInfo("Modem Parameters");
@ -812,9 +813,8 @@ bool CMMDVMHost::createModem()
LogInfo(" P25 TX Level: %u%%", p25TXLevel);
LogInfo(" RX Frequency: %uHz", rxFrequency);
LogInfo(" TX Frequency: %uHz", txFrequency);
LogInfo(" Osc. Offset: %dppm", oscOffset);
m_modem = new CModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, oscOffset, samplesDir, debug);
m_modem = new CModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, samplesDir, debug);
m_modem->setModeParams(m_dstarEnabled, m_dmrEnabled, m_ysfEnabled, m_p25Enabled);
m_modem->setLevels(rxLevel, cwIdTXLevel, dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel);
m_modem->setRFParams(rxFrequency, txFrequency);
@ -1266,7 +1266,7 @@ void CMMDVMHost::setMode(unsigned char mode)
m_modem->setMode(MODE_IDLE);
if (m_ump != NULL)
m_ump->setMode(MODE_IDLE);
if (m_mode == MODE_ERROR || m_mode == MODE_LOCKOUT) {
if (m_mode == MODE_ERROR) {
m_modem->sendCWId(m_callsign);
m_cwIdTimer.setTimeout(m_cwIdTime);
m_cwIdTimer.start();

View file

@ -85,7 +85,7 @@ const unsigned int MAX_RESPONSES = 30U;
const unsigned int BUFFER_LENGTH = 2000U;
CModem::CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, int oscOffset, const std::string& samplesDir, bool debug) :
CModem::CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, const std::string& samplesDir, bool debug) :
m_port(port),
m_colorCode(0U),
m_duplex(duplex),
@ -100,7 +100,6 @@ m_dstarTXLevel(0U),
m_dmrTXLevel(0U),
m_ysfTXLevel(0U),
m_p25TXLevel(0U),
m_oscOffset(oscOffset),
m_samplesDir(samplesDir),
m_debug(debug),
m_rxFrequency(0U),
@ -980,7 +979,7 @@ bool CModem::setConfig()
buffer[10U] = m_dmrDelay;
buffer[11U] = (unsigned char)(m_oscOffset + 128);
buffer[11U] = 128U; // Was OscOffset
buffer[12U] = (m_dstarTXLevel * 255U) / 100U;
buffer[13U] = (m_dmrTXLevel * 255U) / 100U;
@ -1166,7 +1165,7 @@ RESP_TYPE_MMDVM CModem::getResponse()
// CUtils::dump(1U, "Received", m_buffer, m_length);
return RTM_OK;
return RTM_OK;
}
HW_TYPE CModem::getHWType() const
@ -1337,7 +1336,7 @@ void CModem::dumpSamples()
return;
}
::fwrite(m_buffer + 6U, 1U, m_length, fp);
::fwrite(m_buffer + 6U, 1U, m_length - 6U, fp);
::fclose(fp);
}

View file

@ -34,7 +34,7 @@ enum RESP_TYPE_MMDVM {
class CModem {
public:
CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, int oscOffset, const std::string& samplesDir, bool debug = false);
CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, const std::string& samplesDir, bool debug = false);
~CModem();
void setRFParams(unsigned int rxFrequency, unsigned int txFrequency);
@ -101,7 +101,6 @@ private:
unsigned int m_dmrTXLevel;
unsigned int m_ysfTXLevel;
unsigned int m_p25TXLevel;
int m_oscOffset;
std::string m_samplesDir;
bool m_debug;
unsigned int m_rxFrequency;

43
RSSI/RSSI_GM340.dat Normal file
View file

@ -0,0 +1,43 @@
# This file maps the raw RSSI values to dBm values to send to the DMR network. A number of data
# points should be entered and the software will use those to work out the in-between values.
#
# The format of the file is:
# Raw RSSI Value dBm Value
#
# Measured with a Marconi 2955 Test set and Motorola GM340 UHF (430.6125 MHz) using Arduino DUE.
# No resistor divider, 100nF decoupling capacitor from ADC to ground.
# Both S-meter (6dB) and decade (10dB) steps are included between the noise floor and saturation.
# George M1GEO / GB7KH - 01/01/2017
#
2858 -20
2857 -30
2856 -40
2855 -43
2854 -48
2853 -50
2845 -53
2780 -58
2732 -60
2647 -63
2484 -68
2422 -70
2356 -73
2234 -78
2183 -80
2103 -83
1978 -88
1931 -90
1875 -93
1710 -99
1686 -100
1545 -105
1416 -110
1398 -111
1238 -117
1166 -120
1106 -123
1018 -129
1006 -130
985 -135
976 -140
971 -150

48
RSSI/RSSI_TB7100.dat Normal file
View file

@ -0,0 +1,48 @@
# This file maps the raw RSSI values to dBm values to send to the DMR network. A number of data
# points should be entered and the software will use those to work out the in-between values.
#
# The format of the file is:
# Raw RSSI Value dBm Value #output voltage
#
# The following values were measured with a Marconi 2024 signal generator.
# Setup is MMDVM (PCB by Toufik, F0DEI) on a STM32F446RE Nucleo board.
# The values in the comments are the voltage measured at the TB7100 RSSI output pin.
# Florian DF2ET, 03.03.2017
#
2303 -22 #2.93
2256 -25 #2.86
2184 -28 #2.77
2159 -31 #2.74
2095 -34 #2.66
2040 -37 #2.59
1985 -40 #2.52
1922 -43 #2.44
1868 -46 #2.37
1804 -49 #2.29
1758 -52 #2.23
1694 -55 #2.15
1640 -58 #2.08
1568 -61 #1.99
1540 -64 #1.95
1459 -67 #1.85
1403 -70 #1.78
1340 -73 #1.70
1287 -76 #1.63
1233 -79 #1.56
1178 -82 #1.49
1116 -85 #1.41
1054 -88 #1.33
1000 -91 #1.27
945 -94 #1.20
890 -97 #1.13
830 -100 #1.05
768 -103 #0.97
715 -106 #0.90
660 -109 #0.83
600 -112 #0.76
540 -115 #0.68
500 -118 #0.63
450 -121 #0.57
420 -124 #0.52
390 -127 #0.48
370 -130 #0.47

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2017 by Jonathan Naylor G4KLX
*
* 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
@ -19,6 +19,6 @@
#if !defined(VERSION_H)
#define VERSION_H
const char* VERSION = "20170206";
const char* VERSION = "20170303";
#endif