This commit is contained in:
richonguzman
2023-07-30 17:12:50 -04:00
parent ddee75e95b
commit 5ee4418d5b
4 changed files with 65 additions and 31 deletions

View File

@@ -1,9 +1,11 @@
#include <TinyGPS++.h>
#include <WiFi.h>
#include "configuration.h"
#include "gps_utils.h"
extern Configuration Config;
extern WiFi_AP *currentWiFi;
extern WiFiClient espClient;
extern int stationMode;
String distance;
@@ -78,7 +80,7 @@ String processLongitudeAPRS(double lon) {
String generateBeacon() {
String stationLatitude, stationLongitude, beaconPacket;
if (stationMode==1 || stationMode==2) {
if (stationMode==1 || stationMode==2 || (stationMode==5 && WiFi.status() == WL_CONNECTED && espClient.connected())) {
stationLatitude = processLatitudeAPRS(currentWiFi->latitude);
stationLongitude = processLongitudeAPRS(currentWiFi->longitude);
beaconPacket = Config.callsign + ">APLRG1,qAC:=" + stationLatitude + "L" + stationLongitude;