1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

Merge pull request #1892 from srcejon/fix_1826

M17: Update packet format to comply with current spec
This commit is contained in:
Edouard Griffiths 2023-11-15 21:19:06 +01:00 committed by GitHub
commit a4ae0efb51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 7 deletions

View File

@ -128,17 +128,13 @@ public:
std::copy(source_.begin(), source_.end(), rit); std::copy(source_.begin(), source_.end(), rit);
lsf[12] = can_ >> 1; lsf[12] = can_ >> 1;
lsf[13] = (streamElsePacket ? 5 : 4) | ((can_ & 1) << 7); lsf[13] = (streamElsePacket ? 5 : 2) | ((can_ & 1) << 7);
if (gnss_on_) if (gnss_on_)
{ {
lsf[13] |= (1<<5); lsf[13] |= (1<<5);
std::copy(gnss_.begin(), gnss_.end(), &lsf[14]); std::copy(gnss_.begin(), gnss_.end(), &lsf[14]);
} }
else
{
lsf[13] |= (3<<5);
}
crc.reset(); crc.reset();

View File

@ -251,10 +251,10 @@ void M17DemodProcessor::decode_type(uint16_t type)
m_typeInfo += "UNK"; m_typeInfo += "UNK";
break; break;
case 1: case 1:
m_typeInfo += "RAW"; m_typeInfo += "DAT";
break; break;
case 2: case 2:
m_typeInfo += "ENC"; m_typeInfo += "UNK";
break; break;
case 3: case 3:
m_typeInfo += "UNK"; m_typeInfo += "UNK";

View File

@ -60,6 +60,7 @@ bool M17ModProcessor::handleMessage(const Message& cmd)
const MsgSendSMS& notif = (const MsgSendSMS&) cmd; const MsgSendSMS& notif = (const MsgSendSMS&) cmd;
QByteArray packetBytes = notif.getSMSText().toUtf8(); QByteArray packetBytes = notif.getSMSText().toUtf8();
packetBytes.prepend(0x05); // SMS standard type packetBytes.prepend(0x05); // SMS standard type
packetBytes.append('\0'); // SMS should be null terminated
packetBytes.truncate(798); // Maximum packet size is 798 payload + 2 bytes CRC = 800 bytes (32*25) packetBytes.truncate(798); // Maximum packet size is 798 payload + 2 bytes CRC = 800 bytes (32*25)
processPacket(notif.getSourceCall(), notif.getDestCall(), notif.getCAN(), packetBytes); processPacket(notif.getSourceCall(), notif.getDestCall(), notif.getCAN(), packetBytes);
// test(notif.getSourceCall(), notif.getDestCall()); // test(notif.getSourceCall(), notif.getDestCall());

View File

@ -18,6 +18,7 @@
#include <QWidget> #include <QWidget>
#include <QDebug> #include <QDebug>
#include <QDataStream> #include <QDataStream>
#include <QIODevice>
#include "mdiutils.h" #include "mdiutils.h"