set-station-mode

xod-dev/esp8266/set-station-mode

Set ESP8266 in the station mode Possible errors: — Hardware responded with an error
set-station-mode
@/set-station-mode
Set ESP8266 in the station mode Possible errors: — Hardware responded with an error
DEV@/esp8266-device
An ESP8266 internet provider device
SETpulse
Set station mode
set-station-mode
DEV
SET
DONE
DONEpulse
Pulses when station mode setted successfully
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_SET
#pragma XOD error_raise enable

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