22#ifndef ZEPHYR_INCLUDE_NET_MQTT_H_
23#define ZEPHYR_INCLUDE_NET_MQTT_H_
83#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
115#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
257#define MQTT_UTF8_LITERAL(literal) \
258 ((struct mqtt_utf8) {literal, sizeof(literal) - 1})
268#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
274#elif defined(CONFIG_CPP)
291#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
329#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
425#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
439#elif defined(CONFIG_CPP)
450#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
464#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
478#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
492#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
513#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
524#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
553#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
614#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
630#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
660#elif defined(CONFIG_CPP)
668#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
697#elif defined(CONFIG_CPP)
737#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
792#if defined(CONFIG_MQTT_LIB_TLS_USE_ALPN)
797 const char **alpn_protocol_name_list;
820#if defined(CONFIG_MQTT_LIB_TLS)
822 MQTT_TRANSPORT_SECURE,
825#if defined(CONFIG_MQTT_LIB_WEBSOCKET)
827 MQTT_TRANSPORT_NON_SECURE_WEBSOCKET,
828#if defined(CONFIG_MQTT_LIB_TLS)
830 MQTT_TRANSPORT_SECURE_WEBSOCKET,
833#if defined(CONFIG_MQTT_LIB_CUSTOM_TRANSPORT)
835 MQTT_TRANSPORT_CUSTOM,
865#if defined(CONFIG_MQTT_LIB_TLS)
879#if defined(CONFIG_MQTT_LIB_WEBSOCKET)
883 struct websocket_request config;
893#if defined(CONFIG_MQTT_LIB_CUSTOM_TRANSPORT)
895 void *custom_transport_data;
898#if defined(CONFIG_SOCKS)
903 struct net_sockaddr_storage addr_storage;
906 struct net_sockaddr addr;
933#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
972#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
1033#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
1086#if defined(CONFIG_SOCKS)
1099int mqtt_client_set_proxy(
struct mqtt_client *client,
1243#if defined(CONFIG_MQTT_VERSION_5_0) || defined(__DOXYGEN__)
uint32_t net_socklen_t
Length of a socket address.
Definition net_ip.h:172
mqtt_evt_type
MQTT Asynchronous Events notified to the application from the module through the callback registered ...
Definition mqtt.h:42
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_disconnect(struct mqtt_client *client, const struct mqtt_disconnect_param *param)
API to disconnect MQTT connection.
mqtt_retain_handling
MQTT v5.0 Retain Handling options.
Definition mqtt.h:117
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_input(struct mqtt_client *client)
Receive an incoming MQTT packet.
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 ...
int mqtt_read_publish_payload(struct mqtt_client *client, void *buffer, size_t length)
Read the payload of the received PUBLISH message.
mqtt_qos
MQTT Quality of Service types.
Definition mqtt.h:97
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_publish(struct mqtt_client *client, const struct mqtt_publish_param *param)
API to publish messages on topics.
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_live(struct mqtt_client *client)
This API should be called periodically for the client to be able to keep the connection alive by send...
mqtt_version
MQTT version protocol level.
Definition mqtt.h:90
int mqtt_keepalive_time_left(const struct mqtt_client *client)
Helper function to determine when next keep alive message should be sent.
mqtt_conn_return_code
MQTT 3.1 CONNACK return codes.
Definition mqtt.h:135
mqtt_disconnect_reason_code
MQTT Disconnect reason codes (MQTT 5.0, chapter 3.14.2.1).
Definition mqtt.h:203
void(* mqtt_evt_cb_t)(struct mqtt_client *client, const struct mqtt_evt *evt)
Asynchronous event notification callback registered by the application.
Definition mqtt.h:770
mqtt_suback_return_code
MQTT SUBACK return codes.
Definition mqtt.h:188
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.
mqtt_auth_reason_code
MQTT Authenticate reason codes (MQTT 5.0, chapter 3.15.2.1).
Definition mqtt.h:236
void mqtt_client_init(struct mqtt_client *client)
Initializes the client instance.
int mqtt_ping(struct mqtt_client *client)
API to send MQTT ping.
int mqtt_auth(struct mqtt_client *client, const struct mqtt_auth_param *param)
API to send an authentication packet to the server.
int mqtt_connect(struct mqtt_client *client)
API to request new MQTT client connection.
mqtt_connack_reason_code
MQTT 5.0 CONNACK reason codes (MQTT 5.0, chapter 3.2.2.2).
Definition mqtt.h:162
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_abort(struct mqtt_client *client)
API to abort MQTT connection.
mqtt_transport_type
MQTT transport type.
Definition mqtt.h:816
@ MQTT_EVT_PUBREC
Reception confirmation for published message with QoS 2.
Definition mqtt.h:66
@ MQTT_EVT_PUBACK
Acknowledgment for published message with QoS 1.
Definition mqtt.h:63
@ MQTT_EVT_AUTH
Authentication packet received from server.
Definition mqtt.h:85
@ MQTT_EVT_PINGRESP
Ping Response from server.
Definition mqtt.h:81
@ MQTT_EVT_SUBACK
Acknowledgment to a subscribe request.
Definition mqtt.h:75
@ MQTT_EVT_DISCONNECT
Disconnection Event.
Definition mqtt.h:51
@ MQTT_EVT_UNSUBACK
Acknowledgment to a unsubscribe request.
Definition mqtt.h:78
@ MQTT_EVT_PUBLISH
Publish event received when message is published on a topic client is subscribed to.
Definition mqtt.h:60
@ MQTT_EVT_PUBREL
Release of published message with QoS 2.
Definition mqtt.h:69
@ MQTT_EVT_CONNACK
Acknowledgment of connection request.
Definition mqtt.h:46
@ MQTT_EVT_PUBCOMP
Confirmation to a publish release message with QoS 2.
Definition mqtt.h:72
@ MQTT_RH_2_DO_NOT_SEND
Do not send retained messages at the time of the subscribe.
Definition mqtt.h:130
@ MQTT_RH_1_SEND_IF_NEW
If the subscription did not already exist, send all retained message matching the Topic Filter of the...
Definition mqtt.h:127
@ MQTT_RH_0_SEND_AT_SUBSCRIBE
Send the retained messages matching the Topic Filter of the subscription to the Client at the time of...
Definition mqtt.h:121
@ MQTT_QOS_0_AT_MOST_ONCE
Lowest Quality of Service, no acknowledgment needed for published message.
Definition mqtt.h:101
@ MQTT_QOS_1_AT_LEAST_ONCE
Medium Quality of Service, if acknowledgment expected for published message, duplicate messages permi...
Definition mqtt.h:106
@ MQTT_QOS_2_EXACTLY_ONCE
Highest Quality of Service, acknowledgment expected and message shall be published only once.
Definition mqtt.h:112
@ MQTT_VERSION_5_0
Protocol level for 5.0.
Definition mqtt.h:93
@ MQTT_VERSION_3_1_0
Protocol level for 3.1.0.
Definition mqtt.h:91
@ MQTT_VERSION_3_1_1
Protocol level for 3.1.1.
Definition mqtt.h:92
@ MQTT_CONNECTION_ACCEPTED
Connection accepted.
Definition mqtt.h:137
@ MQTT_NOT_AUTHORIZED
The Client is not authorized to connect.
Definition mqtt.h:158
@ MQTT_UNACCEPTABLE_PROTOCOL_VERSION
The Server does not support the level of the MQTT protocol requested by the Client.
Definition mqtt.h:142
@ MQTT_BAD_USER_NAME_OR_PASSWORD
The data in the user name or password is malformed.
Definition mqtt.h:155
@ MQTT_IDENTIFIER_REJECTED
The Client identifier is correct UTF-8 but not allowed by the Server.
Definition mqtt.h:147
@ MQTT_SERVER_UNAVAILABLE
The Network Connection has been made but the MQTT service is unavailable.
Definition mqtt.h:152
@ MQTT_DISCONNECT_TOPIC_NAME_INVALID
Definition mqtt.h:216
@ MQTT_DISCONNECT_SHARED_SUB_NOT_SUPPORTED
Definition mqtt.h:228
@ MQTT_DISCONNECT_SESSION_TAKE_OVER
Definition mqtt.h:214
@ MQTT_DISCONNECT_TOPIC_ALIAS_INVALID
Definition mqtt.h:218
@ MQTT_DISCONNECT_IMPL_SPECIFIC_ERROR
Definition mqtt.h:209
@ MQTT_DISCONNECT_USE_ANOTHER_SERVER
Definition mqtt.h:226
@ MQTT_DISCONNECT_PACKET_TOO_LARGE
Definition mqtt.h:219
@ MQTT_DISCONNECT_NOT_AUTHORIZED
Definition mqtt.h:210
@ MQTT_DISCONNECT_RECV_MAX_EXCEEDED
Definition mqtt.h:217
@ MQTT_DISCONNECT_SERVER_SHUTTING_DOWN
Definition mqtt.h:212
@ MQTT_DISCONNECT_QOS_NOT_SUPPORTED
Definition mqtt.h:225
@ MQTT_DISCONNECT_WILDCARD_SUB_NOT_SUPPORTED
Definition mqtt.h:232
@ MQTT_DISCONNECT_SUB_ID_NOT_SUPPORTED
Definition mqtt.h:231
@ MQTT_DISCONNECT_TOPIC_FILTER_INVALID
Definition mqtt.h:215
@ MQTT_DISCONNECT_PROTOCOL_ERROR
Definition mqtt.h:208
@ MQTT_DISCONNECT_CONNECTION_RATE_EXCEEDED
Definition mqtt.h:229
@ MQTT_DISCONNECT_MESSAGE_RATE_TOO_HIGH
Definition mqtt.h:220
@ MQTT_DISCONNECT_MALFORMED_PACKET
Definition mqtt.h:207
@ MQTT_DISCONNECT_NORMAL
Definition mqtt.h:204
@ MQTT_DISCONNECT_QUOTA_EXCEEDED
Definition mqtt.h:221
@ MQTT_DISCONNECT_ADMIN_ACTION
Definition mqtt.h:222
@ MQTT_DISCONNECT_RETAIN_NOT_SUPPORTED
Definition mqtt.h:224
@ MQTT_DISCONNECT_UNSPECIFIED_ERROR
Definition mqtt.h:206
@ MQTT_DISCONNECT_WITH_WILL_MSG
Definition mqtt.h:205
@ MQTT_DISCONNECT_SERVER_MOVED
Definition mqtt.h:227
@ MQTT_DISCONNECT_SERVER_BUSY
Definition mqtt.h:211
@ MQTT_DISCONNECT_KEEP_ALIVE_TIMEOUT
Definition mqtt.h:213
@ MQTT_DISCONNECT_MAX_CONNECT_TIME
Definition mqtt.h:230
@ MQTT_DISCONNECT_PAYLOAD_FORMAT_INVALID
Definition mqtt.h:223
@ MQTT_SUBACK_FAILURE
Subscription for a topic failed.
Definition mqtt.h:199
@ MQTT_SUBACK_SUCCESS_QoS_0
Subscription with QoS 0 succeeded.
Definition mqtt.h:190
@ MQTT_SUBACK_SUCCESS_QoS_2
Subscription with QoS 2 succeeded.
Definition mqtt.h:196
@ MQTT_SUBACK_SUCCESS_QoS_1
Subscription with QoS 1 succeeded.
Definition mqtt.h:193
@ MQTT_AUTH_RE_AUTHENTICATE
Definition mqtt.h:239
@ MQTT_AUTH_SUCCESS
Definition mqtt.h:237
@ MQTT_AUTH_CONTINUE_AUTHENTICATION
Definition mqtt.h:238
@ MQTT_CONNACK_MALFORMED_PACKET
Definition mqtt.h:165
@ MQTT_CONNACK_UNSPECIFIED_ERROR
Definition mqtt.h:164
@ MQTT_CONNACK_PROTOCOL_ERROR
Definition mqtt.h:166
@ MQTT_CONNACK_UNSUPPORTED_PROTO_ERROR
Definition mqtt.h:168
@ MQTT_CONNACK_SERVER_BUSY
Definition mqtt.h:173
@ MQTT_CONNACK_IMPL_SPECIFIC_ERROR
Definition mqtt.h:167
@ MQTT_CONNACK_BANNED
Definition mqtt.h:174
@ MQTT_CONNACK_TOPIC_NAME_INVALID
Definition mqtt.h:176
@ MQTT_CONNACK_QOS_NOT_SUPPORTED
Definition mqtt.h:181
@ MQTT_CONNACK_SERVER_UNAVAILABLE
Definition mqtt.h:172
@ MQTT_CONNACK_BAD_USERNAME_OR_PASS
Definition mqtt.h:170
@ MQTT_CONNACK_NOT_AUTHORIZED
Definition mqtt.h:171
@ MQTT_CONNACK_PAYLOAD_FORMAT_INVALID
Definition mqtt.h:179
@ MQTT_CONNACK_SERVER_MOVED
Definition mqtt.h:183
@ MQTT_CONNACK_PACKET_TOO_LARGE
Definition mqtt.h:177
@ MQTT_CONNACK_QUOTA_EXCEEDED
Definition mqtt.h:178
@ MQTT_CONNACK_RETAIN_NOT_SUPPORTED
Definition mqtt.h:180
@ MQTT_CONNACK_SUCCESS
Definition mqtt.h:163
@ MQTT_CONNACK_CONNECTION_RATE_EXCEEDED
Definition mqtt.h:184
@ MQTT_CONNACK_USE_ANOTHER_SERVER
Definition mqtt.h:182
@ MQTT_CONNACK_BAD_AUTH_METHOD
Definition mqtt.h:175
@ MQTT_CONNACK_CLIENT_ID_NOT_VALID
Definition mqtt.h:169
@ MQTT_TRANSPORT_NUM
Shall not be used as a transport type.
Definition mqtt.h:841
@ MQTT_TRANSPORT_NON_SECURE
Use non secure TCP transport for MQTT connection.
Definition mqtt.h:818
int sec_tag_t
Secure tag, a reference to TLS credential.
Definition tls_credentials.h:90
IPv6 and IPv4 definitions.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__INT32_TYPE__ int32_t
Definition stdint.h:74
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
__INT8_TYPE__ int8_t
Definition stdint.h:72
Parameters for auth message.
Definition mqtt.h:667
struct mqtt_utf8_pair user_prop[CONFIG_MQTT_USER_PROPERTIES_MAX]
MQTT 5.0, chapter 3.15.2.2.5 User Property.
Definition mqtt.h:674
bool has_auth_data
Authentication Data property was present.
Definition mqtt.h:690
struct mqtt_utf8 reason_string
MQTT 5.0, chapter 3.15.2.2.4 Reason String.
Definition mqtt.h:683
bool has_user_prop
User Property property was present.
Definition mqtt.h:694
struct mqtt_utf8 auth_method
MQTT 5.0, chapter 3.15.2.2.2 Authentication Method.
Definition mqtt.h:677
struct mqtt_auth_param::@107335363303100030042027216300072147011125112127 prop
bool has_auth_method
Authentication Method property was present.
Definition mqtt.h:688
bool has_reason_string
Reason String property was present.
Definition mqtt.h:692
struct mqtt_auth_param::@107335363303100030042027216300072147011125112127::@376310332114221126264346276345242155337035366236 rx
Flags indicating whether given property was present in received packet.
struct mqtt_binstr auth_data
MQTT 5.0, chapter 3.15.2.2.3 Authentication Data.
Definition mqtt.h:680
enum mqtt_auth_reason_code reason_code
Definition mqtt.h:670
Abstracts binary strings.
Definition mqtt.h:261
uint8_t * data
Pointer to binary stream.
Definition mqtt.h:262
uint32_t len
Length of binary stream.
Definition mqtt.h:263
MQTT Client definition to maintain information relevant to the client.
Definition mqtt.h:946
struct mqtt_client::@376144155340255137111270003166063056262224106125 will_prop
MQTT 5.0 Will properties.
bool request_problem_info
MQTT 5.0, chapter 3.1.2.11.7 Request Response Information.
Definition mqtt.h:1058
bool request_response_info
MQTT 5.0, chapter 3.1.2.11.6 Request Response Information.
Definition mqtt.h:1055
uint32_t session_expiry_interval
MQTT 5.0, chapter 3.1.2.11.2 Session Expiry Interval.
Definition mqtt.h:1046
uint32_t will_delay_interval
MQTT 5.0, chapter 3.1.3.2.2 Will Delay Interval.
Definition mqtt.h:988
uint32_t maximum_packet_size
MQTT 5.0, chapter 3.1.2.11.4 Maximum Packet Size.
Definition mqtt.h:1049
struct mqtt_internal internal
MQTT client internal state.
Definition mqtt.h:948
mqtt_evt_cb_t evt_cb
Application callback registered with the module to get MQTT events.
Definition mqtt.h:1008
uint32_t message_expiry_interval
MQTT 5.0, chapter 3.1.3.2.4 Message Expiry Interval.
Definition mqtt.h:991
struct mqtt_topic * will_topic
Will topic and QoS.
Definition mqtt.h:999
uint32_t tx_buf_size
Size of transmit buffer.
Definition mqtt.h:1020
uint8_t protocol_version
MQTT protocol version.
Definition mqtt.h:1028
uint32_t rx_buf_size
Size of receive buffer.
Definition mqtt.h:1014
uint16_t receive_maximum
MQTT 5.0, chapter 3.1.2.11.3 Receive Maximum.
Definition mqtt.h:1052
int8_t unacked_ping
Unanswered PINGREQ count on this connection.
Definition mqtt.h:1031
struct mqtt_utf8_pair user_prop[CONFIG_MQTT_USER_PROPERTIES_MAX]
MQTT 5.0, chapter 3.1.3.2.8 User Property.
Definition mqtt.h:976
const void * broker
Broker details, for example, address, port.
Definition mqtt.h:959
struct mqtt_utf8 * will_message
Will message.
Definition mqtt.h:1004
struct mqtt_utf8 content_type
MQTT 5.0, chapter 3.1.3.2.5 Content Type.
Definition mqtt.h:979
struct mqtt_client::@254356341123355117114276341354315117150125300003 prop
MQTT 5.0 properties.
uint8_t * rx_buf
Receive buffer used for MQTT packet reception in RX path.
Definition mqtt.h:1011
uint16_t keepalive
Keepalive interval for this client in seconds.
Definition mqtt.h:1025
struct mqtt_utf8 client_id
Unique client identification to be used for the connection.
Definition mqtt.h:954
struct mqtt_binstr correlation_data
MQTT 5.0, chapter 3.1.3.2.7 Correlation Data.
Definition mqtt.h:985
uint8_t clean_session
Clean session flag indicating a fresh (1) or a retained session (0).
Definition mqtt.h:1069
struct mqtt_utf8 * user_name
User name (if any) to be used for the connection.
Definition mqtt.h:964
uint8_t payload_format_indicator
MQTT 5.0, chapter 3.1.3.2.3 Payload Format Indicator.
Definition mqtt.h:994
struct mqtt_transport transport
MQTT transport configuration and data.
Definition mqtt.h:951
struct mqtt_utf8 response_topic
MQTT 5.0, chapter 3.1.3.2.6 Response Topic.
Definition mqtt.h:982
struct mqtt_utf8 auth_method
MQTT 5.0, chapter 3.1.2.11.9 Authentication Method.
Definition mqtt.h:1040
uint8_t will_retain
Will retain flag, 1 if will message shall be retained persistently.
Definition mqtt.h:1064
struct mqtt_binstr auth_data
MQTT 5.0, chapter 3.1.2.11.10 Authentication Data.
Definition mqtt.h:1043
uint8_t * tx_buf
Transmit buffer used for creating MQTT packet in TX path.
Definition mqtt.h:1017
struct mqtt_utf8 * password
Password (if any) to be used for the connection.
Definition mqtt.h:970
void * user_data
User specific opaque data.
Definition mqtt.h:1072
Common MQTT 5.0 properties shared across all ack-type messages.
Definition mqtt.h:424
struct mqtt_utf8 reason_string
MQTT 5.0, chapter 3.4.2.2.2 Reason String.
Definition mqtt.h:430
bool has_user_prop
User Property property was present.
Definition mqtt.h:437
struct mqtt_common_ack_properties::@247227174316354166044343243236340014224120252320 rx
Flags indicating whether given property was present in received packet.
struct mqtt_utf8_pair user_prop[CONFIG_MQTT_USER_PROPERTIES_MAX]
MQTT 5.0, chapter 3.4.2.2.3 User Property.
Definition mqtt.h:427
bool has_reason_string
Reason String property was present.
Definition mqtt.h:435
Parameters for a connection acknowledgment (CONNACK).
Definition mqtt.h:315
struct mqtt_utf8 server_reference
MQTT 5.0, chapter 3.2.2.3.16 Server Reference.
Definition mqtt.h:344
uint16_t topic_alias_maximum
MQTT 5.0, chapter 3.2.2.3.8 Topic Alias Maximum.
Definition mqtt.h:362
bool has_server_keep_alive
Server Keep Alive property was present.
Definition mqtt.h:409
bool has_maximum_qos
Maximum QoS property was present.
Definition mqtt.h:389
bool has_response_information
Response Information property was present.
Definition mqtt.h:411
struct mqtt_utf8 response_information
MQTT 5.0, chapter 3.2.2.3.15 Response Information.
Definition mqtt.h:341
uint8_t wildcard_sub_available
MQTT 5.0, chapter 3.2.2.3.11 Wildcard Subscription Available.
Definition mqtt.h:374
bool has_receive_maximum
Receive Maximum property was present.
Definition mqtt.h:387
struct mqtt_utf8_pair user_prop[CONFIG_MQTT_USER_PROPERTIES_MAX]
MQTT 5.0, chapter 3.2.2.3.10 User Property.
Definition mqtt.h:332
bool has_server_reference
Server Reference property was present.
Definition mqtt.h:413
uint8_t shared_sub_available
MQTT 5.0, chapter 3.2.2.3.13 Shared Subscription Available.
Definition mqtt.h:380
bool has_wildcard_sub_available
Wildcard Subscription Available property was present.
Definition mqtt.h:403
struct mqtt_connack_param::@142223201017206201250124032135157075026165211271::@221174205307343254232175102026373007000160355367 rx
Flags indicating whether given property was present in received packet.
bool has_subscription_ids_available
Subscription Identifiers Available property was present.
Definition mqtt.h:405
bool has_user_prop
User Property property was present.
Definition mqtt.h:401
bool has_reason_string
Reason String property was present.
Definition mqtt.h:399
struct mqtt_connack_param::@142223201017206201250124032135157075026165211271 prop
struct mqtt_utf8 reason_string
MQTT 5.0, chapter 3.2.2.3.9 Reason String.
Definition mqtt.h:338
bool has_auth_data
Authentication Data property was present.
Definition mqtt.h:417
bool has_auth_method
Authentication Method property was present.
Definition mqtt.h:415
bool has_shared_sub_available
Shared Subscription Available property was present.
Definition mqtt.h:407
bool has_retain_available
Retain Available property was present.
Definition mqtt.h:391
uint32_t session_expiry_interval
MQTT 5.0, chapter 3.2.2.3.2 Session Expiry Interval.
Definition mqtt.h:353
struct mqtt_utf8 assigned_client_id
MQTT 5.0, chapter 3.2.2.3.7 Assigned Client Identifier.
Definition mqtt.h:335
bool has_maximum_packet_size
Maximum Packet Size property was present.
Definition mqtt.h:393
uint32_t maximum_packet_size
MQTT 5.0, chapter 3.2.2.3.6 Maximum Packet Size.
Definition mqtt.h:356
uint8_t maximum_qos
MQTT 5.0, chapter 3.2.2.3.4 Maximum QoS.
Definition mqtt.h:368
uint16_t receive_maximum
MQTT 5.0, chapter 3.3.2.3.3 Receive Maximum.
Definition mqtt.h:359
uint8_t return_code
The appropriate non-zero Connect return code indicates if the Server is unable to process a connectio...
Definition mqtt.h:327
uint8_t session_present_flag
The Session Present flag enables a Client to establish whether the Client and Server have a consisten...
Definition mqtt.h:320
struct mqtt_utf8 auth_method
MQTT 5.0, chapter 3.2.2.3.17 Authentication Method.
Definition mqtt.h:347
uint8_t subscription_ids_available
MQTT 5.0, chapter 3.2.2.3.12 Subscription Identifiers Available.
Definition mqtt.h:377
bool has_topic_alias_maximum
Topic Alias Maximum property was present.
Definition mqtt.h:397
struct mqtt_binstr auth_data
MQTT 5.0, chapter 3.2.2.3.18 Authentication Data.
Definition mqtt.h:350
bool has_session_expiry_interval
Session Expiry Interval property was present.
Definition mqtt.h:385
uint8_t retain_available
MQTT 5.0, chapter 3.2.2.3.5 Retain Available.
Definition mqtt.h:371
uint16_t server_keep_alive
MQTT 5.0, chapter 3.2.2.3.14 Server Keep Alive.
Definition mqtt.h:365
bool has_assigned_client_id
Assigned Client Identifier property was present.
Definition mqtt.h:395
Parameters for disconnect message.
Definition mqtt.h:629
bool has_user_prop
User Property property was present.
Definition mqtt.h:655
struct mqtt_utf8_pair user_prop[CONFIG_MQTT_USER_PROPERTIES_MAX]
MQTT 5.0, chapter 3.14.2.2.4 User Property.
Definition mqtt.h:637
bool has_session_expiry_interval
Session Expiry Interval property was present.
Definition mqtt.h:651
struct mqtt_disconnect_param::@176216277030143140355276135016352114106342216216::@170230232122130102371345361056276174310351235031 rx
Flags indicating whether given property was present in received packet.
struct mqtt_utf8 reason_string
MQTT 5.0, chapter 3.14.2.2.3 Reason String.
Definition mqtt.h:640
bool has_server_reference
Server Reference property was present.
Definition mqtt.h:657
uint32_t session_expiry_interval
MQTT 5.0, chapter 3.14.2.2.2 Session Expiry Interval.
Definition mqtt.h:646
enum mqtt_disconnect_reason_code reason_code
Definition mqtt.h:632
struct mqtt_disconnect_param::@176216277030143140355276135016352114106342216216 prop
MQTT 5.0 properties.
struct mqtt_utf8 server_reference
MQTT 5.0, chapter 3.14.2.2.5 Server Reference.
Definition mqtt.h:643
bool has_reason_string
Reason String property was present.
Definition mqtt.h:653
Defines MQTT asynchronous event notified to the application.
Definition mqtt.h:747
enum mqtt_evt_type type
Identifies the event.
Definition mqtt.h:749
int result
Event result.
Definition mqtt.h:757
union mqtt_evt_param param
Contains parameters (if any) accompanying the event.
Definition mqtt.h:752
MQTT internal state.
Definition mqtt.h:915
uint32_t rx_buf_datalen
Internal.
Definition mqtt.h:928
struct mqtt_topic_alias topic_aliases[CONFIG_MQTT_TOPIC_ALIAS_MAX]
Internal.
Definition mqtt.h:935
uint32_t last_activity
Internal.
Definition mqtt.h:922
uint32_t remaining_payload
Internal.
Definition mqtt.h:931
uint32_t state
Internal.
Definition mqtt.h:925
enum mqtt_disconnect_reason_code disconnect_reason
Internal.
Definition mqtt.h:938
struct sys_mutex mutex
Internal.
Definition mqtt.h:917
Parameters for MQTT publish acknowledgment (PUBACK).
Definition mqtt.h:446
uint8_t reason_code
MQTT 5.0 reason code.
Definition mqtt.h:452
struct mqtt_common_ack_properties prop
MQTT 5.0 properties.
Definition mqtt.h:455
uint16_t message_id
Message id of the PUBLISH message being acknowledged.
Definition mqtt.h:448
Parameters for MQTT publish complete (PUBCOMP).
Definition mqtt.h:488
struct mqtt_common_ack_properties prop
MQTT 5.0 properties.
Definition mqtt.h:497
uint8_t reason_code
MQTT 5.0 reason code.
Definition mqtt.h:494
uint16_t message_id
Message id of the PUBREL message being acknowledged.
Definition mqtt.h:490
Parameters for a publish message.
Definition mqtt.h:309
struct mqtt_binstr payload
Payload on the topic published.
Definition mqtt.h:311
struct mqtt_topic topic
Topic on which data was published.
Definition mqtt.h:310
Parameters for a publish message (PUBLISH).
Definition mqtt.h:534
bool has_content_type
Content Type property was present.
Definition mqtt.h:597
uint16_t topic_alias
MQTT 5.0, chapter 3.3.2.3.4 Topic Alias.
Definition mqtt.h:575
uint8_t dup_flag
Duplicate flag.
Definition mqtt.h:546
bool has_topic_alias
Topic Alias property was present.
Definition mqtt.h:587
bool has_payload_format_indicator
Payload Format Indicator property was present.
Definition mqtt.h:583
uint32_t message_expiry_interval
MQTT 5.0, chapter 3.3.2.3.3 Message Expiry Interval.
Definition mqtt.h:572
bool has_correlation_data
Correlation Data property was present.
Definition mqtt.h:591
bool has_user_prop
User Property property was present.
Definition mqtt.h:593
struct mqtt_publish_param::@051035107033047342157306236011117240326112352043 prop
MQTT 5.0 properties.
uint32_t subscription_identifier[CONFIG_MQTT_SUBSCRIPTION_ID_PROPERTIES_MAX]
MQTT 5.0, chapter 3.3.2.3.8 Subscription Identifier.
Definition mqtt.h:569
struct mqtt_utf8 response_topic
MQTT 5.0, chapter 3.3.2.3.5 Response Topic.
Definition mqtt.h:560
struct mqtt_utf8_pair user_prop[CONFIG_MQTT_USER_PROPERTIES_MAX]
MQTT 5.0, chapter 3.3.2.3.7 User Property.
Definition mqtt.h:557
bool has_message_expiry_interval
Message Expiry Interval property was present.
Definition mqtt.h:585
uint8_t payload_format_indicator
MQTT 5.0, chapter 3.3.2.3.2 Payload Format Indicator.
Definition mqtt.h:578
struct mqtt_utf8 content_type
MQTT 5.0, chapter 3.3.2.3.9 Content Type.
Definition mqtt.h:566
struct mqtt_publish_message message
Messages including topic, QoS and its payload (if any) to be published.
Definition mqtt.h:538
uint8_t retain_flag
Retain flag.
Definition mqtt.h:551
bool has_subscription_identifier
Subscription Identifier property was present.
Definition mqtt.h:595
uint16_t message_id
Message id used for the publish message.
Definition mqtt.h:541
bool has_response_topic
Response Topic property was present.
Definition mqtt.h:589
struct mqtt_binstr correlation_data
MQTT 5.0, chapter 3.3.2.3.6 Correlation Data.
Definition mqtt.h:563
Parameters for MQTT publish receive (PUBREC).
Definition mqtt.h:460
uint8_t reason_code
MQTT 5.0 reason code.
Definition mqtt.h:466
uint16_t message_id
Message id of the PUBLISH message being acknowledged.
Definition mqtt.h:462
struct mqtt_common_ack_properties prop
MQTT 5.0 properties.
Definition mqtt.h:469
Parameters for MQTT publish release (PUBREL).
Definition mqtt.h:474
uint16_t message_id
Message id of the PUBREC message being acknowledged.
Definition mqtt.h:476
struct mqtt_common_ack_properties prop
MQTT 5.0 properties.
Definition mqtt.h:483
uint8_t reason_code
MQTT 5.0 reason code.
Definition mqtt.h:480
TLS configuration for secure MQTT transports.
Definition mqtt.h:774
int peer_verify
Indicates the preference for peer verification.
Definition mqtt.h:776
const int * cipher_list
Indicates the list of ciphers to be used for the session.
Definition mqtt.h:784
uint32_t cipher_count
Indicates the number of entries in the cipher list.
Definition mqtt.h:779
int cert_nocopy
Indicates the preference for copying certificates to the heap.
Definition mqtt.h:809
uint32_t sec_tag_count
Indicates the number of entries in the sec tag list.
Definition mqtt.h:787
bool set_native_tls
Set socket to use native TLS (used with socket offloading).
Definition mqtt.h:812
const sec_tag_t * sec_tag_list
Indicates the list of security tags to be used for the session.
Definition mqtt.h:790
const char * hostname
Peer hostname for certificate verification.
Definition mqtt.h:806
Parameters for MQTT subscription acknowledgment (SUBACK).
Definition mqtt.h:502
struct mqtt_common_ack_properties prop
MQTT 5.0 properties.
Definition mqtt.h:515
struct mqtt_binstr return_codes
MQTT 3.1 - Return codes indicating maximum QoS level granted for each topic in the subscription list.
Definition mqtt.h:511
uint16_t message_id
Message id of the SUBSCRIBE message being acknowledged.
Definition mqtt.h:504
Parameters for subscribe/unsubscribe message.
Definition mqtt.h:604
uint16_t message_id
Message id used to identify subscription request.
Definition mqtt.h:612
uint32_t subscription_identifier
MQTT 5.0, chapter 3.8.2.1.2 Subscription Identifier.
Definition mqtt.h:623
const struct mqtt_topic * list
Array containing topics along with QoS for each.
Definition mqtt.h:606
struct mqtt_utf8_pair user_prop[CONFIG_MQTT_USER_PROPERTIES_MAX]
MQTT 5.0, chapter 3.8.2.1.3 / 3.10.2.1.2 User Property.
Definition mqtt.h:618
struct mqtt_subscription_list::@375267017056276274054144052057227171221370244005 prop
MQTT 5.0 properties.
uint16_t list_count
Number of topics in the subscription list.
Definition mqtt.h:609
Abstracts aliased topic.
Definition mqtt.h:267
uint16_t topic_size
Topic name size.
Definition mqtt.h:273
uint8_t topic_buf[CONFIG_MQTT_TOPIC_ALIAS_STRING_MAX]
UTF-8 encoded topic name.
Definition mqtt.h:270
Abstracts MQTT UTF-8 encoded topic that can be subscribed to or published.
Definition mqtt.h:283
uint8_t retain_handling
MQTT 5.0, chapter 3.8.3.1 Retain Handling subscription option.
Definition mqtt.h:297
uint8_t qos
Quality of service requested for the subscription.
Definition mqtt.h:290
struct mqtt_utf8 topic
Topic on to be published or subscribed to.
Definition mqtt.h:285
uint8_t no_local
MQTT 5.0, chapter 3.8.3.1 No Local subscription option.
Definition mqtt.h:293
uint8_t retain_as_published
MQTT 5.0, chapter 3.8.3.1 Retain As Published subscription option.
Definition mqtt.h:295
MQTT transport specific data.
Definition mqtt.h:845
int sock
Socket descriptor.
Definition mqtt.h:862
enum mqtt_transport_type type
Transport type selection for client instance.
Definition mqtt.h:850
const char * if_name
Name of the interface that the MQTT client instance should be bound to.
Definition mqtt.h:855
struct mqtt_transport::@310134107073373015064223357245241263267204223226::@300202053211170207064241275326270241144373152264 tcp
TCP socket transport for MQTT.
Parameters for MQTT unsubscribe acknowledgment (UNSUBACK).
Definition mqtt.h:520
struct mqtt_common_ack_properties prop
MQTT 5.0 properties.
Definition mqtt.h:529
struct mqtt_binstr reason_codes
Reason codes corresponding to each topic in the unsubscription list.
Definition mqtt.h:526
uint16_t message_id
Message id of the UNSUBSCRIBE message being acknowledged.
Definition mqtt.h:522
Abstracts MQTT UTF-8 encoded string pair.
Definition mqtt.h:303
struct mqtt_utf8 value
Definition mqtt.h:305
struct mqtt_utf8 name
Definition mqtt.h:304
Abstracts UTF-8 encoded strings.
Definition mqtt.h:243
uint32_t size
Size of UTF string, in bytes.
Definition mqtt.h:245
const uint8_t * utf8
Pointer to UTF-8 string.
Definition mqtt.h:244
Generic sockaddr struct.
Definition net_ip.h:455
TLS credentials management.
Defines event parameters notified along with asynchronous events to the application.
Definition mqtt.h:707
struct mqtt_pubrel_param pubrel
Parameters accompanying MQTT_EVT_PUBREL event.
Definition mqtt.h:726
struct mqtt_puback_param puback
Parameters accompanying MQTT_EVT_PUBACK event.
Definition mqtt.h:720
struct mqtt_pubrec_param pubrec
Parameters accompanying MQTT_EVT_PUBREC event.
Definition mqtt.h:723
struct mqtt_publish_param publish
Parameters accompanying MQTT_EVT_PUBLISH event.
Definition mqtt.h:717
struct mqtt_disconnect_param disconnect
Parameters accompanying MQTT_EVT_DISCONNECT event.
Definition mqtt.h:739
struct mqtt_connack_param connack
Parameters accompanying MQTT_EVT_CONNACK event.
Definition mqtt.h:709
struct mqtt_pubcomp_param pubcomp
Parameters accompanying MQTT_EVT_PUBCOMP event.
Definition mqtt.h:729
struct mqtt_unsuback_param unsuback
Parameters accompanying MQTT_EVT_UNSUBACK event.
Definition mqtt.h:735
struct mqtt_auth_param auth
Parameters accompanying MQTT_EVT_AUTH event.
Definition mqtt.h:742
struct mqtt_suback_param suback
Parameters accompanying MQTT_EVT_SUBACK event.
Definition mqtt.h:732