Reinstated the location field.

This commit is contained in:
Jonathan Naylor
2020-08-26 12:13:34 +01:00
parent a9c9ff6011
commit 98879b5c14
9 changed files with 40 additions and 16 deletions

View File

@@ -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) :
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) :
CDisplay(),
m_callsign(callsign),
m_ipaddress("(ip unknown)"),
@@ -72,7 +72,8 @@ m_txFrequency(txFrequency),
m_rxFrequency(rxFrequency),
m_fl_txFrequency(0.0F),
m_fl_rxFrequency(0.0F),
m_displayTempInF(displayTempInF)
m_displayTempInF(displayTempInF),
m_location(location)
{
assert(serial != NULL);
assert(brightness >= 0U && brightness <= 100U);
@@ -177,6 +178,10 @@ void CNextion::setIdleInt()
sendCommandAction(22U);
}
}
::sprintf(command, "t31.txt=\"%s\"", m_location.c_str()); // location
sendCommand(command);
sendCommandAction(23U);
} else {
sendCommandAction(17U);
}