Browse Source

Correct switch to PKT on control packet

master
US1GHQ 1 month ago
parent
commit
c0c509cabf
  1. 2
      lib/KISS_TO_TNC2/KISS.h
  2. 13
      lib/KISS_TO_TNC2/KISS_TO_TNC2.cpp

2
lib/KISS_TO_TNC2/KISS.h

@ -26,5 +26,5 @@
#define ERROR_QUEUE_FULL 0x04
//Data control frames, ported from Direwolf
#define T_PKT 0xaa
#define T_PKT 0x03
#define R_PKT 0xa6

13
lib/KISS_TO_TNC2/KISS_TO_TNC2.cpp

@ -127,13 +127,20 @@ String decode_kiss(const String &inputKISSTNCFrame, bool &dataFrame, bool &pktFr
if (validateKISSFrame(inputKISSTNCFrame)) {
dataFrame = inputKISSTNCFrame.charAt(1) == CMD_DATA;
pktFrame = inputKISSTNCFrame.charAt(2) == T_PKT;
if (dataFrame && pktFrame) {
for (int i = 0; i < inputKISSTNCFrame.length(); ++i)
{
char currentChar = inputKISSTNCFrame.charAt(i);
if (currentChar == (char) T_PKT)
{
pktFrame = true;
}
}
if (dataFrame && !pktFrame) {
String ax25Frame = decapsulateKISS(inputKISSTNCFrame);
delay(250);
TNC2Frame += ax25Frame;
}
else if (dataFrame){
else if (dataFrame && pktFrame){
String ax25Frame = decapsulateKISS(inputKISSTNCFrame);
bool isLast = false;
String dst_addr = decode_address_ax25(ax25Frame.substring(0, 7), isLast, false);

Loading…
Cancel
Save