Browse Source

Start add autoswitch from APRS and packet mode:(Not done yet)

KISS_TNC
US1GHQ 2 months ago
parent
commit
bbc20a2660
  1. 16
      src/taskTNC.cpp

16
src/taskTNC.cpp

@ -32,7 +32,7 @@ void handleKISSData(char character, int bufferIndex) {
return;
}
inTNCData->concat(character);
if (character == (char) FEND && inTNCData->length() > 3) {
if (character == (char) FEND && (char) U_SABME && inTNCData->length() > 3) {
bool isDataFrame = false;
const String &TNC2DataFrame = decode_kiss_pkt(*inTNCData, isDataFrame);
@ -45,6 +45,20 @@ void handleKISSData(char character, int bufferIndex) {
}
inTNCData->clear();
}
if (character == (char) FEND && inTNCData->length() > 3) {
bool isDataFrame = false;
const String &TNC2DataFrame = decode_kiss(*inTNCData, isDataFrame);
if (isDataFrame) {
auto *buffer = new String();
buffer->concat(TNC2DataFrame);
if (xQueueSend(tncToSendQueue, &buffer, (1000 / portTICK_PERIOD_MS)) != pdPASS) {
delete buffer;
}
}
inTNCData->clear();
}
if (inTNCData->length() > 255){
// just in case of garbage input reset data
inTNCData->clear();

Loading…
Cancel
Save