while (server.readPOSTparam(name, NAMELEN, value, VALUELEN))
{
if (strcmp(name, "s") == 0) {
+ char str_selection[20];
+
digitalWrite(ledsArray[activeSelection], RELAY_STATE_CLOSED);
blinkingSelection = static_cast<switchSelection_t>(atoi(value));
activeSelection = static_cast<switchSelection_t>(atoi(value));
response_status = POST_OK;
+
+ #ifdef ENABLE_UDP
+ // notify over UDP
+ snprintf(str_selection, 19, "{\"active\": %d}", activeSelection);
+ #ifdef SERIAL_DEBUG
+ Serial.println(F("Sending UDP... "));
+ Serial.println(str_selection);
+ #endif
+ Udp.beginPacket(udp_remote_ip, 1312);
+ Udp.write(str_selection);
+ Udp.endPacket();
+ #endif
+
}
}
}