update to Tnc strip bytes

This commit is contained in:
richonguzman
2025-10-15 17:12:38 -03:00
parent a618383617
commit 75337d6c29
4 changed files with 10 additions and 9 deletions

View File

@@ -27,8 +27,8 @@ namespace TNC_Utils {
void setup();
void loop();
void sendToClients(const String& packet);
void sendToSerial(const String& packet);
void sendToClients(const String& packet, bool stripBytes = false);
void sendToSerial(const String& packet, bool stripBytes = false);
}

View File

@@ -192,9 +192,9 @@ void loop() {
DIGI_Utils::processLoRaPacket(packet); // Send received packet to Digi
}
if (Config.tnc.enableServer) TNC_Utils::sendToClients(packet); // Send received packet to TNC KISS
if (Config.tnc.enableSerial) TNC_Utils::sendToSerial(packet); // Send received packet to Serial KISS
if (Config.mqtt.active) MQTT_Utils::sendToMqtt(packet); // Send received packet to MQTT
if (Config.tnc.enableServer) TNC_Utils::sendToClients(packet, true); // Send received packet to TNC KISS
if (Config.tnc.enableSerial) TNC_Utils::sendToSerial(packet, true); // Send received packet to Serial KISS
if (Config.mqtt.active) MQTT_Utils::sendToMqtt(packet); // Send received packet to MQTT
}
if (Config.aprs_is.active) APRS_IS_Utils::listenAPRSIS(); // listen received packet from APRSIS

View File

@@ -96,6 +96,7 @@ void displaySetup() {
#ifdef HAS_EPAPER
display.landscape();
display.printCenter("LoRa APRS iGate Initialising...");
if (Config.display.turn180) display.setRotation(2);
display.update();
#else
#ifdef OLED_DISPLAY_HAS_RST_PIN

View File

@@ -135,8 +135,8 @@ namespace TNC_Utils {
}
}
void sendToClients(const String& packet) {
String cleanPacket = packet.substring(3);
void sendToClients(const String& packet, bool stripBytes) {
String cleanPacket = stripBytes ? packet.substring(3): packet;
const String kissEncoded = encodeKISS(cleanPacket);
@@ -156,8 +156,8 @@ namespace TNC_Utils {
Utils::println(cleanPacket);
}
void sendToSerial(const String& packet) {
String cleanPacket = packet.substring(3);
void sendToSerial(const String& packet, bool stripBytes) {
String cleanPacket = stripBytes ? packet.substring(3): packet;
Serial.print(encodeKISS(cleanPacket));
Serial.flush();
}