kick

xod-dev/esp8266/kick

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
kick
OK
DEV
KICK
OKpulse
Pulses when answer received
To use the node in your project you should have the xod-dev/esp8266 library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_KICK
#pragma XOD error_raise enable

node {
    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 {
            raiseError(ctx);
        }
    }
}