Change RX method for autoswitch

master
US1GHQ 2021-09-15 23:34:56 +03:00
parent dd653c75dc
commit e5a30a0687
3 changed files with 10 additions and 17 deletions

View File

@ -1,10 +1,10 @@
#ifndef BUILD_NUMBER #ifndef BUILD_NUMBER
#define BUILD_NUMBER "191" #define BUILD_NUMBER "201"
#endif #endif
#ifndef VERSION #ifndef VERSION
#define VERSION "v0.4.2.191- - 2021-09-15 22:11:52.858358" #define VERSION "v0.4.2.201- - 2021-09-15 23:28:59.739585"
#endif #endif
#ifndef VERSION_SHORT #ifndef VERSION_SHORT
#define VERSION_SHORT "v0.4.2.191-" #define VERSION_SHORT "v0.4.2.201-"
#endif #endif

View File

@ -39,19 +39,12 @@ String encode_kiss(const String &tnc2FormattedFrame, bool &pktFrame) {
String ax25Frame = ""; String ax25Frame = "";
if (validateTNC2Frame(tnc2FormattedFrame)) { if (validateTNC2Frame(tnc2FormattedFrame)) {
for (int p = 0; p <= tnc2FormattedFrame.indexOf(':'); p++) for (int p = 0; p <= tnc2FormattedFrame.indexOf("WIDE"); p++) { pktFrame = true;}
{ for (int p = 0; p <= tnc2FormattedFrame.indexOf("ECHO"); p++) { pktFrame = true;}
char currentChar = tnc2FormattedFrame.charAt(p); for (int p = 0; p <= tnc2FormattedFrame.indexOf("TRACE"); p++) { pktFrame = true;}
if (currentChar == ':' || currentChar == '>' || currentChar == ',') { for (int p = 0; p <= tnc2FormattedFrame.indexOf("RELAY"); p++) { pktFrame = true;}
if (!pktFrame && (currentChar == ',' || currentChar == ':')) for (int p = 0; p <= tnc2FormattedFrame.indexOf("APRS"); p++) { pktFrame = true;}
{ if (pktFrame) {
pktFrame = true;
}
}
}
}
if (pktFrame) {
if (validateTNC2Frame(tnc2FormattedFrame)) {
String address = ""; String address = "";
bool dst_addres_written = false; bool dst_addres_written = false;
for (int p = 0; p <= tnc2FormattedFrame.indexOf(':'); p++) { for (int p = 0; p <= tnc2FormattedFrame.indexOf(':'); p++) {

View File

@ -94,7 +94,7 @@ void handleKISSData(char character, int bufferIndex) {
if (xQueueReceive(tncReceivedQueue, &loraReceivedFrameString, (1 / portTICK_PERIOD_MS)) == pdPASS) { if (xQueueReceive(tncReceivedQueue, &loraReceivedFrameString, (1 / portTICK_PERIOD_MS)) == pdPASS) {
bool isPacketFrame = false; bool isPacketFrame = false;
const String &kissEncoded = encode_kiss(*loraReceivedFrameString, isPacketFrame); const String &kissEncoded = encode_kiss(*loraReceivedFrameString, isPacketFrame);
Serial.print(kissEncoded); // Serial.print(kissEncoded);
#ifdef ENABLE_BLUETOOTH #ifdef ENABLE_BLUETOOTH
if (SerialBT.hasClient()){ if (SerialBT.hasClient()){
SerialBT.print(kissEncoded); SerialBT.print(kissEncoded);