Display the decrypted text on the external displays.

This commit is contained in:
Jonathan Naylor 2020-12-14 12:48:56 +00:00
parent 77daf86723
commit a027b1f3bd
2 changed files with 14 additions and 11 deletions

View file

@ -147,36 +147,38 @@ bool CPOCSAGControl::readNetwork()
addAddress(functional, output->m_ric, output->m_buffer); addAddress(functional, output->m_ric, output->m_buffer);
std::string out;
switch (functional) { switch (functional) {
case FUNCTIONAL_ALPHANUMERIC: case FUNCTIONAL_ALPHANUMERIC:
output->m_text = std::string((char*)(data + 4U), length - 4U); output->m_text = std::string((char*)(data + 4U), length - 4U);
switch (output->m_ric) { switch (output->m_ric) {
case 4512U: case 4512U:
decodeROT1(output->m_text, 3U, out); decodeROT1(output->m_text, 3U, output->m_display);
LogDebug("Message to %07u, func Alphanumeric: (%u) \"%s\"", output->m_ric, output->m_text.at(1U) - 0x1FU, out.c_str()); LogDebug("Message to %07u, func Alphanumeric: (%u) \"%s\"", output->m_ric, output->m_text.at(1U) - 0x1FU, output->m_display.c_str());
break; break;
case 4520U: case 4520U:
decodeROT1(output->m_text, 2U, out); decodeROT1(output->m_text, 2U, output->m_display);
LogDebug("Message to %07u, func Alphanumeric: (%u-%u) \"%s\"", output->m_ric, output->m_text.at(0U) - 0x1FU, output->m_text.at(1U) - 0x20U, out.c_str()); LogDebug("Message to %07u, func Alphanumeric: (%u-%u) \"%s\"", output->m_ric, output->m_text.at(0U) - 0x1FU, output->m_text.at(1U) - 0x20U, output->m_display.c_str());
break; break;
default: default:
LogDebug("Message to %07u, func Alphanumeric: \"%s\"", output->m_ric, output->m_text.c_str()); output->m_display = output->m_text;
LogDebug("Message to %07u, func Alphanumeric: \"%s\"", output->m_ric, output->m_display.c_str());
break; break;
} }
packASCII(output->m_text, output->m_buffer); packASCII(output->m_text, output->m_buffer);
break; break;
case FUNCTIONAL_NUMERIC: case FUNCTIONAL_NUMERIC:
output->m_text = std::string((char*)(data + 4U), length - 4U); output->m_text = std::string((char*)(data + 4U), length - 4U);
LogDebug("Message to %07u, func Numeric: \"%s\"", output->m_ric, output->m_text.c_str()); output->m_display = output->m_text;
LogDebug("Message to %07u, func Numeric: \"%s\"", output->m_ric, output->m_display.c_str());
packNumeric(output->m_text, output->m_buffer); packNumeric(output->m_text, output->m_buffer);
break; break;
case FUNCTIONAL_ALERT1: case FUNCTIONAL_ALERT1:
LogDebug("Message to %07u, func Alert 1", output->m_ric); LogDebug("Message to %07u, func Alert 1", output->m_ric);
break; break;
case FUNCTIONAL_ALERT2: case FUNCTIONAL_ALERT2:
output->m_text = std::string((char*)(data + 4U), length - 4U); output->m_text = std::string((char*)(data + 4U), length - 4U);
LogDebug("Message to %07u, func Alert 2: \"%s\"", output->m_ric, output->m_text.c_str()); output->m_display = output->m_text;
LogDebug("Message to %07u, func Alert 2: \"%s\"", output->m_ric, output->m_display.c_str());
packASCII(output->m_text, output->m_buffer); packASCII(output->m_text, output->m_buffer);
break; break;
default: default:
@ -200,7 +202,7 @@ bool CPOCSAGControl::processData()
POCSAGData* output = m_data.front(); POCSAGData* output = m_data.front();
m_data.pop_front(); m_data.pop_front();
m_display->writePOCSAG(output->m_ric, output->m_text); m_display->writePOCSAG(output->m_ric, output->m_display);
m_buffer = output->m_buffer; m_buffer = output->m_buffer;
m_ric = output->m_ric; m_ric = output->m_ric;

View file

@ -33,6 +33,7 @@
struct POCSAGData { struct POCSAGData {
unsigned int m_ric; unsigned int m_ric;
std::string m_text; std::string m_text;
std::string m_display;
std::deque<uint32_t> m_buffer; std::deque<uint32_t> m_buffer;
}; };