110 const char *ciphers);
201 const char *mqtt_client_id,
294 void *instance,
void (*on_connect)(
void *inst,
void *obj,
int result_code));
309 void *instance,
void (*on_disconnect)(
void *inst,
void *obj,
int rc));
321 void (*on_message)(
void *inst,
void *obj,
const struct mqtt_message *msg));
uint32_t sl_status_t
Definition: sl_status.h:139
void mqtt_wrapper_message_callback_set(void *instance, void(*on_message)(void *inst, void *obj, const struct mqtt_message *msg))
Set the message callback.
sl_status_t mqtt_wrapper_publish(void *instance, int *mid, const char *topic, int payloadlen, const void *payload, int qos, bool retain)
Publish a message to a topic.
sl_status_t mqtt_wrapper_loop_write(void *instance)
Carry out write-opeartions on the network-socket connected to the MQTT-broker.
void * mqtt_wrapper_new(const char *id, bool clean_session, void *obj)
Initialize a new instance of the underlying client implementation.
int mqtt_wrapper_socket(void *instance)
Fetch the file-descriptor for the underlying network-socket.
sl_status_t mqtt_wrapper_set_will_message(void *instance, const char *mqtt_client_id, int qos)
Configures the MQTT Will message using the Client ID.
sl_status_t mqtt_wrapper_topic_matches_sub(const char *sub, const char *topic, bool *result)
Check whether a given topic matches a subscription-pattern.
sl_status_t mqtt_wrapper_tls_psk_set(void *instance, const char *psk, const char *id, const char *ciphers)
Configure the client for pre-shared-key based TLS support.
void mqtt_wrapper_connect_callback_set(void *instance, void(*on_connect)(void *inst, void *obj, int result_code))
Set the connect callback.
sl_status_t mqtt_wrapper_lib_cleanup()
Do a cleanup of the underlying client-library.
void mqtt_wrapper_disconnect_callback_set(void *instance, void(*on_disconnect)(void *inst, void *obj, int rc))
Set the disconnect callback.
sl_status_t mqtt_wrapper_lib_init()
Initialize the underlying MQTT-client library.
sl_status_t mqtt_wrapper_loop_misc(void *instance)
Carry out miscellaneous operations required as part of the nwtwork-loop (e.g. PINGs).
sl_status_t mqtt_wrapper_disconnect(void *instance)
Close the MQTT-broker connection.
void mqtt_wrapper_destroy(void *instance)
Destroy (free) a client-instance.
sl_status_t mqtt_wrapper_connect(void *instance, const char *host, int port, int keepalive)
Connect to an MQTT-broker.
sl_status_t mqtt_wrapper_loop(void *instance, int timeout)
Run an iteration of the network-loop of the underlying client-library.
sl_status_t mqtt_wrapper_subscribe(void *instance, int *mid, const char *sub, int qos)
Subscribe to a topic.
sl_status_t mqtt_wrapper_tls_set(void *instance, const char *cafile, const char *certfile, const char *keyfile)
Configure the client for Certficate based TLS support.
sl_status_t mqtt_wrapper_loop_read(void *instance)
Carry out read-operations on the network-socket connected to the MQTT-broker.
sl_status_t mqtt_wrapper_unsubscribe(void *instance, int *mid, const char *sub)
Unsubscribe from a topic.
Definition: mqtt_wrapper.h:26
const char * topic
MQTT-topic where message originated from.
Definition: mqtt_wrapper.h:28
int mid
Message-ID.
Definition: mqtt_wrapper.h:27
void * payload
Pointer to the payload.
Definition: mqtt_wrapper.h:29
int payloadlen
Size of the payload in bytes.
Definition: mqtt_wrapper.h:30
int qos
QoS value when message was published.
Definition: mqtt_wrapper.h:31
bool retain
True if this was a retained message.
Definition: mqtt_wrapper.h:32