Allow for optional seperate (and longer) CW Ids.
This commit is contained in:
parent
dd2db36409
commit
99d57bf102
17
Conf.cpp
17
Conf.cpp
|
@ -76,6 +76,7 @@ m_logFilePath(),
|
||||||
m_logFileRoot(),
|
m_logFileRoot(),
|
||||||
m_cwIdEnabled(false),
|
m_cwIdEnabled(false),
|
||||||
m_cwIdTime(10U),
|
m_cwIdTime(10U),
|
||||||
|
m_cwIdCallsign(),
|
||||||
m_dmrIdLookupFile(),
|
m_dmrIdLookupFile(),
|
||||||
m_dmrIdLookupTime(0U),
|
m_dmrIdLookupTime(0U),
|
||||||
m_modemPort(),
|
m_modemPort(),
|
||||||
|
@ -252,7 +253,7 @@ bool CConf::read()
|
||||||
// Convert the callsign to upper case
|
// Convert the callsign to upper case
|
||||||
for (unsigned int i = 0U; value[i] != 0; i++)
|
for (unsigned int i = 0U; value[i] != 0; i++)
|
||||||
value[i] = ::toupper(value[i]);
|
value[i] = ::toupper(value[i]);
|
||||||
m_callsign = value;
|
m_cwIdCallsign = m_callsign = value;
|
||||||
} else if (::strcmp(key, "Timeout") == 0)
|
} else if (::strcmp(key, "Timeout") == 0)
|
||||||
m_timeout = (unsigned int)::atoi(value);
|
m_timeout = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "Duplex") == 0)
|
else if (::strcmp(key, "Duplex") == 0)
|
||||||
|
@ -300,7 +301,14 @@ bool CConf::read()
|
||||||
m_cwIdEnabled = ::atoi(value) == 1;
|
m_cwIdEnabled = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "Time") == 0)
|
else if (::strcmp(key, "Time") == 0)
|
||||||
m_cwIdTime = (unsigned int)::atoi(value);
|
m_cwIdTime = (unsigned int)::atoi(value);
|
||||||
} else if (section == SECTION_DMRID_LOOKUP) {
|
else if (::strcmp(key, "Callsign") == 0) {
|
||||||
|
// Convert the callsign to upper case
|
||||||
|
for (unsigned int i = 0U; value[i] != 0; i++)
|
||||||
|
value[i] = ::toupper(value[i]);
|
||||||
|
m_cwIdCallsign = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (section == SECTION_DMRID_LOOKUP) {
|
||||||
if (::strcmp(key, "File") == 0)
|
if (::strcmp(key, "File") == 0)
|
||||||
m_dmrIdLookupFile = value;
|
m_dmrIdLookupFile = value;
|
||||||
else if (::strcmp(key, "Time") == 0)
|
else if (::strcmp(key, "Time") == 0)
|
||||||
|
@ -675,6 +683,11 @@ unsigned int CConf::getCWIdTime() const
|
||||||
return m_cwIdTime;
|
return m_cwIdTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string CConf::getCWIdCallsign() const
|
||||||
|
{
|
||||||
|
return m_cwIdCallsign;
|
||||||
|
}
|
||||||
|
|
||||||
std::string CConf::getDMRIdLookupFile() const
|
std::string CConf::getDMRIdLookupFile() const
|
||||||
{
|
{
|
||||||
return m_dmrIdLookupFile;
|
return m_dmrIdLookupFile;
|
||||||
|
|
2
Conf.h
2
Conf.h
|
@ -59,6 +59,7 @@ public:
|
||||||
// The CW ID section
|
// The CW ID section
|
||||||
bool getCWIdEnabled() const;
|
bool getCWIdEnabled() const;
|
||||||
unsigned int getCWIdTime() const;
|
unsigned int getCWIdTime() const;
|
||||||
|
std::string getCWIdCallsign() const;
|
||||||
|
|
||||||
// The DMR Id section
|
// The DMR Id section
|
||||||
std::string getDMRIdLookupFile() const;
|
std::string getDMRIdLookupFile() const;
|
||||||
|
@ -214,6 +215,7 @@ private:
|
||||||
|
|
||||||
bool m_cwIdEnabled;
|
bool m_cwIdEnabled;
|
||||||
unsigned int m_cwIdTime;
|
unsigned int m_cwIdTime;
|
||||||
|
std::string m_cwIdCallsign;
|
||||||
|
|
||||||
std::string m_dmrIdLookupFile;
|
std::string m_dmrIdLookupFile;
|
||||||
unsigned int m_dmrIdLookupTime;
|
unsigned int m_dmrIdLookupTime;
|
||||||
|
|
|
@ -29,6 +29,7 @@ FileRoot=MMDVM
|
||||||
[CW Id]
|
[CW Id]
|
||||||
Enable=1
|
Enable=1
|
||||||
Time=10
|
Time=10
|
||||||
|
# Callsign=
|
||||||
|
|
||||||
[DMR Id Lookup]
|
[DMR Id Lookup]
|
||||||
File=DMRIds.dat
|
File=DMRIds.dat
|
||||||
|
|
|
@ -144,7 +144,8 @@ m_ysfEnabled(false),
|
||||||
m_p25Enabled(false),
|
m_p25Enabled(false),
|
||||||
m_cwIdTime(0U),
|
m_cwIdTime(0U),
|
||||||
m_lookup(NULL),
|
m_lookup(NULL),
|
||||||
m_callsign()
|
m_callsign(),
|
||||||
|
m_cwCallsign()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,9 +287,11 @@ int CMMDVMHost::run()
|
||||||
|
|
||||||
if (m_conf.getCWIdEnabled()) {
|
if (m_conf.getCWIdEnabled()) {
|
||||||
unsigned int time = m_conf.getCWIdTime();
|
unsigned int time = m_conf.getCWIdTime();
|
||||||
|
m_cwCallsign = m_conf.getCWIdCallsign();
|
||||||
|
|
||||||
LogInfo("CW Id Parameters");
|
LogInfo("CW Id Parameters");
|
||||||
LogInfo(" Time: %u mins", time);
|
LogInfo(" Time: %u mins", time);
|
||||||
|
LogInfo(" Callsign: %s", m_cwCallsign.c_str());
|
||||||
|
|
||||||
m_cwIdTime = time * 60U;
|
m_cwIdTime = time * 60U;
|
||||||
|
|
||||||
|
@ -716,7 +719,7 @@ int CMMDVMHost::run()
|
||||||
if (m_mode == MODE_IDLE && !m_modem->hasTX()){
|
if (m_mode == MODE_IDLE && !m_modem->hasTX()){
|
||||||
LogDebug("sending CW ID");
|
LogDebug("sending CW ID");
|
||||||
m_display->writeCW();
|
m_display->writeCW();
|
||||||
m_modem->sendCWId(m_callsign);
|
m_modem->sendCWId(m_cwCallsign);
|
||||||
|
|
||||||
m_cwIdTimer.setTimeout(m_cwIdTime);
|
m_cwIdTimer.setTimeout(m_cwIdTime);
|
||||||
m_cwIdTimer.start();
|
m_cwIdTimer.start();
|
||||||
|
|
|
@ -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
|
* 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
|
||||||
|
@ -64,6 +64,7 @@ private:
|
||||||
unsigned int m_cwIdTime;
|
unsigned int m_cwIdTime;
|
||||||
CDMRLookup* m_lookup;
|
CDMRLookup* m_lookup;
|
||||||
std::string m_callsign;
|
std::string m_callsign;
|
||||||
|
std::string m_cwCallsign;
|
||||||
|
|
||||||
void readParams();
|
void readParams();
|
||||||
bool createModem();
|
bool createModem();
|
||||||
|
|
Loading…
Reference in a new issue