Browse Source

Update, need fix CRC checksum on B2 Mode (winlink)

KISS_TNC
US1GHQ 2 months ago
parent
commit
0b37f355c2
  1. 6
      include/version.h
  2. 20
      lib/KISS_TO_TNC2/KISS_TO_PKT.cpp
  3. 2
      lib/KISS_TO_TNC2/KISS_TO_PKT.h
  4. 18
      platformio.ini

6
include/version.h

@ -1,10 +1,10 @@
#ifndef BUILD_NUMBER
#define BUILD_NUMBER "104"
#define BUILD_NUMBER "6"
#endif
#ifndef VERSION
#define VERSION "v0.3.2.104-5990975 - 2021-09-07 15:06:42.831481"
#define VERSION "v0.3.2.6-cdbff4d - 2021-09-09 10:10:57.865053"
#endif
#ifndef VERSION_SHORT
#define VERSION_SHORT "v0.3.2.104-5990975"
#define VERSION_SHORT "v0.3.2.6-cdbff4d"
#endif

20
lib/KISS_TO_TNC2/KISS_TO_PKT.cpp

@ -1,8 +1,8 @@
#include "KISS_TO_PKT.h"
bool validateTNC2Frame(const String &tnc2FormattedFrame);
bool validateKISSFrame(const String &kissFormattedFrame);
String decapsulateKISS(const String &frame);
bool validateTNC2Frame_pkt(const String &tnc2FormattedFrame);
bool validateKISSFrame_pkt(const String &kissFormattedFrame);
String decapsulateKISS_pkt(const String &frame);
/*
* https://ham.zmailer.org/oh2mqk/aprx/PROTOCOLS
@ -32,12 +32,12 @@ String decapsulateKISS(const String &frame);
String encode_kiss_pkt(const String &tnc2FormattedFrame)
{
String TNC2Frame = "";
String ax25Frame = encapsulateKISS(tnc2FormattedFrame, CMD_DATA);
String ax25Frame = encapsulateKISS_pkt(tnc2FormattedFrame, CMD_DATA);
TNC2Frame += ax25Frame;
return TNC2Frame;
}
String encapsulateKISS(const String &ax25Frame, uint8_t TNCCmd)
String encapsulateKISS_pkt(const String &ax25Frame, uint8_t TNCCmd)
{
String kissFrame = "";
kissFrame += (char) FEND; // start of frame
@ -65,7 +65,7 @@ String encapsulateKISS(const String &ax25Frame, uint8_t TNCCmd)
}
String decapsulateKISS(const String &frame, uint8_t TNCCmd)
String decapsulateKISS_pkt(const String &frame, uint8_t TNCCmd)
{
String ax25Frame = "";
for (int i = 2; i < frame.length() - 1; ++i)
@ -92,10 +92,10 @@ String decapsulateKISS(const String &frame, uint8_t TNCCmd)
//HACK for PACKEt MODE
String decode_kiss_pkt(const String &inputKISSTNCFrame, bool &dataFrame) {
String TNC2Frame = "";
if (validateKISSFrame(inputKISSTNCFrame)) {
if (validateKISSFrame_pkt(inputKISSTNCFrame)) {
dataFrame = inputKISSTNCFrame.charAt(1) == CMD_DATA;
if (dataFrame){
String ax25Frame = decapsulateKISS(inputKISSTNCFrame, CMD_DATA);
String ax25Frame = decapsulateKISS_pkt(inputKISSTNCFrame, CMD_DATA);
delay(250);
TNC2Frame += ax25Frame;
}
@ -103,12 +103,12 @@ String decode_kiss_pkt(const String &inputKISSTNCFrame, bool &dataFrame) {
return TNC2Frame;
}
bool validateTNC2Frame(const String &tnc2FormattedFrame) {
bool validateTNC2Frame_pkt(const String &tnc2FormattedFrame) {
return (tnc2FormattedFrame.indexOf(':') != -1) &&
(tnc2FormattedFrame.indexOf('>') != -1);
}
bool validateKISSFrame(const String &kissFormattedFrame) {
bool validateKISSFrame_pkt(const String &kissFormattedFrame) {
return kissFormattedFrame.charAt(0) == (char) FEND &&
kissFormattedFrame.charAt(kissFormattedFrame.length() - 1) == (char) FEND;
}

2
lib/KISS_TO_TNC2/KISS_TO_PKT.h

@ -29,4 +29,4 @@
String encode_kiss_pkt(const String& tnc2FormattedFrame);
String decode_kiss_pkt(const String &inputKISSTNCFrame, bool &dataFrame);
String encapsulateKISS(const String &ax25Frame, uint8_t TNCCmd);
String encapsulateKISS_pkt(const String &ax25Frame, uint8_t TNCCmd);

18
platformio.ini

@ -20,7 +20,7 @@ extra_scripts =
pre:tools/buildscript_versioning.py
pre:tools/compress_assets.py
lib_deps =
RadioHead
http://git.mis.ks.ua/US1GHQ/RadioHead.git
TinyGPSPlus
Adafruit SSD1306
Adafruit GFX Library
@ -60,7 +60,7 @@ build_flags =
; -D 'HEIGTH_PRESET=34'
[env:ttgo-t-beam-v1.0]
platform = espressif32 @ 3.3.1
platform = espressif32 @ 3.3.2
board = ttgo-t-beam
build_flags =
${env.build_flags}
@ -69,7 +69,7 @@ build_flags =
; -D ENABLE_BLUETOOTH
[env:ttgo-t-beam-v0.7]
platform = espressif32 @ 3.3.1
platform = espressif32 @ 3.3.2
board = ttgo-t-beam
build_flags =
${env.build_flags}
@ -78,7 +78,7 @@ build_flags =
-D T_BEAM_V0_7
[env:ttgo-lora32-v2.1]
platform = espressif32 @ 3.3.1
platform = espressif32 @ 3.3.2
board = ttgo-lora32-v21
build_flags =
${env.build_flags}
@ -87,7 +87,7 @@ build_flags =
-D LORA32_21
[env:ttgo-lora32-v2]
platform = espressif32 @ 3.3.1
platform = espressif32 @ 3.3.2
board = ttgo-lora32-v2
build_flags =
${env.build_flags}
@ -96,7 +96,7 @@ build_flags =
-D LORA32_2
[env:ttgo-lora32-v1]
platform = espressif32 @ 3.3.1
platform = espressif32 @ 3.3.2
board = ttgo-lora32-v1
build_flags =
${env.build_flags}
@ -105,7 +105,7 @@ build_flags =
-D LORA32_1
[env:Heltec-WiFi-v1]
platform = espressif32 @ 3.3.1
platform = espressif32 @ 3.3.2
board = heltec_wifi_kit_32
build_flags =
${env.build_flags}
@ -114,7 +114,7 @@ build_flags =
-D HELTEC_V1
[env:Heltec-WiFi-v2]
platform = espressif32 @ 3.3.1
platform = espressif32 @ 3.3.2
board = heltec_wifi_kit_32_v2
board_build.f_cpu = 80000000L
build_flags =
@ -124,7 +124,7 @@ build_flags =
-D HELTEC_V2
[env:Esp32-Dev-v1]
platform = espressif32 @ 3.3.1
platform = espressif32 @ 3.3.2
board = esp32dev
; change MCU frequency
;board_build.f_cpu = 80000000L

Loading…
Cancel
Save