Browse Source

Clean

KISS_TNC
US1GHQ 2 months ago
parent
commit
cdbff4df9f
  1. 6
      include/version.h
  2. 10
      lib/KISS_TO_TNC2/KISS_TO_PKT.cpp

6
include/version.h

@ -1,10 +1,10 @@
#ifndef BUILD_NUMBER
#define BUILD_NUMBER "86"
#define BUILD_NUMBER "104"
#endif
#ifndef VERSION
#define VERSION "v0.3.2.86-b0bdfaa - 2021-09-07 13:41:47.140024"
#define VERSION "v0.3.2.104-5990975 - 2021-09-07 15:06:42.831481"
#endif
#ifndef VERSION_SHORT
#define VERSION_SHORT "v0.3.2.86-b0bdfaa"
#define VERSION_SHORT "v0.3.2.104-5990975"
#endif

10
lib/KISS_TO_TNC2/KISS_TO_PKT.cpp

@ -42,7 +42,7 @@ String encapsulateKISS(const String &ax25Frame, uint8_t TNCCmd)
String kissFrame = "";
kissFrame += (char) FEND; // start of frame
kissFrame += (char) (0x0f & TNCCmd); // TNC0, cmd
for (int i = 0; i < ax25Frame.length(); ++i)
for (int i = 0; i < ax25Frame.length() ; ++i)
{
char currentChar = ax25Frame.charAt(i);
if (currentChar == (char) FEND)
@ -68,8 +68,6 @@ String encapsulateKISS(const String &ax25Frame, uint8_t TNCCmd)
String decapsulateKISS(const String &frame, uint8_t TNCCmd)
{
String ax25Frame = "";
ax25Frame += (char) FEND; // start of frame
ax25Frame += (char) (TNCCmd); // TNC0, cmd
for (int i = 2; i < frame.length() - 1; ++i)
{
char currentChar = frame.charAt(i);
@ -88,19 +86,19 @@ String decapsulateKISS(const String &frame, uint8_t TNCCmd)
ax25Frame += currentChar;
}
}
ax25Frame += (char) FEND; // end of frame
Serial.print(ax25Frame);
return ax25Frame;
}
//HACK for PACKEt MODE
String decode_kiss_pkt(const String &inputKISSTNCFrame, bool &dataFrame) {
String TNC2Frame = "";
dataFrame = inputKISSTNCFrame.charAt(1) == CMD_DATA;
if (validateKISSFrame(inputKISSTNCFrame)) {
dataFrame = inputKISSTNCFrame.charAt(1) == CMD_DATA;
if (dataFrame){
String ax25Frame = decapsulateKISS(inputKISSTNCFrame, CMD_DATA);
delay(250);
TNC2Frame += ax25Frame;
}
}
return TNC2Frame;
}

Loading…
Cancel
Save