Skip to content

Commit

Permalink
Merge pull request f4exb#1892 from srcejon/fix_1826
Browse files Browse the repository at this point in the history
M17: Update packet format to comply with current spec
  • Loading branch information
f4exb authored Nov 15, 2023
2 parents c7eca5e + 5f0d2aa commit a4ae0ef
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
6 changes: 1 addition & 5 deletions modemm17/M17Modulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,13 @@ struct MODEMM17_API M17Modulator
std::copy(source_.begin(), source_.end(), rit);

lsf[12] = can_ >> 1;
lsf[13] = (streamElsePacket ? 5 : 4) | ((can_ & 1) << 7);
lsf[13] = (streamElsePacket ? 5 : 2) | ((can_ & 1) << 7);

if (gnss_on_)
{
lsf[13] |= (1<<5);
std::copy(gnss_.begin(), gnss_.end(), &lsf[14]);
}
else
{
lsf[13] |= (3<<5);
}

crc.reset();

Expand Down
4 changes: 2 additions & 2 deletions plugins/channelrx/demodm17/m17demodprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ void M17DemodProcessor::decode_type(uint16_t type)
m_typeInfo += "UNK";
break;
case 1:
m_typeInfo += "RAW";
m_typeInfo += "DAT";
break;
case 2:
m_typeInfo += "ENC";
m_typeInfo += "UNK";
break;
case 3:
m_typeInfo += "UNK";
Expand Down
1 change: 1 addition & 0 deletions plugins/channeltx/modm17/m17modprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ bool M17ModProcessor::handleMessage(const Message& cmd)
const MsgSendSMS& notif = (const MsgSendSMS&) cmd;
QByteArray packetBytes = notif.getSMSText().toUtf8();
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)
processPacket(notif.getSourceCall(), notif.getDestCall(), notif.getCAN(), packetBytes);
// test(notif.getSourceCall(), notif.getDestCall());
Expand Down
1 change: 1 addition & 0 deletions sdrgui/gui/mdiutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <QWidget>
#include <QDebug>
#include <QDataStream>
#include <QIODevice>

#include "mdiutils.h"

Expand Down

0 comments on commit a4ae0ef

Please sign in to comment.