diff --git a/data/tracker_conf.json b/data/tracker_conf.json index 022183d..6a7d9d0 100644 --- a/data/tracker_conf.json +++ b/data/tracker_conf.json @@ -52,7 +52,8 @@ "rememberStationTime": 30, "standingUpdateTime": 15, "sendAltitude": true, - "disableGPS": false + "disableGPS": false, + "acceptOwnFrameFromTNC": false }, "winlink": { "password": "ABCDEF" diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 0c7e11b..864bb1d 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -180,12 +180,20 @@ void loop() { KEYBOARD_Utils::mouseRead(); #endif - MSG_Utils::checkReceivedMessage(LoRa_Utils::receivePacket()); + ReceivedLoRaPacket packet = LoRa_Utils::receivePacket(); + + MSG_Utils::checkReceivedMessage(packet); MSG_Utils::processOutputBuffer(); MSG_Utils::clean25SegBuffer(); - MSG_Utils::ledNotification(); - Utils::checkFlashlight(); - STATION_Utils::checkListenedTrackersByTimeAndDelete(); + + if (Config.bluetooth.type == 0 || Config.bluetooth.type == 2) { // always is sended to Phone + BLE_Utils::sendToPhone(packet.text.substring(3)); // does not check for 25seg buffer + } else { + #ifdef HAS_BT_CLASSIC + BLUETOOTH_Utils::sendPacket(packet.text.substring(3)); + #endif + } + if (Config.bluetooth.type == 0 || Config.bluetooth.type == 2) { BLE_Utils::sendToLoRa(); } else { @@ -193,6 +201,10 @@ void loop() { BLUETOOTH_Utils::sendToLoRa(); #endif } + MSG_Utils::ledNotification(); + Utils::checkFlashlight(); + STATION_Utils::checkListenedTrackersByTimeAndDelete(); + lastTx = millis() - lastTxTime; if (gpsIsActive) { GPS_Utils::getData(); diff --git a/src/msg_utils.cpp b/src/msg_utils.cpp index 880c635..c5c8d76 100644 --- a/src/msg_utils.cpp +++ b/src/msg_utils.cpp @@ -417,13 +417,13 @@ namespace MSG_Utils { } if (check25SegBuffer(lastReceivedPacket.sender, lastReceivedPacket.message)) { - if (Config.bluetooth.type == 0 || Config.bluetooth.type == 2) { // agregar validador si cliente BLE esta conectado? + /*if (Config.bluetooth.type == 0 || Config.bluetooth.type == 2) { // agregar validador si cliente BLE esta conectado? BLE_Utils::sendToPhone(packet.text.substring(3)); } else { #ifdef HAS_BT_CLASSIC BLUETOOTH_Utils::sendPacket(packet.text.substring(3)); #endif - } + }*/ if (digirepeaterActive && lastReceivedPacket.addressee != currentBeacon->callsign) { String digiRepeatedPacket = APRSPacketLib::generateDigiRepeatedPacket(packet.text, currentBeacon->callsign, Config.path); diff --git a/src/station_utils.cpp b/src/station_utils.cpp index 0184f0b..a01f8aa 100644 --- a/src/station_utils.cpp +++ b/src/station_utils.cpp @@ -8,6 +8,7 @@ #include "power_utils.h" #include "sleep_utils.h" #include "lora_utils.h" +#include "ble_utils.h" #include "wx_utils.h" #include "display.h" #include "logger.h" @@ -291,6 +292,10 @@ namespace STATION_Utils { displayShow("<<< TX >>>", "", packet,100); LoRa_Utils::sendNewPacket(packet); + if (Config.bluetooth.type == 0 || Config.bluetooth.type == 2) { // send Tx packets to Phone too + BLE_Utils::sendToPhone(packet); + } + if (shouldSleepLowVoltage) { delay(3000); POWER_Utils::shutdown();