Contiki-NG
Loading...
Searching...
No Matches

Header file for the Contiki MQTT engine. More...

#include "contiki.h"
#include "contiki-net.h"
#include "contiki-lib.h"
#include "lib/random.h"
#include "sys/ctimer.h"
#include "sys/etimer.h"
#include "net/ipv6/uip.h"
#include "net/ipv6/uip-ds6.h"
#include "dev/leds.h"
#include "tcp-socket.h"
#include "udp-socket.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Typedefs

typedef void(* mqtt_event_callback_t) (struct mqtt_connection *m, mqtt_event_t event, void *data)
 MQTT event callback function.
 

Enumerations

enum  mqtt_event_t
 MQTT engine events.
 

Functions

mqtt_status_t mqtt_register (struct mqtt_connection *conn, struct process *app_process, char *client_id, mqtt_event_callback_t event_callback, uint16_t max_segment_size)
 Initializes the MQTT engine.
 
mqtt_status_t mqtt_connect (struct mqtt_connection *conn, char *host, uint16_t port, uint16_t keep_alive, uint8_t clean_session, struct mqtt_prop_list *prop_list)
 Connects to a MQTT broker.
 
void mqtt_disconnect (struct mqtt_connection *conn, struct mqtt_prop_list *prop_list)
 Disconnects from a MQTT broker.
 
mqtt_status_t mqtt_subscribe (struct mqtt_connection *conn, uint16_t *mid, char *topic, mqtt_qos_level_t qos_level, mqtt_nl_en_t nl, mqtt_rap_en_t rap, mqtt_retain_handling_t ret_handling, struct mqtt_prop_list *prop_list)
 Subscribes to a MQTT topic.
 
mqtt_status_t mqtt_unsubscribe (struct mqtt_connection *conn, uint16_t *mid, char *topic, struct mqtt_prop_list *prop_list)
 Unsubscribes from a MQTT topic.
 
mqtt_status_t mqtt_publish (struct mqtt_connection *conn, uint16_t *mid, char *topic, uint8_t *payload, uint32_t payload_size, mqtt_qos_level_t qos_level, mqtt_retain_t retain, uint8_t topic_alias, mqtt_topic_alias_en_t topic_alias_en, struct mqtt_prop_list *prop_list)
 Publish to a MQTT topic.
 
void mqtt_set_username_password (struct mqtt_connection *conn, char *username, char *password)
 Set the user name and password for a MQTT client.
 
void mqtt_set_last_will (struct mqtt_connection *conn, char *topic, char *message, mqtt_qos_level_t qos, struct mqtt_prop_list *will_props)
 Set the last will topic and message for a MQTT client.
 
mqtt_status_t mqtt_auth (struct mqtt_connection *conn, mqtt_auth_type_t auth_type, struct mqtt_prop_list *prop_list)
 Send authentication message (MQTTv5-only).
 

Detailed Description

Header file for the Contiki MQTT engine.

Author
Texas Instruments

Definition in file mqtt.h.