From fe5ccbb8e04a4f6d98309726a9ddeb474259aab0 Mon Sep 17 00:00:00 2001 From: Valentin Saugnier Date: Mon, 7 Aug 2023 13:13:39 +0200 Subject: [PATCH] Bluetooth : test if payload is an APRS frame before TX --- src/bluetooth_utils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bluetooth_utils.cpp b/src/bluetooth_utils.cpp index 0e94a80..0541e94 100644 --- a/src/bluetooth_utils.cpp +++ b/src/bluetooth_utils.cpp @@ -75,11 +75,17 @@ namespace BLUETOOTH_Utils { } } - shouldSendToLoRa = !serialReceived.isEmpty(); // because we can't send data here + shouldSendToLoRa = !serialReceived.isEmpty() + // Test true APRS frame and not a NMEA (case when RX buffer overflow) + && serialReceived.indexOf(">") != -1 + && serialReceived.indexOf(":") != -1 + && serialReceived.indexOf("$G") == -1 + && serialReceived.indexOf("$B") == -1; if (shouldSendToLoRa) { logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, "bluetooth", "Data received should be transmitted to RF => %s", serialReceived.c_str()); + // because we can't send data here } }