always send to phone LoRa Tx and Rx packets

This commit is contained in:
richonguzman 2024-10-30 10:17:08 -03:00
parent 91672b8875
commit 28b6a827cd
4 changed files with 25 additions and 7 deletions

View File

@ -52,7 +52,8 @@
"rememberStationTime": 30,
"standingUpdateTime": 15,
"sendAltitude": true,
"disableGPS": false
"disableGPS": false,
"acceptOwnFrameFromTNC": false
},
"winlink": {
"password": "ABCDEF"

View File

@ -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();

View File

@ -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);

View File

@ -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();