forked from iarv/LoRa_APRS_iGate
update to Tnc strip bytes
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user