open62541 1.3.12
Open source implementation of OPC UA
|
#include <mqtt_pal.h>
Go to the source code of this file.
Data Structures | |
struct | mqtt_fixed_header |
struct | mqtt_response_connack |
struct | mqtt_response_publish |
struct | mqtt_response_puback |
struct | mqtt_response_pubrec |
struct | mqtt_response_pubrel |
struct | mqtt_response_pubcomp |
struct | mqtt_response_suback |
struct | mqtt_response_unsuback |
struct | mqtt_response_pingresp |
struct | mqtt_response |
struct | mqtt_queued_message |
struct | mqtt_message_queue |
struct | mqtt_client |
Macros | |
#define | MQTT_PROTOCOL_LEVEL 0x04 |
#define | __ALL_MQTT_ERRORS(MQTT_ERROR) |
#define | GENERATE_ENUM(ENUM) ENUM, |
#define | GENERATE_STRING(STRING) #STRING, |
#define | __mqtt_packed_cstrlen(x) (2 + (unsigned int)strlen(x)) |
#define | MQTT_SUBSCRIBE_REQUEST_MAX_NUM_TOPICS 8 |
#define | MQTT_UNSUBSCRIBE_REQUEST_MAX_NUM_TOPICS 8 |
#define | mqtt_mq_get(mq_ptr, index) (((struct mqtt_queued_message*) ((mq_ptr)->mem_end)) - 1 - index) |
#define | mqtt_mq_length(mq_ptr) (((struct mqtt_queued_message*) ((mq_ptr)->mem_end)) - (mq_ptr)->queue_tail) |
#define | mqtt_mq_currsz(mq_ptr) (mq_ptr->curr >= (uint8_t*) ((mq_ptr)->queue_tail - 1)) ? 0 : ((uint8_t*) ((mq_ptr)->queue_tail - 1)) - (mq_ptr)->curr |
Enumerations | |
enum | MQTTControlPacketType |
enum | MQTTErrors |
enum | MQTTConnackReturnCode |
enum | MQTTSubackReturnCodes |
enum | MQTTConnectFlags |
enum | MQTTPublishFlags |
enum | MQTTQueuedMessageState |
Functions | |
const char * | mqtt_error_str (enum MQTTErrors error) |
ssize_t | __mqtt_pack_uint16 (uint8_t *buf, uint16_t integer) |
uint16_t | __mqtt_unpack_uint16 (const uint8_t *buf) |
ssize_t | __mqtt_pack_str (uint8_t *buf, const char *str) |
ssize_t | mqtt_unpack_fixed_header (struct mqtt_response *response, const uint8_t *buf, size_t bufsz) |
ssize_t | mqtt_unpack_connack_response (struct mqtt_response *mqtt_response, const uint8_t *buf) |
ssize_t | mqtt_unpack_publish_response (struct mqtt_response *mqtt_response, const uint8_t *buf) |
ssize_t | mqtt_unpack_pubxxx_response (struct mqtt_response *mqtt_response, const uint8_t *buf) |
ssize_t | mqtt_unpack_suback_response (struct mqtt_response *mqtt_response, const uint8_t *buf) |
ssize_t | mqtt_unpack_response (struct mqtt_response *response, const uint8_t *buf, size_t bufsz) |
ssize_t | mqtt_pack_fixed_header (uint8_t *buf, size_t bufsz, const struct mqtt_fixed_header *fixed_header) |
ssize_t | mqtt_pack_connection_request (uint8_t *buf, size_t bufsz, const char *client_id, const char *will_topic, const void *will_message, size_t will_message_size, const char *user_name, const char *password, uint8_t connect_flags, uint16_t keep_alive) |
ssize_t | mqtt_pack_publish_request (uint8_t *buf, size_t bufsz, const char *topic_name, uint16_t packet_id, const void *application_message, size_t application_message_size, uint8_t publish_flags) |
ssize_t | mqtt_pack_pubxxx_request (uint8_t *buf, size_t bufsz, enum MQTTControlPacketType control_type, uint16_t packet_id) |
ssize_t | mqtt_pack_subscribe_request (uint8_t *buf, size_t bufsz, unsigned int packet_id,...) |
ssize_t | mqtt_pack_unsubscribe_request (uint8_t *buf, size_t bufsz, unsigned int packet_id,...) |
ssize_t | mqtt_pack_ping_request (uint8_t *buf, size_t bufsz) |
ssize_t | mqtt_pack_disconnect (uint8_t *buf, size_t bufsz) |
void | mqtt_mq_init (struct mqtt_message_queue *mq, void *buf, size_t bufsz) |
void | mqtt_mq_clean (struct mqtt_message_queue *mq) |
struct mqtt_queued_message * | mqtt_mq_register (struct mqtt_message_queue *mq, size_t nbytes) |
struct mqtt_queued_message * | mqtt_mq_find (struct mqtt_message_queue *mq, enum MQTTControlPacketType control_type, uint16_t *packet_id) |
uint16_t | __mqtt_next_pid (struct mqtt_client *client) |
ssize_t | __mqtt_send (struct mqtt_client *client) |
ssize_t | __mqtt_recv (struct mqtt_client *client) |
enum MQTTErrors | mqtt_sync (struct mqtt_client *client) |
enum MQTTErrors | mqtt_init (struct mqtt_client *client, mqtt_pal_socket_handle sockfd, uint8_t *sendbuf, size_t sendbufsz, uint8_t *recvbuf, size_t recvbufsz, void(*publish_response_callback)(void **state, struct mqtt_response_publish *publish)) |
void | mqtt_init_reconnect (struct mqtt_client *client, void(*reconnect_callback)(struct mqtt_client *client, void **state), void *reconnect_state, void(*publish_response_callback)(void **state, struct mqtt_response_publish *publish)) |
void | mqtt_reinit (struct mqtt_client *client, mqtt_pal_socket_handle socketfd, uint8_t *sendbuf, size_t sendbufsz, uint8_t *recvbuf, size_t recvbufsz) |
enum MQTTErrors | mqtt_connect (struct mqtt_client *client, const char *client_id, const char *will_topic, const void *will_message, size_t will_message_size, const char *user_name, const char *password, uint8_t connect_flags, uint16_t keep_alive) |
enum MQTTErrors | mqtt_publish (struct mqtt_client *client, const char *topic_name, const void *application_message, size_t application_message_size, uint8_t publish_flags) |
ssize_t | __mqtt_puback (struct mqtt_client *client, uint16_t packet_id) |
ssize_t | __mqtt_pubrec (struct mqtt_client *client, uint16_t packet_id) |
ssize_t | __mqtt_pubrel (struct mqtt_client *client, uint16_t packet_id) |
ssize_t | __mqtt_pubcomp (struct mqtt_client *client, uint16_t packet_id) |
enum MQTTErrors | mqtt_subscribe (struct mqtt_client *client, const char *topic_name, int max_qos_level) |
enum MQTTErrors | mqtt_unsubscribe (struct mqtt_client *client, const char *topic_name) |
enum MQTTErrors | mqtt_ping (struct mqtt_client *client) |
enum MQTTErrors | __mqtt_ping (struct mqtt_client *client) |
enum MQTTErrors | mqtt_disconnect (struct mqtt_client *client) |
enum MQTTErrors | mqtt_reconnect (struct mqtt_client *client) |
#define __ALL_MQTT_ERRORS | ( | MQTT_ERROR | ) |
#define GENERATE_ENUM | ( | ENUM | ) | ENUM, |
#define __mqtt_packed_cstrlen | ( | x | ) | (2 + (unsigned int)strlen(x)) |
#define mqtt_mq_get | ( | mq_ptr, | |
index ) (((struct mqtt_queued_message*) ((mq_ptr)->mem_end)) - 1 - index) |
#define mqtt_mq_length | ( | mq_ptr | ) | (((struct mqtt_queued_message*) ((mq_ptr)->mem_end)) - (mq_ptr)->queue_tail) |
#define mqtt_mq_currsz | ( | mq_ptr | ) | (mq_ptr->curr >= (uint8_t*) ((mq_ptr)->queue_tail - 1)) ? 0 : ((uint8_t*) ((mq_ptr)->queue_tail - 1)) - (mq_ptr)->curr |
enum MQTTErrors |
enum MQTTConnectFlags |
enum MQTTPublishFlags |
const char * mqtt_error_str | ( | enum MQTTErrors | error | ) |
ssize_t __mqtt_pack_uint16 | ( | uint8_t * | buf, |
uint16_t | integer ) |
uint16_t __mqtt_unpack_uint16 | ( | const uint8_t * | buf | ) |
ssize_t __mqtt_pack_str | ( | uint8_t * | buf, |
const char * | str ) |
ssize_t mqtt_unpack_fixed_header | ( | struct mqtt_response * | response, |
const uint8_t * | buf, | ||
size_t | bufsz ) |
ssize_t mqtt_unpack_connack_response | ( | struct mqtt_response * | mqtt_response, |
const uint8_t * | buf ) |
ssize_t mqtt_unpack_publish_response | ( | struct mqtt_response * | mqtt_response, |
const uint8_t * | buf ) |
ssize_t mqtt_unpack_pubxxx_response | ( | struct mqtt_response * | mqtt_response, |
const uint8_t * | buf ) |
ssize_t mqtt_unpack_suback_response | ( | struct mqtt_response * | mqtt_response, |
const uint8_t * | buf ) |
ssize_t mqtt_unpack_response | ( | struct mqtt_response * | response, |
const uint8_t * | buf, | ||
size_t | bufsz ) |
ssize_t mqtt_pack_fixed_header | ( | uint8_t * | buf, |
size_t | bufsz, | ||
const struct mqtt_fixed_header * | fixed_header ) |
REQUESTS.
ssize_t mqtt_pack_connection_request | ( | uint8_t * | buf, |
size_t | bufsz, | ||
const char * | client_id, | ||
const char * | will_topic, | ||
const void * | will_message, | ||
size_t | will_message_size, | ||
const char * | user_name, | ||
const char * | password, | ||
uint8_t | connect_flags, | ||
uint16_t | keep_alive ) |
ssize_t mqtt_pack_publish_request | ( | uint8_t * | buf, |
size_t | bufsz, | ||
const char * | topic_name, | ||
uint16_t | packet_id, | ||
const void * | application_message, | ||
size_t | application_message_size, | ||
uint8_t | publish_flags ) |
ssize_t mqtt_pack_pubxxx_request | ( | uint8_t * | buf, |
size_t | bufsz, | ||
enum MQTTControlPacketType | control_type, | ||
uint16_t | packet_id ) |
ssize_t mqtt_pack_subscribe_request | ( | uint8_t * | buf, |
size_t | bufsz, | ||
unsigned int | packet_id, | ||
... ) |
ssize_t mqtt_pack_unsubscribe_request | ( | uint8_t * | buf, |
size_t | bufsz, | ||
unsigned int | packet_id, | ||
... ) |
ssize_t mqtt_pack_ping_request | ( | uint8_t * | buf, |
size_t | bufsz ) |
ssize_t mqtt_pack_disconnect | ( | uint8_t * | buf, |
size_t | bufsz ) |
void mqtt_mq_init | ( | struct mqtt_message_queue * | mq, |
void * | buf, | ||
size_t | bufsz ) |
void mqtt_mq_clean | ( | struct mqtt_message_queue * | mq | ) |
struct mqtt_queued_message * mqtt_mq_register | ( | struct mqtt_message_queue * | mq, |
size_t | nbytes ) |
struct mqtt_queued_message * mqtt_mq_find | ( | struct mqtt_message_queue * | mq, |
enum MQTTControlPacketType | control_type, | ||
uint16_t * | packet_id ) |
uint16_t __mqtt_next_pid | ( | struct mqtt_client * | client | ) |
ssize_t __mqtt_send | ( | struct mqtt_client * | client | ) |
ssize_t __mqtt_recv | ( | struct mqtt_client * | client | ) |
enum MQTTErrors mqtt_sync | ( | struct mqtt_client * | client | ) |
enum MQTTErrors mqtt_init | ( | struct mqtt_client * | client, |
mqtt_pal_socket_handle | sockfd, | ||
uint8_t * | sendbuf, | ||
size_t | sendbufsz, | ||
uint8_t * | recvbuf, | ||
size_t | recvbufsz, | ||
void(* | publish_response_callback )(void **state, struct mqtt_response_publish *publish) ) |
void mqtt_init_reconnect | ( | struct mqtt_client * | client, |
void(* | reconnect_callback )(struct mqtt_client *client, void **state), | ||
void * | reconnect_state, | ||
void(* | publish_response_callback )(void **state, struct mqtt_response_publish *publish) ) |
void mqtt_reinit | ( | struct mqtt_client * | client, |
mqtt_pal_socket_handle | socketfd, | ||
uint8_t * | sendbuf, | ||
size_t | sendbufsz, | ||
uint8_t * | recvbuf, | ||
size_t | recvbufsz ) |
enum MQTTErrors mqtt_connect | ( | struct mqtt_client * | client, |
const char * | client_id, | ||
const char * | will_topic, | ||
const void * | will_message, | ||
size_t | will_message_size, | ||
const char * | user_name, | ||
const char * | password, | ||
uint8_t | connect_flags, | ||
uint16_t | keep_alive ) |
enum MQTTErrors mqtt_publish | ( | struct mqtt_client * | client, |
const char * | topic_name, | ||
const void * | application_message, | ||
size_t | application_message_size, | ||
uint8_t | publish_flags ) |
todo: will_message should be a void*
ssize_t __mqtt_puback | ( | struct mqtt_client * | client, |
uint16_t | packet_id ) |
ssize_t __mqtt_pubrec | ( | struct mqtt_client * | client, |
uint16_t | packet_id ) |
ssize_t __mqtt_pubrel | ( | struct mqtt_client * | client, |
uint16_t | packet_id ) |
ssize_t __mqtt_pubcomp | ( | struct mqtt_client * | client, |
uint16_t | packet_id ) |
enum MQTTErrors mqtt_subscribe | ( | struct mqtt_client * | client, |
const char * | topic_name, | ||
int | max_qos_level ) |
enum MQTTErrors mqtt_unsubscribe | ( | struct mqtt_client * | client, |
const char * | topic_name ) |
enum MQTTErrors mqtt_ping | ( | struct mqtt_client * | client | ) |
enum MQTTErrors __mqtt_ping | ( | struct mqtt_client * | client | ) |
enum MQTTErrors mqtt_disconnect | ( | struct mqtt_client * | client | ) |
enum MQTTErrors mqtt_reconnect | ( | struct mqtt_client * | client | ) |