1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 10:05:46 -05:00

Packet Plugin: packetmod supports multi Via; packetdemod fix H bit

This commit is contained in:
mxi-box 2024-03-30 19:03:31 +08:00
parent aa95a5bd53
commit 1dddbd4424
2 changed files with 15 additions and 6 deletions

View File

@ -574,6 +574,7 @@ void PacketModSource::addTXPacket(QString callsign, QString to, QString via, QSt
uint16_t crcValue; uint16_t crcValue;
int len; int len;
int packet_length; int packet_length;
QStringList viaList = via.split(',', Qt::SkipEmptyParts);
// Create AX.25 packet // Create AX.25 packet
p = packet; p = packet;
@ -584,9 +585,10 @@ void PacketModSource::addTXPacket(QString callsign, QString to, QString via, QSt
// Dest // Dest
p = ax25_address(p, to, 0xe0); p = ax25_address(p, to, 0xe0);
// From // From
p = ax25_address(p, callsign, 0x60); p = ax25_address(p, callsign, 0x60 | (viaList.empty() ? 0x01 : 0x00));
// Via // Via
p = ax25_address(p, via, 0x61); for (int i = 0; i < viaList.size(); i++)
p = ax25_address(p, std::move(viaList[i]), 0x60 | (i == viaList.size()-1 ? 0x01 : 0x00));
// Control // Control
*p++ = m_settings.m_ax25Control; *p++ = m_settings.m_ax25Control;
// PID // PID

View File

@ -61,6 +61,7 @@ bool AX25Packet::decode(QByteArray packet)
// List of repeater addresses for via field // List of repeater addresses for via field
m_via = QString(""); m_via = QString("");
i = 13; i = 13;
int incomingViaStrIdx = -1;
while ((packet[i] & 1) == 0) while ((packet[i] & 1) == 0)
{ {
i++; i++;
@ -72,11 +73,17 @@ bool AX25Packet::decode(QByteArray packet)
ssid = (repeaterSSID >> 1) & 0xf; ssid = (repeaterSSID >> 1) & 0xf;
QString repeater = QString(repeaterAddress).trimmed(); QString repeater = QString(repeaterAddress).trimmed();
QString ssidString = (ssid != 0) ? QString("%2-%3").arg(repeater).arg(ssid) : QString(repeater); QString ssidString = (ssid != 0) ? QString("%2-%3").arg(repeater).arg(ssid) : QString(repeater);
if (m_via == "")
m_via = ssidString; if (!m_via.isEmpty())
else m_via.append(',');
m_via = QString("%1,%2").arg(m_via).arg(ssidString); m_via.append(ssidString);
if (packet[i] & 0x80)
incomingViaStrIdx = m_via.length();
} }
if (incomingViaStrIdx >= 0)
m_via.insert(incomingViaStrIdx, "*");
i++; i++;
// Control can be 1 or 2 bytes - how to know if 2? // Control can be 1 or 2 bytes - how to know if 2?
// I, U and S frames // I, U and S frames