Commit 033bdec3 authored by Eric Duminil's avatar Eric Duminil
Browse files

Callbacks

parent 2a7ecdef
......@@ -76,6 +76,22 @@ namespace web_server {
iotWebConf->setStatusPin(ONBOARD_LED_PIN, HIGH);
# endif
iotWebConf->setWifiConnectionTimeoutMs(1000UL * WIFI_TIMEOUT);
iotWebConf->setWifiConnectionCallback([]() {
led_effects::showKITTWheel(color::green);
Serial.println();
Serial.print(F("WiFi - Connected! IP address: "));
IPAddress address = WiFi.localIP();
snprintf(wifi::local_ip, sizeof(wifi::local_ip), "%d.%d.%d.%d", address[0], address[1], address[2], address[3]);
Serial.println(wifi::local_ip);
});
iotWebConf->setWifiConnectionFailedHandler([]() {
led_effects::showKITTWheel(color::red);
Serial.println(F("Connection to WiFi failed"));
return NULL;
});
iotWebConf->skipApStartup();
//TODO: Add callbacks
//TODO: Add LED effects
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment