set-station-mode

xod/esp8266/set-station-mode

Set ESP8266 in the station mode
set-station-mode
@/set-station-mode
Set ESP8266 in the station mode
DEV@/esp8266-device
An ESP8266 internet provider device
SETpulse
Set station mode
set-station-mode
DEV
SET
DONE
ERR
ERRpulse
Pulses if answer did not received
DONEpulse
Pulses when station mode setted successfully

C++ implementation

struct State {
};

// clang-format off
{{ GENERATED_CODE }}
// clang-format on

void evaluate(Context ctx) {
    if (!isInputDirty<input_SET>(ctx))
        return;

    auto dev = getValue<input_DEV>(ctx);
    bool done = dev.wifi->setStationMode();
    if (done) {
        emitValue<output_DONE>(ctx, 1);
    } else {
        emitValue<output_ERR>(ctx, 1);
    }
}