mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-05 04:06:31 +02:00
Set offline mode incase wifi is not configuraion or configuration ignored.
This commit is contained in:
@ -238,6 +238,11 @@ void setup() {
|
||||
}
|
||||
}
|
||||
}
|
||||
/** Set offline mode without saving, cause wifi is not configured */
|
||||
if (wifiConnector.hasConfigurated() == false) {
|
||||
Serial.println("Set offline mode cause wifi is not configurated");
|
||||
configuration.setOfflineModeWithoutSave(true);
|
||||
}
|
||||
|
||||
/** Show display Warning up */
|
||||
if (ag->isOne()) {
|
||||
|
@ -345,3 +345,16 @@ int WifiConnector::RSSI(void) { return WiFi.RSSI(); }
|
||||
* @return String
|
||||
*/
|
||||
String WifiConnector::localIpStr(void) { return WiFi.localIP().toString(); }
|
||||
|
||||
/**
|
||||
* @brief Get status that wifi has configurated
|
||||
*
|
||||
* @return true Configurated
|
||||
* @return false Not Configurated
|
||||
*/
|
||||
bool WifiConnector::hasConfigurated(void) {
|
||||
if (WiFi.SSID().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ public:
|
||||
void reset(void);
|
||||
int RSSI(void);
|
||||
String localIpStr(void);
|
||||
bool hasConfigurated(void);
|
||||
};
|
||||
|
||||
#endif /** _AG_WIFI_CONNECTOR_H_ */
|
||||
|
Reference in New Issue
Block a user