Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
sol_mqtt_handlers Struct Reference

MQTT callback handlers. More...

#include <sol-mqtt.h>

Data Fields

uint16_t api_version
 Should always be set to SOL_MQTT_HANDLERS_API_VERSION. More...
 
void(* connect )(void *data, struct sol_mqtt *mqtt)
 On connect callback. More...
 
void(* disconnect )(void *data, struct sol_mqtt *mqtt)
 On disconnect callback. More...
 
void(* message )(void *data, struct sol_mqtt *mqtt, const struct sol_mqtt_message *message)
 On message callback. More...
 
void(* publish )(void *data, struct sol_mqtt *mqtt)
 On publish callback. More...
 
void(* subscribe )(void *data, struct sol_mqtt *mqtt)
 On subscribe callback. More...
 
void(* unsubscribe )(void *data, struct sol_mqtt *mqtt)
 On unsubscribe callback. More...
 

Detailed Description

MQTT callback handlers.

Field Documentation

uint16_t sol_mqtt_handlers::api_version

Should always be set to SOL_MQTT_HANDLERS_API_VERSION.

void(* sol_mqtt_handlers::connect)(void *data, struct sol_mqtt *mqtt)

On connect callback.

Parameters
dataUser provided data
mqttMQTT Object
See Also
sol_mqtt_connect

Callback called when a connect request has been processed

void(* sol_mqtt_handlers::disconnect)(void *data, struct sol_mqtt *mqtt)

On disconnect callback.

Parameters
dataUser provided data
mqttMQTT Object
See Also
sol_mqtt_connect

Callback called when the client has disconnected from the broker.

void(* sol_mqtt_handlers::message)(void *data, struct sol_mqtt *mqtt, const struct sol_mqtt_message *message)

On message callback.

Parameters
dataUser provided data
mqttMQTT Object
messageMessage received from the broker
See Also
sol_mqtt_connect

Callback called when a message is received from the broker. This does not include PING messages, only messages incoming due to publish request from other clients or the broker itself.

The memory associated to the message object will be freed after the callback returns.

void(* sol_mqtt_handlers::publish)(void *data, struct sol_mqtt *mqtt)

On publish callback.

Parameters
dataUser provided data
mqttMQTT Object
See Also
sol_mqtt_connect

Callback called when a publish request has been processed.

void(* sol_mqtt_handlers::subscribe)(void *data, struct sol_mqtt *mqtt)

On subscribe callback.

Parameters
dataUser provided data
mqttMQTT Object
See Also
sol_mqtt_connect

Callback called when a subscribe request has been processed.

void(* sol_mqtt_handlers::unsubscribe)(void *data, struct sol_mqtt *mqtt)

On unsubscribe callback.

Parameters
dataUser provided data
mqttMQTT Object
See Also
sol_mqtt_connect

Callback called when a unsubscribe request has been processed.


The documentation for this struct was generated from the following file: