|
| enum | mqtt_evt_type {
MQTT_EVT_CONNACK
, MQTT_EVT_DISCONNECT
, MQTT_EVT_PUBLISH
, MQTT_EVT_PUBACK
,
MQTT_EVT_PUBREC
, MQTT_EVT_PUBREL
, MQTT_EVT_PUBCOMP
, MQTT_EVT_SUBACK
,
MQTT_EVT_UNSUBACK
, MQTT_EVT_PINGRESP
, MQTT_EVT_AUTH
} |
| | MQTT Asynchronous Events notified to the application from the module through the callback registered by the application. More...
|
| |
| enum | mqtt_version { MQTT_VERSION_3_1_0 = 3
, MQTT_VERSION_3_1_1 = 4
, MQTT_VERSION_5_0 = 5
} |
| | MQTT version protocol level. More...
|
| |
| enum | mqtt_qos { MQTT_QOS_0_AT_MOST_ONCE = 0x00
, MQTT_QOS_1_AT_LEAST_ONCE = 0x01
, MQTT_QOS_2_EXACTLY_ONCE = 0x02
} |
| | MQTT Quality of Service types. More...
|
| |
| enum | mqtt_conn_return_code {
MQTT_CONNECTION_ACCEPTED = 0x00
, MQTT_UNACCEPTABLE_PROTOCOL_VERSION = 0x01
, MQTT_IDENTIFIER_REJECTED = 0x02
, MQTT_SERVER_UNAVAILABLE = 0x03
,
MQTT_BAD_USER_NAME_OR_PASSWORD = 0x04
, MQTT_NOT_AUTHORIZED = 0x05
} |
| | MQTT 3.1 CONNACK return codes. More...
|
| |
| enum | mqtt_connack_reason_code {
MQTT_CONNACK_SUCCESS = 0
, MQTT_CONNACK_UNSPECIFIED_ERROR = 128
, MQTT_CONNACK_MALFORMED_PACKET = 129
, MQTT_CONNACK_PROTOCOL_ERROR = 130
,
MQTT_CONNACK_IMPL_SPECIFIC_ERROR = 131
, MQTT_CONNACK_UNSUPPORTED_PROTO_ERROR = 132
, MQTT_CONNACK_CLIENT_ID_NOT_VALID = 133
, MQTT_CONNACK_BAD_USERNAME_OR_PASS = 134
,
MQTT_CONNACK_NOT_AUTHORIZED = 135
, MQTT_CONNACK_SERVER_UNAVAILABLE = 136
, MQTT_CONNACK_SERVER_BUSY = 137
, MQTT_CONNACK_BANNED = 138
,
MQTT_CONNACK_BAD_AUTH_METHOD = 140
, MQTT_CONNACK_TOPIC_NAME_INVALID = 144
, MQTT_CONNACK_PACKET_TOO_LARGE = 149
, MQTT_CONNACK_QUOTA_EXCEEDED = 151
,
MQTT_CONNACK_PAYLOAD_FORMAT_INVALID = 153
, MQTT_CONNACK_RETAIN_NOT_SUPPORTED = 154
, MQTT_CONNACK_QOS_NOT_SUPPORTED = 155
, MQTT_CONNACK_USE_ANOTHER_SERVER = 156
,
MQTT_CONNACK_SERVER_MOVED = 157
, MQTT_CONNACK_CONNECTION_RATE_EXCEEDED = 159
} |
| | MQTT 5.0 CONNACK reason codes (MQTT 5.0, chapter 3.2.2.2). More...
|
| |
| enum | mqtt_suback_return_code { MQTT_SUBACK_SUCCESS_QoS_0 = 0x00
, MQTT_SUBACK_SUCCESS_QoS_1 = 0x01
, MQTT_SUBACK_SUCCESS_QoS_2 = 0x02
, MQTT_SUBACK_FAILURE = 0x80
} |
| | MQTT SUBACK return codes. More...
|
| |
| enum | mqtt_disconnect_reason_code {
MQTT_DISCONNECT_NORMAL = 0
, MQTT_DISCONNECT_WITH_WILL_MSG = 4
, MQTT_DISCONNECT_UNSPECIFIED_ERROR = 128
, MQTT_DISCONNECT_MALFORMED_PACKET = 129
,
MQTT_DISCONNECT_PROTOCOL_ERROR = 130
, MQTT_DISCONNECT_IMPL_SPECIFIC_ERROR = 131
, MQTT_DISCONNECT_NOT_AUTHORIZED = 135
, MQTT_DISCONNECT_SERVER_BUSY = 137
,
MQTT_DISCONNECT_SERVER_SHUTTING_DOWN = 139
, MQTT_DISCONNECT_KEEP_ALIVE_TIMEOUT = 141
, MQTT_DISCONNECT_SESSION_TAKE_OVER = 142
, MQTT_DISCONNECT_TOPIC_FILTER_INVALID = 143
,
MQTT_DISCONNECT_TOPIC_NAME_INVALID = 144
, MQTT_DISCONNECT_RECV_MAX_EXCEEDED = 147
, MQTT_DISCONNECT_TOPIC_ALIAS_INVALID = 148
, MQTT_DISCONNECT_PACKET_TOO_LARGE = 149
,
MQTT_DISCONNECT_MESSAGE_RATE_TOO_HIGH = 150
, MQTT_DISCONNECT_QUOTA_EXCEEDED = 151
, MQTT_DISCONNECT_ADMIN_ACTION = 152
, MQTT_DISCONNECT_PAYLOAD_FORMAT_INVALID = 153
,
MQTT_DISCONNECT_RETAIN_NOT_SUPPORTED = 154
, MQTT_DISCONNECT_QOS_NOT_SUPPORTED = 155
, MQTT_DISCONNECT_USE_ANOTHER_SERVER = 156
, MQTT_DISCONNECT_SERVER_MOVED = 157
,
MQTT_DISCONNECT_SHARED_SUB_NOT_SUPPORTED = 158
, MQTT_DISCONNECT_CONNECTION_RATE_EXCEEDED = 159
, MQTT_DISCONNECT_MAX_CONNECT_TIME = 160
, MQTT_DISCONNECT_SUB_ID_NOT_SUPPORTED = 161
,
MQTT_DISCONNECT_WILDCARD_SUB_NOT_SUPPORTED = 162
} |
| | MQTT Disconnect reason codes (MQTT 5.0, chapter 3.14.2.1). More...
|
| |
| enum | mqtt_auth_reason_code { MQTT_AUTH_SUCCESS = 0
, MQTT_AUTH_CONTINUE_AUTHENTICATION = 24
, MQTT_AUTH_RE_AUTHENTICATE = 25
} |
| | MQTT Authenticate reason codes (MQTT 5.0, chapter 3.15.2.1). More...
|
| |
| enum | mqtt_transport_type { MQTT_TRANSPORT_NON_SECURE
, MQTT_TRANSPORT_NUM
} |
| | MQTT transport type. More...
|
| |
|
| void | mqtt_client_init (struct mqtt_client *client) |
| | Initializes the client instance.
|
| |
| int | mqtt_connect (struct mqtt_client *client) |
| | API to request new MQTT client connection.
|
| |
| int | mqtt_publish (struct mqtt_client *client, const struct mqtt_publish_param *param) |
| | API to publish messages on topics.
|
| |
| int | mqtt_publish_qos1_ack (struct mqtt_client *client, const struct mqtt_puback_param *param) |
| | API used by client to send acknowledgment on receiving QoS1 publish message.
|
| |
| int | mqtt_publish_qos2_receive (struct mqtt_client *client, const struct mqtt_pubrec_param *param) |
| | API used by client to send acknowledgment on receiving QoS2 publish message.
|
| |
| int | mqtt_publish_qos2_release (struct mqtt_client *client, const struct mqtt_pubrel_param *param) |
| | API used by client to request release of QoS2 publish message.
|
| |
| int | mqtt_publish_qos2_complete (struct mqtt_client *client, const struct mqtt_pubcomp_param *param) |
| | API used by client to send acknowledgment on receiving QoS2 publish release message.
|
| |
| int | mqtt_subscribe (struct mqtt_client *client, const struct mqtt_subscription_list *param) |
| | API to request subscription of one or more topics on the connection.
|
| |
| int | mqtt_unsubscribe (struct mqtt_client *client, const struct mqtt_subscription_list *param) |
| | API to request unsubscription of one or more topics on the connection.
|
| |
| int | mqtt_ping (struct mqtt_client *client) |
| | API to send MQTT ping.
|
| |
| int | mqtt_disconnect (struct mqtt_client *client, const struct mqtt_disconnect_param *param) |
| | API to disconnect MQTT connection.
|
| |
| int | mqtt_auth (struct mqtt_client *client, const struct mqtt_auth_param *param) |
| | API to send an authentication packet to the server.
|
| |
| int | mqtt_abort (struct mqtt_client *client) |
| | API to abort MQTT connection.
|
| |
| int | mqtt_live (struct mqtt_client *client) |
| | This API should be called periodically for the client to be able to keep the connection alive by sending Ping Requests if need be.
|
| |
| int | mqtt_keepalive_time_left (const struct mqtt_client *client) |
| | Helper function to determine when next keep alive message should be sent.
|
| |
| int | mqtt_input (struct mqtt_client *client) |
| | Receive an incoming MQTT packet.
|
| |
| int | mqtt_read_publish_payload (struct mqtt_client *client, void *buffer, size_t length) |
| | Read the payload of the received PUBLISH message.
|
| |
| int | mqtt_read_publish_payload_blocking (struct mqtt_client *client, void *buffer, size_t length) |
| | Blocking version of mqtt_read_publish_payload function.
|
| |
| int | mqtt_readall_publish_payload (struct mqtt_client *client, uint8_t *buffer, size_t length) |
| | Blocking version of mqtt_read_publish_payload function which runs until the required number of bytes are read.
|
| |
MQTT Client Implementation.
- Note
- The implementation assumes TCP module is enabled.
-
By default the implementation uses MQTT version 3.1.1.