wxRequest Time and Status
This commit is contained in:
parent
de85633024
commit
7288d286b8
|
|
@ -133,6 +133,8 @@ String winlinkAlias = "";
|
||||||
String winlinkAliasComplete = "";
|
String winlinkAliasComplete = "";
|
||||||
bool winlinkCommentState = false;
|
bool winlinkCommentState = false;
|
||||||
|
|
||||||
|
bool wxRequestStatus = false;
|
||||||
|
uint32_t wxRequestTime = 0;
|
||||||
uint32_t batteryMeasurmentTime = 0;
|
uint32_t batteryMeasurmentTime = 0;
|
||||||
|
|
||||||
APRSPacket lastReceivedPacket;
|
APRSPacket lastReceivedPacket;
|
||||||
|
|
@ -192,7 +194,10 @@ void setup() {
|
||||||
void loop() {
|
void loop() {
|
||||||
currentBeacon = &Config.beacons[myBeaconsIndex];
|
currentBeacon = &Config.beacons[myBeaconsIndex];
|
||||||
if (statusState) {
|
if (statusState) {
|
||||||
Config.validateConfigFile(currentBeacon->callsign);
|
if (Config.validateConfigFile(currentBeacon->callsign)) {
|
||||||
|
KEYBOARD_Utils::rightArrow();
|
||||||
|
currentBeacon = &Config.beacons[myBeaconsIndex];
|
||||||
|
}
|
||||||
miceActive = Config.validateMicE(currentBeacon->micE);
|
miceActive = Config.validateMicE(currentBeacon->micE);
|
||||||
}
|
}
|
||||||
STATION_Utils::checkSmartBeaconValue();
|
STATION_Utils::checkSmartBeaconValue();
|
||||||
|
|
|
||||||
|
|
@ -106,13 +106,13 @@ void Configuration::readFile(fs::FS &fs, const char *fileName) {
|
||||||
configFile.close();
|
configFile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::validateConfigFile(String currentBeaconCallsign) {
|
bool Configuration::validateConfigFile(String currentBeaconCallsign) {
|
||||||
if (currentBeaconCallsign.indexOf("NOCALL") != -1) {
|
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'");
|
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'");
|
show_display("ERROR", "Change callsigns!", "'tracker_config.json'", "upload it via --> ", "'Upload File System image'");
|
||||||
while (true) {
|
return true;
|
||||||
delay(1000);
|
} else {
|
||||||
}
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ public:
|
||||||
bool disableGPS;
|
bool disableGPS;
|
||||||
|
|
||||||
Configuration();
|
Configuration();
|
||||||
void validateConfigFile(String currentBeaconCallsign);
|
bool validateConfigFile(String currentBeaconCallsign);
|
||||||
bool validateMicE(String currentBeaconMicE);
|
bool validateMicE(String currentBeaconMicE);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,9 @@ extern uint32_t lastTxTime;
|
||||||
|
|
||||||
extern uint8_t winlinkStatus;
|
extern uint8_t winlinkStatus;
|
||||||
|
|
||||||
|
extern bool wxRequestStatus;
|
||||||
|
extern uint32_t wxRequestTime;
|
||||||
|
|
||||||
extern APRSPacket lastReceivedPacket;
|
extern APRSPacket lastReceivedPacket;
|
||||||
extern uint32_t lastMsgRxTime;
|
extern uint32_t lastMsgRxTime;
|
||||||
extern uint32_t lastRetryTime;
|
extern uint32_t lastRetryTime;
|
||||||
|
|
@ -235,6 +238,8 @@ namespace MSG_Utils {
|
||||||
show_display("<<ACK Tx>>", 500);
|
show_display("<<ACK Tx>>", 500);
|
||||||
} else if (station.indexOf("CA2RXU-15") == 0 && textMessage.indexOf("wrl") == 0) {
|
} else if (station.indexOf("CA2RXU-15") == 0 && textMessage.indexOf("wrl") == 0) {
|
||||||
show_display("<WEATHER>","", "--- Sending Query ---", 1000);
|
show_display("<WEATHER>","", "--- Sending Query ---", 1000);
|
||||||
|
wxRequestTime = millis();
|
||||||
|
wxRequestStatus = true;
|
||||||
} else {
|
} else {
|
||||||
if (station == "WLNK-1") {
|
if (station == "WLNK-1") {
|
||||||
show_display("WINLINK Tx", "", newPacket, 1000);
|
show_display("WINLINK Tx", "", newPacket, 1000);
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,9 @@ extern bool smartBeaconValue;
|
||||||
extern uint8_t winlinkStatus;
|
extern uint8_t winlinkStatus;
|
||||||
extern bool winlinkCommentState;
|
extern bool winlinkCommentState;
|
||||||
|
|
||||||
|
extern bool wxRequestStatus;
|
||||||
|
extern uint32_t wxRequestTime;
|
||||||
|
|
||||||
String firstNearTracker;
|
String firstNearTracker;
|
||||||
String secondNearTracker;
|
String secondNearTracker;
|
||||||
String thirdNearTracker;
|
String thirdNearTracker;
|
||||||
|
|
@ -370,10 +373,13 @@ namespace STATION_Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkSmartBeaconValue() {
|
void checkSmartBeaconValue() {
|
||||||
if (winlinkStatus != 0) {
|
if (wxRequestStatus && (millis() - wxRequestTime) > 20000) {
|
||||||
smartBeaconValue = false;
|
wxRequestStatus = false;
|
||||||
} else {
|
}
|
||||||
|
if(winlinkStatus == 0 && !wxRequestStatus) {
|
||||||
smartBeaconValue = currentBeacon->smartBeaconState;
|
smartBeaconValue = currentBeacon->smartBeaconState;
|
||||||
|
} else {
|
||||||
|
smartBeaconValue = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue