From 270f518a63f5c5611117d557e9b592c425bd3a86 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 12 Jun 2018 22:05:23 +0100 Subject: [PATCH] Remove the EOTs from the end of a transmission. --- POCSAGControl.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/POCSAGControl.cpp b/POCSAGControl.cpp index 743ef35..8154cb1 100644 --- a/POCSAGControl.cpp +++ b/POCSAGControl.cpp @@ -29,7 +29,7 @@ const uint32_t DATA_MASK[] = { 0x40000000U, 0x20000000U, 0x10000000U 0x00008000U, 0x00004000U, 0x00002000U, 0x00001000U, 0x00000800U}; -const unsigned char ASCII_EOT = 0x04U; +const unsigned char ASCII_NUL = 0x00U; CPOCSAGControl::CPOCSAGControl(CPOCSAGNetwork* network, CDisplay* display) : m_network(network), @@ -112,7 +112,6 @@ void CPOCSAGControl::clock(unsigned int ms) #endif } - m_output.clear(); m_output.push_back(POCSAG_SYNC_WORD); @@ -206,9 +205,9 @@ void CPOCSAGControl::packASCII() } } - // Add at least one EOT to the message - do { - unsigned char c = ASCII_EOT; + // Fill remaining space wit NUL characters. + while (n != 0U) { + unsigned char c = ASCII_NUL; for (unsigned int j = 0U; j < 7U; j++, c >>= 1) { bool b = (c & MASK) == MASK; if (b) @@ -222,7 +221,7 @@ void CPOCSAGControl::packASCII() n = 0U; } } - } while (n != 0U); + } } void CPOCSAGControl::addBCHAndParity(uint32_t& word) const