diff --git a/plugins/channelrx/demodpager/pagerdemod.cpp b/plugins/channelrx/demodpager/pagerdemod.cpp index a73f473e2..f117cda94 100644 --- a/plugins/channelrx/demodpager/pagerdemod.cpp +++ b/plugins/channelrx/demodpager/pagerdemod.cpp @@ -145,17 +145,13 @@ bool PagerDemod::handleMessage(const Message& cmd) // Forward via UDP if (m_settings.m_udpEnabled) { - QString message = QString("%1%2%3%4%5%6%7%8%9").arg( - report.getDateTime().toString(), - '\0', - QString::number(report.getAddress()), - '\0', - QString::number(report.getFunctionBits()), - '\0', - report.getAlphaMessage(), - '\0', - report.getNumericMessage()); - m_udpSocket.writeDatagram(message.toLatin1(), message.size(), + QByteArray message; + message.append(report.getDateTime().toString().toLatin1()); + message.append(QString::number(report.getAddress()).toLatin1()); + message.append(QString::number(report.getFunctionBits()).toLatin1()); + message.append(report.getAlphaMessage().toLatin1()); + message.append(report.getNumericMessage().toLatin1()); + m_udpSocket.writeDatagram(message.data(), message.size(), QHostAddress(m_settings.m_udpAddress), m_settings.m_udpPort); } diff --git a/plugins/channelrx/demodpager/pagerdemodsink.cpp b/plugins/channelrx/demodpager/pagerdemodsink.cpp index 129eadfa9..8ff13b661 100644 --- a/plugins/channelrx/demodpager/pagerdemodsink.cpp +++ b/plugins/channelrx/demodpager/pagerdemodsink.cpp @@ -136,7 +136,6 @@ quint32 PagerDemodSink::reverse(quint32 x) quint32 PagerDemodSink::bchEncode(const quint32 cw) { quint32 bit = 0; - quint32 parity = 0; quint32 localCW = cw & 0xFFFFF800; // Mask off BCH parity and even parity bits quint32 cwE = localCW; @@ -285,7 +284,6 @@ void PagerDemodSink::decodeBatch() else if (addressCodeWord) { // Address - int checkBits = (m_codeWords[i] >> 1) & 0x3f; m_functionBits = (m_codeWords[i] >> 11) & 0x3; int addressBits = (m_codeWords[i] >> 13) & 0x3ffff; m_address = (addressBits << 3) | frame; @@ -300,7 +298,6 @@ void PagerDemodSink::decodeBatch() else { // Message - decode as both numeric and ASCII - not all operators use functionBits to indidcate encoding - int checkBits = (m_codeWords[i] >> 1) & 0x3f; int messageBits = (m_codeWords[i] >> 11) & 0xfffff; if (parityError) { m_parityErrors++; @@ -441,8 +438,8 @@ void PagerDemodSink::processOneSample(Complex &ci) else if (popcount(m_bits ^ PAGERDEMOD_POCSAG_SYNCCODE_INV) >= 29) { quint32 correctedCW; + if (bchDecode(~m_bits, correctedCW) && (correctedCW == PAGERDEMOD_POCSAG_SYNCCODE)) { - qDebug() << "Corrected inverted sync codeword"; m_gotSOP = true; m_inverted = true; } diff --git a/plugins/channelrx/demodpager/readme.md b/plugins/channelrx/demodpager/readme.md index b4b92c24e..28c7eb74d 100644 --- a/plugins/channelrx/demodpager/readme.md +++ b/plugins/channelrx/demodpager/readme.md @@ -32,10 +32,10 @@ Adjusts the expected frequency deviation in 0.1 kHz steps from 1 to 6 kHz. POCSA

6: Mod - Modulation

-Species the pager modulation. Currently only POCSAG is supported. +Specifies the pager modulation. Currently only POCSAG is supported. POCSAG uses FSK with 4.5kHz frequency shift, at 512, 1200 or 2400 baud. -High frequency is typically 0, with low 1, but occasionaly this appears to be reversed, so the demodulator supports either. +High frequency is typically 0, with low 1, but occasionally this appears to be reversed, so the demodulator supports either. Data is framed as specified in ITU-R M.584-2: https://www.itu.int/dms_pubrec/itu-r/rec/m/R-REC-M.584-2-199711-I!!PDF-E.pdf

7: Baud

@@ -66,7 +66,7 @@ Pressing this button clears all messages from the table. When checked, received messages are forwarded to the specified UDP address (12) and port (13). -The messages are forwarded as null termiated ASCII strings, in the format: data time address function alpha numeric +The messages are forwarded as null terminated ASCII strings, in the format: data time address function alpha numeric

12: UDP address

@@ -92,4 +92,4 @@ The received messages table displays each pager message received. * Even PE - Number of even parity errors detected in the code words of the message. * BCH PE - Number of uncorrectable BCH parity errors detected in the code words of the message. -Right clicking on the table header allows you to select which columns to show. The columns can be reorderd by left clicking and dragging the column header. Right clicking on an item in the table allows you to copy the value to the clipboard. +Right clicking on the table header allows you to select which columns to show. The columns can be reordered by left clicking and dragging the column header. Right clicking on an item in the table allows you to copy the value to the clipboard.