wxRequest Time and Status

This commit is contained in:
richonguzman 2024-05-07 19:36:58 -04:00
parent de85633024
commit 7288d286b8
5 changed files with 26 additions and 10 deletions

View File

@ -133,6 +133,8 @@ String winlinkAlias = "";
String winlinkAliasComplete = "";
bool winlinkCommentState = false;
bool wxRequestStatus = false;
uint32_t wxRequestTime = 0;
uint32_t batteryMeasurmentTime = 0;
APRSPacket lastReceivedPacket;
@ -192,7 +194,10 @@ void setup() {
void loop() {
currentBeacon = &Config.beacons[myBeaconsIndex];
if (statusState) {
Config.validateConfigFile(currentBeacon->callsign);
if (Config.validateConfigFile(currentBeacon->callsign)) {
KEYBOARD_Utils::rightArrow();
currentBeacon = &Config.beacons[myBeaconsIndex];
}
miceActive = Config.validateMicE(currentBeacon->micE);
}
STATION_Utils::checkSmartBeaconValue();

View File

@ -106,13 +106,13 @@ void Configuration::readFile(fs::FS &fs, const char *fileName) {
configFile.close();
}
void Configuration::validateConfigFile(String currentBeaconCallsign) {
bool Configuration::validateConfigFile(String currentBeaconCallsign) {
if (currentBeaconCallsign.indexOf("NOCALL") != -1) {
logger.log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, "Config", "Change all your callsigns in 'data/tracker_config.json' and upload it via 'Upload File System image'");
show_display("ERROR", "Change all callsigns!", "'tracker_config.json'", "upload it via --> ", "'Upload File System image'");
while (true) {
delay(1000);
}
show_display("ERROR", "Change callsigns!", "'tracker_config.json'", "upload it via --> ", "'Upload File System image'");
return true;
} else {
return false;
}
}

View File

@ -105,7 +105,7 @@ public:
bool disableGPS;
Configuration();
void validateConfigFile(String currentBeaconCallsign);
bool validateConfigFile(String currentBeaconCallsign);
bool validateMicE(String currentBeaconMicE);
private:

View File

@ -38,6 +38,9 @@ extern uint32_t lastTxTime;
extern uint8_t winlinkStatus;
extern bool wxRequestStatus;
extern uint32_t wxRequestTime;
extern APRSPacket lastReceivedPacket;
extern uint32_t lastMsgRxTime;
extern uint32_t lastRetryTime;
@ -235,6 +238,8 @@ namespace MSG_Utils {
show_display("<<ACK Tx>>", 500);
} else if (station.indexOf("CA2RXU-15") == 0 && textMessage.indexOf("wrl") == 0) {
show_display("<WEATHER>","", "--- Sending Query ---", 1000);
wxRequestTime = millis();
wxRequestStatus = true;
} else {
if (station == "WLNK-1") {
show_display("WINLINK Tx", "", newPacket, 1000);

View File

@ -43,6 +43,9 @@ extern bool smartBeaconValue;
extern uint8_t winlinkStatus;
extern bool winlinkCommentState;
extern bool wxRequestStatus;
extern uint32_t wxRequestTime;
String firstNearTracker;
String secondNearTracker;
String thirdNearTracker;
@ -370,10 +373,13 @@ namespace STATION_Utils {
}
void checkSmartBeaconValue() {
if (winlinkStatus != 0) {
smartBeaconValue = false;
} else {
if (wxRequestStatus && (millis() - wxRequestTime) > 20000) {
wxRequestStatus = false;
}
if(winlinkStatus == 0 && !wxRequestStatus) {
smartBeaconValue = currentBeacon->smartBeaconState;
} else {
smartBeaconValue = false;
}
}