Gateway MQTT Transport Callbacks#

These callbacks are contributed by the Gateway MQTT Transport plugin.

Functions#

void
emberAfPluginTransportMqttStateChangedCallback(EmberAfPluginTransportMqttState state)

MQTT client state is changed.

bool
emberAfPluginTransportMqttMessageArrivedCallback(const char *topic, const char *payload)

MQTT message arrived.

Function Documentation#

emberAfPluginTransportMqttStateChangedCallback#

void emberAfPluginTransportMqttStateChangedCallback (EmberAfPluginTransportMqttState state)

MQTT client state is changed.

Parameters
N/Astate

Contains the new and current EmberAfPluginTransportMqttState state.

This function is called when the state of the MQTT client changes.


Definition at line 955 of file ./app/ncp/doc/callback.doc

emberAfPluginTransportMqttMessageArrivedCallback#

bool emberAfPluginTransportMqttMessageArrivedCallback (const char * topic, const char * payload)

MQTT message arrived.

Parameters
N/Atopic

A string containing the topic for the message that arrived. While the underlying MQTT libraries allow NULL characters in a topic, NULL characters are not supported in this implementation so the topic parameter can be assumed to be NULL terminated.

N/Apayload

A string containing the payload for the message that arrived.

This function is called when the MQTT client for the gateway receives an incoming message on a topic. If the message is processed by the application, return true. If the message is not processed, return false. This function is called on a separate thread, so no stack calls should be made within the implementation of this function. Instead, use a global variable in that function to communicate the message arrival to a stack event or timer running from the main loop.


Definition at line 975 of file ./app/ncp/doc/callback.doc