mqtt-connect

bradzilla84/pubsub-mqtt/mqtt-connect

No description
mqtt-connect
@/mqtt-connect
MQTT@/mqtt-device
Portnumber
CONNpulse
Establish the connection
mqtt-connect
OUT
DONE
ERR
MQTT
Port
CONN
ERRpulse
Pulses if the connection failed
DONEpulse
Pulses on a successful connection
OUT@/mqtt-device
To use the node in your project you should have the bradzilla84/pubsub-mqtt 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

// clang-format off
{{#global}}
#include <ESP8266WiFi.h>
char* topicG;
char* payloadG;
unsigned int lengthG = 0;
{{/global}}
// clang-format on

struct State {
};

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

void evaluate(Context ctx) {
    auto MQTT = getValue<input_MQTT>(ctx);
    auto state = getState(ctx);

    if (isInputDirty<input_CONN>(ctx)) {

            emitValue<output_DONE>(ctx, true);
            emitValue<output_OUT>(ctx, MQTT);

    }


}