Checks that ESP8266 initialized and answers for AT commands
kick
@/kick
Checks that ESP8266 initialized and answers for AT commands
DEV@/esp8266-device
An ESP8266 device connected as internet provider
KICKpulse
Perform the check
ERRpulse
Pulses when no answer received
OKpulse
Pulses when answer received
C++ implementation
struct State {
};
// clang-format off
{{ GENERATED_CODE }}
// clang-format on
void evaluate(Context ctx) {
if (!isInputDirty<input_KICK>(ctx))
return;
auto dev = getValue<input_DEV>(ctx);
bool res = dev.wifi->kick();
if (res) {
emitValue<output_OK>(ctx, 1);
} else {
emitValue<output_ERR>(ctx, 1);
}
}