mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2025-12-06 05:32:00 +01:00
Remove the location information from the new config message.
This commit is contained in:
parent
01da0ded7f
commit
2349520964
8
Conf.cpp
8
Conf.cpp
|
|
@ -71,7 +71,6 @@ m_daemon(false),
|
|||
m_rxFrequency(0U),
|
||||
m_txFrequency(0U),
|
||||
m_power(0U),
|
||||
m_location(),
|
||||
m_logDisplayLevel(0U),
|
||||
m_logFileLevel(0U),
|
||||
m_logFilePath(),
|
||||
|
|
@ -421,8 +420,6 @@ bool CConf::read()
|
|||
m_rxFrequency = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "Power") == 0)
|
||||
m_power = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "Location") == 0)
|
||||
m_location = value;
|
||||
} else if (section == SECTION_LOG) {
|
||||
if (::strcmp(key, "FilePath") == 0)
|
||||
m_logFilePath = value;
|
||||
|
|
@ -996,11 +993,6 @@ unsigned int CConf::getPower() const
|
|||
return m_power;
|
||||
}
|
||||
|
||||
std::string CConf::getLocation() const
|
||||
{
|
||||
return m_location;
|
||||
}
|
||||
|
||||
unsigned int CConf::getLogDisplayLevel() const
|
||||
{
|
||||
return m_logDisplayLevel;
|
||||
|
|
|
|||
2
Conf.h
2
Conf.h
|
|
@ -42,7 +42,6 @@ public:
|
|||
unsigned int getRXFrequency() const;
|
||||
unsigned int getTXFrequency() const;
|
||||
unsigned int getPower() const;
|
||||
std::string getLocation() const;
|
||||
|
||||
// The Log section
|
||||
unsigned int getLogDisplayLevel() const;
|
||||
|
|
@ -316,7 +315,6 @@ private:
|
|||
unsigned int m_rxFrequency;
|
||||
unsigned int m_txFrequency;
|
||||
unsigned int m_power;
|
||||
std::string m_location;
|
||||
|
||||
unsigned int m_logDisplayLevel;
|
||||
unsigned int m_logFileLevel;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ m_rxFrequency(0U),
|
|||
m_txFrequency(0U),
|
||||
m_power(0U),
|
||||
m_colorCode(0U),
|
||||
m_location(),
|
||||
m_pingTimer(1000U, 10U)
|
||||
{
|
||||
assert(!address.empty());
|
||||
|
|
@ -89,14 +88,13 @@ CDMRNetwork::~CDMRNetwork()
|
|||
delete[] m_id;
|
||||
}
|
||||
|
||||
void CDMRNetwork::setConfig(const std::string & callsign, unsigned int rxFrequency, unsigned int txFrequency, unsigned int power, unsigned int colorCode, const std::string& location)
|
||||
void CDMRNetwork::setConfig(const std::string & callsign, unsigned int rxFrequency, unsigned int txFrequency, unsigned int power, unsigned int colorCode)
|
||||
{
|
||||
m_callsign = callsign;
|
||||
m_rxFrequency = rxFrequency;
|
||||
m_txFrequency = txFrequency;
|
||||
m_power = power;
|
||||
m_colorCode = colorCode;
|
||||
m_location = location;
|
||||
}
|
||||
|
||||
bool CDMRNetwork::open()
|
||||
|
|
@ -401,15 +399,15 @@ bool CDMRNetwork::writeConfig()
|
|||
if (power > 99U)
|
||||
power = 99U;
|
||||
|
||||
char buffer[200U];
|
||||
char buffer[150U];
|
||||
|
||||
::memcpy(buffer + 0U, "DMRC", 4U);
|
||||
::memcpy(buffer + 4U, m_id, 4U);
|
||||
::sprintf(buffer + 8U, "%-8.8s%09u%09u%02u%02u%-20.20s%c%-40.40s%-40.40s",
|
||||
m_callsign.c_str(), m_rxFrequency, m_txFrequency, power, m_colorCode, m_location.c_str(), slots, m_version,
|
||||
::sprintf(buffer + 8U, "%-8.8s%09u%09u%02u%02u%c%-40.40s%-40.40s",
|
||||
m_callsign.c_str(), m_rxFrequency, m_txFrequency, power, m_colorCode, slots, m_version,
|
||||
software);
|
||||
|
||||
return write((unsigned char*)buffer, 139U);
|
||||
return write((unsigned char*)buffer, 119U);
|
||||
}
|
||||
|
||||
bool CDMRNetwork::wantsBeacon()
|
||||
|
|
@ -426,8 +424,8 @@ bool CDMRNetwork::write(const unsigned char* data, unsigned int length)
|
|||
assert(data != NULL);
|
||||
assert(length > 0U);
|
||||
|
||||
// if (m_debug)
|
||||
// CUtils::dump(1U, "Network Transmitted", data, length);
|
||||
if (m_debug)
|
||||
CUtils::dump(1U, "Network Transmitted", data, length);
|
||||
|
||||
bool ret = m_socket.write(data, length, m_address, m_port);
|
||||
if (!ret) {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public:
|
|||
CDMRNetwork(const std::string& address, unsigned int port, unsigned int local, unsigned int id, bool duplex, const char* version, bool debug, bool slot1, bool slot2, HW_TYPE hwType);
|
||||
~CDMRNetwork();
|
||||
|
||||
void setConfig(const std::string& callsign, unsigned int rxFrequency, unsigned int txFrequency, unsigned int power, unsigned int colorCode, const std::string& location);
|
||||
void setConfig(const std::string& callsign, unsigned int rxFrequency, unsigned int txFrequency, unsigned int power, unsigned int colorCode);
|
||||
|
||||
bool open();
|
||||
|
||||
|
|
@ -78,7 +78,6 @@ private:
|
|||
unsigned int m_txFrequency;
|
||||
unsigned int m_power;
|
||||
unsigned int m_colorCode;
|
||||
std::string m_location;
|
||||
CTimer m_pingTimer;
|
||||
|
||||
bool writeConfig();
|
||||
|
|
|
|||
|
|
@ -556,10 +556,10 @@ CDisplay* CDisplay::createDisplay(const CConf& conf, CUMP* ump, CModem* modem)
|
|||
|
||||
if (port == "modem") {
|
||||
ISerialPort* serial = new CModemSerialPort(modem);
|
||||
display = new CNextion(conf.getCallsign(), dmrid, serial, brightness, displayClock, utc, idleBrightness, screenLayout, txFrequency, rxFrequency, displayTempInF, conf.getLocation());
|
||||
display = new CNextion(conf.getCallsign(), dmrid, serial, brightness, displayClock, utc, idleBrightness, screenLayout, txFrequency, rxFrequency, displayTempInF);
|
||||
} else if (port == "ump") {
|
||||
if (ump != NULL) {
|
||||
display = new CNextion(conf.getCallsign(), dmrid, ump, brightness, displayClock, utc, idleBrightness, screenLayout, txFrequency, rxFrequency, displayTempInF, conf.getLocation());
|
||||
display = new CNextion(conf.getCallsign(), dmrid, ump, brightness, displayClock, utc, idleBrightness, screenLayout, txFrequency, rxFrequency, displayTempInF);
|
||||
} else {
|
||||
LogInfo(" NullDisplay loaded");
|
||||
display = new CNullDisplay;
|
||||
|
|
@ -571,7 +571,7 @@ CDisplay* CDisplay::createDisplay(const CConf& conf, CUMP* ump, CModem* modem)
|
|||
|
||||
LogInfo(" Display baudrate: %u ",baudrate);
|
||||
ISerialPort* serial = new CSerialController(port, baudrate);
|
||||
display = new CNextion(conf.getCallsign(), dmrid, serial, brightness, displayClock, utc, idleBrightness, screenLayout, txFrequency, rxFrequency, displayTempInF, conf.getLocation());
|
||||
display = new CNextion(conf.getCallsign(), dmrid, serial, brightness, displayClock, utc, idleBrightness, screenLayout, txFrequency, rxFrequency, displayTempInF);
|
||||
}
|
||||
} else if (type == "LCDproc") {
|
||||
std::string address = conf.getLCDprocAddress();
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ Daemon=0
|
|||
RXFrequency=435000000
|
||||
TXFrequency=435000000
|
||||
Power=1
|
||||
Location=Nowhere
|
||||
|
||||
[Log]
|
||||
# Logging levels, 0=No logging
|
||||
|
|
|
|||
|
|
@ -1345,16 +1345,14 @@ bool CMMDVMHost::createDMRNetwork()
|
|||
unsigned int txFrequency = m_conf.getTXFrequency();
|
||||
unsigned int power = m_conf.getPower();
|
||||
unsigned int colorCode = m_conf.getDMRColorCode();
|
||||
std::string location = m_conf.getLocation();
|
||||
|
||||
LogInfo("Info Parameters");
|
||||
LogInfo(" Callsign: %s", m_callsign.c_str());
|
||||
LogInfo(" RX Frequency: %uHz", rxFrequency);
|
||||
LogInfo(" TX Frequency: %uHz", txFrequency);
|
||||
LogInfo(" Power: %uW", power);
|
||||
LogInfo(" Location: \"%s\"", location.c_str());
|
||||
|
||||
m_dmrNetwork->setConfig(m_callsign, rxFrequency, txFrequency, power, colorCode, location);
|
||||
m_dmrNetwork->setConfig(m_callsign, rxFrequency, txFrequency, power, colorCode);
|
||||
|
||||
bool ret = m_dmrNetwork->open();
|
||||
if (!ret) {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ const unsigned int NXDN_BER_COUNT = 28U; // 28 * 40ms = 1120ms
|
|||
// 00:low, others:high-speed. bit[2] is overlapped with LAYOUT_COMPAT_MASK.
|
||||
#define LAYOUT_HIGHSPEED (3 << 2)
|
||||
|
||||
CNextion::CNextion(const std::string& callsign, unsigned int dmrid, ISerialPort* serial, unsigned int brightness, bool displayClock, bool utc, unsigned int idleBrightness, unsigned int screenLayout, unsigned int txFrequency, unsigned int rxFrequency, bool displayTempInF, const std::string& location) :
|
||||
CNextion::CNextion(const std::string& callsign, unsigned int dmrid, ISerialPort* serial, unsigned int brightness, bool displayClock, bool utc, unsigned int idleBrightness, unsigned int screenLayout, unsigned int txFrequency, unsigned int rxFrequency, bool displayTempInF) :
|
||||
CDisplay(),
|
||||
m_callsign(callsign),
|
||||
m_ipaddress("(ip unknown)"),
|
||||
|
|
@ -72,8 +72,7 @@ m_txFrequency(txFrequency),
|
|||
m_rxFrequency(rxFrequency),
|
||||
m_fl_txFrequency(0.0F),
|
||||
m_fl_rxFrequency(0.0F),
|
||||
m_displayTempInF(displayTempInF),
|
||||
m_location(location)
|
||||
m_displayTempInF(displayTempInF)
|
||||
{
|
||||
assert(serial != NULL);
|
||||
assert(brightness >= 0U && brightness <= 100U);
|
||||
|
|
@ -178,10 +177,6 @@ void CNextion::setIdleInt()
|
|||
sendCommandAction(22U);
|
||||
}
|
||||
}
|
||||
|
||||
::sprintf(command, "t31.txt=\"%s\"", m_location.c_str()); // location
|
||||
sendCommand(command);
|
||||
sendCommandAction(23U);
|
||||
} else {
|
||||
sendCommandAction(17U);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
class CNextion : public CDisplay
|
||||
{
|
||||
public:
|
||||
CNextion(const std::string& callsign, unsigned int dmrid, ISerialPort* serial, unsigned int brightness, bool displayClock, bool utc, unsigned int idleBrightness, unsigned int screenLayout, unsigned int txFrequency, unsigned int rxFrequency, bool displayTempInF, const std::string& location);
|
||||
CNextion(const std::string& callsign, unsigned int dmrid, ISerialPort* serial, unsigned int brightness, bool displayClock, bool utc, unsigned int idleBrightness, unsigned int screenLayout, unsigned int txFrequency, unsigned int rxFrequency, bool displayTempInF);
|
||||
virtual ~CNextion();
|
||||
|
||||
virtual bool open();
|
||||
|
|
@ -103,7 +103,6 @@ private:
|
|||
double m_fl_txFrequency;
|
||||
double m_fl_rxFrequency;
|
||||
bool m_displayTempInF;
|
||||
std::string m_location;
|
||||
|
||||
void sendCommand(const char* command);
|
||||
void sendCommandAction(unsigned int status);
|
||||
|
|
|
|||
Loading…
Reference in a new issue