This commit is contained in:
richonguzman 2023-06-24 12:28:24 -04:00
parent fdb4a069a3
commit d907bbd587
3 changed files with 13 additions and 4 deletions

View File

@ -113,10 +113,7 @@ void loop() {
if (!send_update) {
GPS_Utils::calculateHeadingDelta(currentSpeed);
}
if (!send_update && lastTx >= Config.standingUpdateTime*60*1000) {
send_update = true;
sendStandingUpdate = true;
}
STATION_Utils::checkStandingUpdateTime();
}
STATION_Utils::checkSmartBeaconState();

View File

@ -16,8 +16,12 @@ extern String fourthNearTracker;
extern uint32_t lastDeleteListenedTracker;
extern uint32_t lastTxTime;
extern bool send_update;
extern bool sendStandingUpdate;
extern uint32_t txInterval;
extern uint32_t lastTx;
namespace STATION_Utils {
@ -341,6 +345,13 @@ void checkSmartBeaconInterval(int speed) {
}
}
void checkStandingUpdateTime() {
if (!send_update && lastTx >= Config.standingUpdateTime*60*1000) {
send_update = true;
sendStandingUpdate = true;
}
}
void checkSmartBeaconState() {
if (!currentBeacon->smartBeaconState) {
uint32_t lastTxSmartBeacon = millis() - lastTxTime;

View File

@ -14,6 +14,7 @@ void deleteListenedTrackersbyTime();
void checkListenedTrackersByTimeAndDelete();
void orderListenedTrackersByDistance(String callsign, float distance, float course);
void checkSmartBeaconInterval(int speed);
void checkStandingUpdateTime();
void checkSmartBeaconState();
}