mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 23:41:38 +08:00
Restore the branch
This commit is contained in:
75
Nextion.cpp
75
Nextion.cpp
@@ -36,6 +36,8 @@ const unsigned int P25_RSSI_COUNT = 7U; // 7 * 180ms = 1260ms
|
||||
const unsigned int P25_BER_COUNT = 7U; // 7 * 180ms = 1260ms
|
||||
const unsigned int NXDN_RSSI_COUNT = 28U; // 28 * 40ms = 1120ms
|
||||
const unsigned int NXDN_BER_COUNT = 28U; // 28 * 40ms = 1120ms
|
||||
const unsigned int M17_RSSI_COUNT = 28U; // 28 * 40ms = 1120ms
|
||||
const unsigned int M17_BER_COUNT = 28U; // 28 * 40ms = 1120ms
|
||||
|
||||
#define LAYOUT_COMPAT_MASK (7 << 0) // compatibility for old setting
|
||||
#define LAYOUT_TA_ENABLE (1 << 4) // enable Talker Alias (TA) display
|
||||
@@ -822,6 +824,79 @@ void CNextion::clearNXDNInt()
|
||||
sendCommand("t3.txt=\"\"");
|
||||
}
|
||||
|
||||
void CNextion::writeM17Int(const char* source, const char* dest, const char* type)
|
||||
{
|
||||
assert(source != NULL);
|
||||
assert(dest != NULL);
|
||||
assert(type != NULL);
|
||||
|
||||
if (m_mode != MODE_M17) {
|
||||
sendCommand("page M17");
|
||||
sendCommandAction(6U);
|
||||
}
|
||||
|
||||
char text[30U];
|
||||
if (m_brightness > 0) {
|
||||
::sprintf(text, "dim=%u", m_brightness);
|
||||
sendCommand(text);
|
||||
}
|
||||
|
||||
::sprintf(text, "t0.txt=\"%s %.10s\"", type, source);
|
||||
sendCommand(text);
|
||||
sendCommandAction(122U);
|
||||
|
||||
::sprintf(text, "t1.txt=\"%s\"", dest);
|
||||
sendCommand(text);
|
||||
sendCommandAction(123U);
|
||||
|
||||
m_clockDisplayTimer.stop();
|
||||
|
||||
m_mode = MODE_M17;
|
||||
m_rssiAccum1 = 0U;
|
||||
m_berAccum1 = 0.0F;
|
||||
m_rssiCount1 = 0U;
|
||||
m_berCount1 = 0U;
|
||||
}
|
||||
|
||||
void CNextion::writeM17RSSIInt(unsigned char rssi)
|
||||
{
|
||||
m_rssiAccum1 += rssi;
|
||||
m_rssiCount1++;
|
||||
|
||||
if (m_rssiCount1 == M17_RSSI_COUNT) {
|
||||
char text[25U];
|
||||
::sprintf(text, "t2.txt=\"-%udBm\"", m_rssiAccum1 / M17_RSSI_COUNT);
|
||||
sendCommand(text);
|
||||
sendCommandAction(124U);
|
||||
m_rssiAccum1 = 0U;
|
||||
m_rssiCount1 = 0U;
|
||||
}
|
||||
}
|
||||
|
||||
void CNextion::writeM17BERInt(float ber)
|
||||
{
|
||||
m_berAccum1 += ber;
|
||||
m_berCount1++;
|
||||
|
||||
if (m_berCount1 == M17_BER_COUNT) {
|
||||
char text[25U];
|
||||
::sprintf(text, "t3.txt=\"%.1f%%\"", m_berAccum1 / float(M17_BER_COUNT));
|
||||
sendCommand(text);
|
||||
sendCommandAction(125U);
|
||||
m_berAccum1 = 0.0F;
|
||||
m_berCount1 = 0U;
|
||||
}
|
||||
}
|
||||
|
||||
void CNextion::clearM17Int()
|
||||
{
|
||||
sendCommand("t0.txt=\"Listening\"");
|
||||
sendCommandAction(121U);
|
||||
sendCommand("t1.txt=\"\"");
|
||||
sendCommand("t2.txt=\"\"");
|
||||
sendCommand("t3.txt=\"\"");
|
||||
}
|
||||
|
||||
void CNextion::writePOCSAGInt(uint32_t ric, const std::string& message)
|
||||
{
|
||||
if (m_mode != MODE_POCSAG) {
|
||||
|
||||
Reference in New Issue
Block a user