[][src]Crate paho_mqtt_sys

Structs

MQTTAsync_SSLOptions

MQTTAsync_sslProperties defines the settings to establish an SSL/TLS connection using the OpenSSL library. It covers the following scenarios:

MQTTAsync_connectData

The connect options that can be updated before an automatic reconnect.

MQTTAsync_connectData__bindgen_ty_1

The password parameter of the MQTT authentication. Set data to NULL to remove. To change, allocate new storage with ::MQTTAsync_allocate - this will then be free later by the library.

MQTTAsync_connectOptions

MQTTAsync_connectOptions defines several settings that control the way the client connects to an MQTT server. Default values are set in MQTTAsync_connectOptions_initializer.

MQTTAsync_connectOptions__bindgen_ty_1

Optional binary password. Only checked and used if the password option is NULL

MQTTAsync_createOptions

Options for the ::MQTTAsync_createWithOptions call

MQTTAsync_disconnectOptions

Options for the ::MQTTAsync_disconnect call

MQTTAsync_failureData

The data returned on completion of an unsuccessful API call in the response callback onFailure.

MQTTAsync_failureData5

The data returned on completion of an unsuccessful API call in the response callback onFailure.

MQTTAsync_init_options

Initialization options

MQTTAsync_message

A structure representing the payload and attributes of an MQTT message. The message topic is not part of this structure (see MQTTAsync_publishMessage(), MQTTAsync_publish(), MQTTAsync_receive(), MQTTAsync_freeMessage() and MQTTAsync_messageArrived()).

MQTTAsync_nameValue

Utility structure where name/value pairs are needed

MQTTAsync_responseOptions

Structure to define call options. For MQTT 5.0 there is input data as well as that describing the response method. So there is now also a synonym ::MQTTAsync_callOptions to better reflect the use. This responseOptions name is kept for backward compatibility.

MQTTAsync_successData

The data returned on completion of a successful API call in the response callback onSuccess.

MQTTAsync_successData5

The data returned on completion of a successful API call in the response callback onSuccess.

MQTTAsync_successData5__bindgen_ty_1__bindgen_ty_1

For subscribeMany, the list of reasonCodes returned by the server.

MQTTAsync_successData5__bindgen_ty_1__bindgen_ty_2

For publish, the message being sent to the server.

MQTTAsync_successData5__bindgen_ty_1__bindgen_ty_3
MQTTAsync_successData5__bindgen_ty_1__bindgen_ty_4

For unsubscribeMany, the list of reasonCodes returned by the server.

MQTTAsync_successData__bindgen_ty_1__bindgen_ty_1

For publish, the message being sent to the server.

MQTTAsync_successData__bindgen_ty_1__bindgen_ty_2
MQTTAsync_willOptions

MQTTAsync_willOptions defines the MQTT "Last Will and Testament" (LWT) settings for the client. In the event that a client unexpectedly loses its connection to the server, the server publishes the LWT message to the LWT topic on behalf of the client. This allows other clients (subscribed to the LWT topic) to be made aware that the client has disconnected. To enable the LWT function for a specific client, a valid pointer to an MQTTAsync_willOptions structure is passed in the MQTTAsync_connectOptions structure used in the MQTTAsync_connect() call that connects the client to the server. The pointer to MQTTAsync_willOptions can be set to NULL if the LWT function is not required.

MQTTAsync_willOptions__bindgen_ty_1

The LWT payload in binary form. This is only checked and used if the message option is NULL

MQTTClient_persistence

@brief A structure containing the function pointers to a persistence implementation and the context or state that will be shared across all the persistence functions.

MQTTLenString

The data for a length delimited string

MQTTProperties

MQTT version 5 property list

MQTTProperty

Structure to hold an MQTT version 5 property of any type

MQTTProperty__bindgen_ty_1__bindgen_ty_1
MQTTSubscribe_options

The MQTT V5 subscribe options, apart from QoS which existed before V5.

_G_fpos64_t
_G_fpos_t
_IO_FILE
_IO_FILE_plus
_IO_jump_t
_IO_marker
__fsid_t
__mbstate_t
__va_list_tag

Constants

BUFSIZ
CONNECT_OPTIONS_STRUCT_VERSION

The currently supported version of the C connect options struct.

CREATE_OPTIONS_STRUCT_VERSION

The currently supported version of the C create options struct.

DISCONNECT_OPTIONS_STRUCT_VERSION

The currently suppoted version of the C disconnect options struct.

EOF
FILENAME_MAX
FOPEN_MAX
L_ctermid
L_tmpnam
MESSAGE_STRUCT_VERSION

The currently suppoted version of the C message struct.

MQTTASYNC_0_LEN_WILL_TOPIC
MQTTASYNC_BAD_MQTT_OPTION
MQTTASYNC_BAD_PROTOCOL
MQTTASYNC_BAD_QOS
MQTTASYNC_BAD_STRUCTURE
MQTTASYNC_BAD_UTF8_STRING
MQTTASYNC_DISCONNECTED
MQTTASYNC_FAILURE
MQTTASYNC_MAX_BUFFERED_MESSAGES
MQTTASYNC_MAX_MESSAGES_INFLIGHT
MQTTASYNC_NO_MORE_MSGIDS
MQTTASYNC_NULL_PARAMETER
MQTTASYNC_OPERATION_INCOMPLETE
MQTTASYNC_PERSISTENCE_ERROR
MQTTASYNC_SSL_NOT_SUPPORTED
MQTTASYNC_SUCCESS
MQTTASYNC_TOPICNAME_TRUNCATED
MQTTASYNC_TRACE_LEVELS_MQTTASYNC_TRACE_ERROR
MQTTASYNC_TRACE_LEVELS_MQTTASYNC_TRACE_FATAL
MQTTASYNC_TRACE_LEVELS_MQTTASYNC_TRACE_MAXIMUM
MQTTASYNC_TRACE_LEVELS_MQTTASYNC_TRACE_MEDIUM
MQTTASYNC_TRACE_LEVELS_MQTTASYNC_TRACE_MINIMUM
MQTTASYNC_TRACE_LEVELS_MQTTASYNC_TRACE_PROTOCOL
MQTTASYNC_TRACE_LEVELS_MQTTASYNC_TRACE_SEVERE
MQTTASYNC_TRUE
MQTTASYNC_WRONG_MQTT_VERSION
MQTTCLIENT_PERSISTENCE_DEFAULT
MQTTCLIENT_PERSISTENCE_ERROR
MQTTCLIENT_PERSISTENCE_NONE
MQTTCLIENT_PERSISTENCE_USER
MQTTPropertyCodes_MQTTPROPERTY_CODE_ASSIGNED_CLIENT_IDENTIFER

< The value is 18

MQTTPropertyCodes_MQTTPROPERTY_CODE_AUTHENTICATION_DATA

< The value is 22

MQTTPropertyCodes_MQTTPROPERTY_CODE_AUTHENTICATION_METHOD

< The value is 21

MQTTPropertyCodes_MQTTPROPERTY_CODE_CONTENT_TYPE

< The value is 3

MQTTPropertyCodes_MQTTPROPERTY_CODE_CORRELATION_DATA

< The value is 9

MQTTPropertyCodes_MQTTPROPERTY_CODE_MAXIMUM_PACKET_SIZE

< The value is 39

MQTTPropertyCodes_MQTTPROPERTY_CODE_MAXIMUM_QOS

< The value is 36

MQTTPropertyCodes_MQTTPROPERTY_CODE_MESSAGE_EXPIRY_INTERVAL

< The value is 2

MQTTPropertyCodes_MQTTPROPERTY_CODE_PAYLOAD_FORMAT_INDICATOR

< The value is 1

MQTTPropertyCodes_MQTTPROPERTY_CODE_REASON_STRING

< The value is 31

MQTTPropertyCodes_MQTTPROPERTY_CODE_RECEIVE_MAXIMUM

< The value is 33

MQTTPropertyCodes_MQTTPROPERTY_CODE_REQUEST_PROBLEM_INFORMATION

< The value is 23

MQTTPropertyCodes_MQTTPROPERTY_CODE_REQUEST_RESPONSE_INFORMATION

< The value is 25

MQTTPropertyCodes_MQTTPROPERTY_CODE_RESPONSE_INFORMATION

< The value is 26

MQTTPropertyCodes_MQTTPROPERTY_CODE_RESPONSE_TOPIC

< The value is 8

MQTTPropertyCodes_MQTTPROPERTY_CODE_RETAIN_AVAILABLE

< The value is 37

MQTTPropertyCodes_MQTTPROPERTY_CODE_SERVER_KEEP_ALIVE

< The value is 19

MQTTPropertyCodes_MQTTPROPERTY_CODE_SERVER_REFERENCE

< The value is 28

MQTTPropertyCodes_MQTTPROPERTY_CODE_SESSION_EXPIRY_INTERVAL

< The value is 17

MQTTPropertyCodes_MQTTPROPERTY_CODE_SHARED_SUBSCRIPTION_AVAILABLE

< The value is 241

MQTTPropertyCodes_MQTTPROPERTY_CODE_SUBSCRIPTION_IDENTIFIER

< The value is 11

MQTTPropertyCodes_MQTTPROPERTY_CODE_SUBSCRIPTION_IDENTIFIERS_AVAILABLE

< The value is 41

MQTTPropertyCodes_MQTTPROPERTY_CODE_TOPIC_ALIAS

< The value is 35

MQTTPropertyCodes_MQTTPROPERTY_CODE_TOPIC_ALIAS_MAXIMUM

< The value is 34

MQTTPropertyCodes_MQTTPROPERTY_CODE_USER_PROPERTY

< The value is 38

MQTTPropertyCodes_MQTTPROPERTY_CODE_WILDCARD_SUBSCRIPTION_AVAILABLE

< The value is 40

MQTTPropertyCodes_MQTTPROPERTY_CODE_WILL_DELAY_INTERVAL

< The value is 24

MQTTPropertyTypes_MQTTPROPERTY_TYPE_BINARY_DATA
MQTTPropertyTypes_MQTTPROPERTY_TYPE_BYTE
MQTTPropertyTypes_MQTTPROPERTY_TYPE_FOUR_BYTE_INTEGER
MQTTPropertyTypes_MQTTPROPERTY_TYPE_TWO_BYTE_INTEGER
MQTTPropertyTypes_MQTTPROPERTY_TYPE_UTF_8_ENCODED_STRING
MQTTPropertyTypes_MQTTPROPERTY_TYPE_UTF_8_STRING_PAIR
MQTTPropertyTypes_MQTTPROPERTY_TYPE_VARIABLE_BYTE_INTEGER
MQTTReasonCodes_MQTTREASONCODE_ADMINISTRATIVE_ACTION
MQTTReasonCodes_MQTTREASONCODE_BAD_AUTHENTICATION_METHOD
MQTTReasonCodes_MQTTREASONCODE_BAD_USER_NAME_OR_PASSWORD
MQTTReasonCodes_MQTTREASONCODE_BANNED
MQTTReasonCodes_MQTTREASONCODE_CLIENT_IDENTIFIER_NOT_VALID
MQTTReasonCodes_MQTTREASONCODE_CONNECTION_RATE_EXCEEDED
MQTTReasonCodes_MQTTREASONCODE_CONTINUE_AUTHENTICATION
MQTTReasonCodes_MQTTREASONCODE_DISCONNECT_WITH_WILL_MESSAGE
MQTTReasonCodes_MQTTREASONCODE_GRANTED_QOS_0
MQTTReasonCodes_MQTTREASONCODE_GRANTED_QOS_1
MQTTReasonCodes_MQTTREASONCODE_GRANTED_QOS_2
MQTTReasonCodes_MQTTREASONCODE_IMPLEMENTATION_SPECIFIC_ERROR
MQTTReasonCodes_MQTTREASONCODE_KEEP_ALIVE_TIMEOUT
MQTTReasonCodes_MQTTREASONCODE_MALFORMED_PACKET
MQTTReasonCodes_MQTTREASONCODE_MAXIMUM_CONNECT_TIME
MQTTReasonCodes_MQTTREASONCODE_MESSAGE_RATE_TOO_HIGH
MQTTReasonCodes_MQTTREASONCODE_NORMAL_DISCONNECTION
MQTTReasonCodes_MQTTREASONCODE_NOT_AUTHORIZED
MQTTReasonCodes_MQTTREASONCODE_NO_MATCHING_SUBSCRIBERS
MQTTReasonCodes_MQTTREASONCODE_NO_SUBSCRIPTION_FOUND
MQTTReasonCodes_MQTTREASONCODE_PACKET_IDENTIFIER_IN_USE
MQTTReasonCodes_MQTTREASONCODE_PACKET_IDENTIFIER_NOT_FOUND
MQTTReasonCodes_MQTTREASONCODE_PACKET_TOO_LARGE
MQTTReasonCodes_MQTTREASONCODE_PAYLOAD_FORMAT_INVALID
MQTTReasonCodes_MQTTREASONCODE_PROTOCOL_ERROR
MQTTReasonCodes_MQTTREASONCODE_QOS_NOT_SUPPORTED
MQTTReasonCodes_MQTTREASONCODE_QUOTA_EXCEEDED
MQTTReasonCodes_MQTTREASONCODE_RECEIVE_MAXIMUM_EXCEEDED
MQTTReasonCodes_MQTTREASONCODE_RETAIN_NOT_SUPPORTED
MQTTReasonCodes_MQTTREASONCODE_RE_AUTHENTICATE
MQTTReasonCodes_MQTTREASONCODE_SERVER_BUSY
MQTTReasonCodes_MQTTREASONCODE_SERVER_MOVED
MQTTReasonCodes_MQTTREASONCODE_SERVER_SHUTTING_DOWN
MQTTReasonCodes_MQTTREASONCODE_SERVER_UNAVAILABLE
MQTTReasonCodes_MQTTREASONCODE_SESSION_TAKEN_OVER
MQTTReasonCodes_MQTTREASONCODE_SHARED_SUBSCRIPTIONS_NOT_SUPPORTED
MQTTReasonCodes_MQTTREASONCODE_SUBSCRIPTION_IDENTIFIERS_NOT_SUPPORTED
MQTTReasonCodes_MQTTREASONCODE_SUCCESS
MQTTReasonCodes_MQTTREASONCODE_TOPIC_ALIAS_INVALID
MQTTReasonCodes_MQTTREASONCODE_TOPIC_FILTER_INVALID
MQTTReasonCodes_MQTTREASONCODE_TOPIC_NAME_INVALID
MQTTReasonCodes_MQTTREASONCODE_UNSPECIFIED_ERROR
MQTTReasonCodes_MQTTREASONCODE_UNSUPPORTED_PROTOCOL_VERSION
MQTTReasonCodes_MQTTREASONCODE_USE_ANOTHER_SERVER
MQTTReasonCodes_MQTTREASONCODE_WILDCARD_SUBSCRIPTIONS_NOT_SUPPORTED
MQTTVERSION_3_1
MQTTVERSION_3_1_1
MQTTVERSION_5
MQTTVERSION_DEFAULT
MQTT_BAD_SUBSCRIBE
MQTT_INVALID_PROPERTY_ID
MQTT_SSL_VERSION_DEFAULT
MQTT_SSL_VERSION_TLS_1_0
MQTT_SSL_VERSION_TLS_1_1
MQTT_SSL_VERSION_TLS_1_2
P_tmpdir
RESPONSE_OPTIONS_STRUCT_VERSION

The currently suppoted version of the C response options struct.

SEEK_CUR
SEEK_END
SEEK_SET
SSL_OPTIONS_STRUCT_VERSION

The currently supported version of the C SSL options struct.

SUBSCRIBE_OPTIONS_STRUCT_VERSION

The currently supported version of the C subscribe options struct.

TMP_MAX
WILL_OPTIONS_STRUCT_VERSION

The currently supported version of the C will options struct.

_ATFILE_SOURCE
_BITS_G_CONFIG_H
_BITS_LIBIO_H
_BITS_STDIO_LIM_H
_BITS_TYPESIZES_H
_BITS_TYPES_H
_DEFAULT_SOURCE
_FEATURES_H
_G_BUFSIZ
_G_HAVE_MMAP
_G_HAVE_MREMAP
_G_IO_IO_FILE_VERSION
_IOFBF
_IOLBF
_IONBF
_IOS_APPEND
_IOS_ATEND
_IOS_BIN
_IOS_INPUT
_IOS_NOCREATE
_IOS_NOREPLACE
_IOS_OUTPUT
_IOS_TRUNC
_IO_BAD_SEEN
_IO_BOOLALPHA
_IO_BUFSIZ
_IO_CURRENTLY_PUTTING
_IO_DEC
_IO_DELETE_DONT_CLOSE
_IO_DONT_CLOSE
_IO_EOF_SEEN
_IO_ERR_SEEN
_IO_FIXED
_IO_FLAGS2_MMAP
_IO_FLAGS2_NOTCANCEL
_IO_FLAGS2_USER_WBUF
_IO_HEX
_IO_INTERNAL
_IO_IN_BACKUP
_IO_IS_APPENDING
_IO_IS_FILEBUF
_IO_LEFT
_IO_LINE_BUF
_IO_LINKED
_IO_MAGIC
_IO_MAGIC_MASK
_IO_NO_READS
_IO_NO_WRITES
_IO_OCT
_IO_RIGHT
_IO_SCIENTIFIC
_IO_SHOWBASE
_IO_SHOWPOINT
_IO_SHOWPOS
_IO_SKIPWS
_IO_STDIO
_IO_TIED_PUT_GET
_IO_UNBUFFERED
_IO_UNIFIED_JUMPTABLES
_IO_UNITBUF
_IO_UPPERCASE
_IO_USER_BUF
_IO_USER_LOCK
_OLD_STDIO_MAGIC
_POSIX_C_SOURCE
_POSIX_SOURCE
_STDC_PREDEF_H
_STDIO_H
_SYS_CDEFS_H
__FD_SETSIZE
__FILE_defined
__GLIBC_MINOR__
__GLIBC_USE_DEPRECATED_GETS
__GLIBC_USE_IEC_60559_BFP_EXT
__GLIBC_USE_IEC_60559_FUNCS_EXT
__GLIBC_USE_IEC_60559_TYPES_EXT
__GLIBC_USE_LIB_EXT2
__GLIBC__
__GNUC_VA_LIST
__GNU_LIBRARY__
__HAVE_GENERIC_SELECTION
__INO_T_MATCHES_INO64_T
__OFF_T_MATCHES_OFF64_T
__RLIM_T_MATCHES_RLIM64_T
__STDC_IEC_559_COMPLEX__
__STDC_IEC_559__
__STDC_ISO_10646__
__STDC_NO_THREADS__
__SYSCALL_WORDSIZE
__USE_ATFILE
__USE_FORTIFY_LEVEL
__USE_ISOC11
__USE_ISOC95
__USE_ISOC99
__USE_MISC
__USE_POSIX
__USE_POSIX2
__USE_POSIX199309
__USE_POSIX199506
__USE_POSIX_IMPLICITLY
__USE_XOPEN2K
__USE_XOPEN2K8
__WORDSIZE
__WORDSIZE_TIME64_COMPAT32
____FILE_defined
____mbstate_t_defined
__codecvt_result___codecvt_error
__codecvt_result___codecvt_noconv
__codecvt_result___codecvt_ok
__codecvt_result___codecvt_partial
__glibc_c99_flexarr_available

Statics

_IO_2_1_stderr_
_IO_2_1_stdin_
_IO_2_1_stdout_
stderr
stdin
stdout
sys_errlist
sys_nerr

Functions

MQTTAsync_connect

This function attempts to connect a previously-created client (see MQTTAsync_create()) to an MQTT server using the specified options. If you want to enable asynchronous message and status notifications, you must call MQTTAsync_setCallbacks() prior to MQTTAsync_connect(). @param handle A valid client handle from a successful call to MQTTAsync_create(). @param options A pointer to a valid MQTTAsync_connectOptions structure. @return ::MQTTASYNC_SUCCESS if the client connect request was accepted. If the client was unable to connect to the server, an error code is returned via the onFailure callback, if set. Error codes greater than 0 are returned by the MQTT protocol:

1: Connection refused: Unacceptable protocol version
2: Connection refused: Identifier rejected
3: Connection refused: Server unavailable
4: Connection refused: Bad user name or password
5: Connection refused: Not authorized
6-255: Reserved for future use

MQTTAsync_create

This function creates an MQTT client ready for connection to the specified server and using the specified persistent storage (see MQTTAsync_persistence). See also MQTTAsync_destroy(). @param handle A pointer to an ::MQTTAsync handle. The handle is populated with a valid client reference following a successful return from this function. @param serverURI A null-terminated string specifying the server to which the client will connect. It takes the form protocol://host:port. protocol must be tcp, ssl, ws or wss. The TLS enabled prefixes (ssl, wss) are only valid if a TLS version of the library is linked with. For host, you can specify either an IP address or a host name. For instance, to connect to a server running on the local machines with the default MQTT port, specify tcp://localhost:1883. @param clientId The client identifier passed to the server when the client connects to it. It is a null-terminated UTF-8 encoded string. @param persistence_type The type of persistence to be used by the client:
::MQTTCLIENT_PERSISTENCE_NONE: Use in-memory persistence. If the device or system on which the client is running fails or is switched off, the current state of any in-flight messages is lost and some messages may not be delivered even at QoS1 and QoS2.
::MQTTCLIENT_PERSISTENCE_DEFAULT: Use the default (file system-based) persistence mechanism. Status about in-flight messages is held in persistent storage and provides some protection against message loss in the case of unexpected failure.
::MQTTCLIENT_PERSISTENCE_USER: Use an application-specific persistence implementation. Using this type of persistence gives control of the persistence mechanism to the application. The application has to implement the MQTTClient_persistence interface. @param persistence_context If the application uses ::MQTTCLIENT_PERSISTENCE_NONE persistence, this argument is unused and should be set to NULL. For ::MQTTCLIENT_PERSISTENCE_DEFAULT persistence, it should be set to the location of the persistence directory (if set to NULL, the persistence directory used is the working directory). Applications that use ::MQTTCLIENT_PERSISTENCE_USER persistence set this argument to point to a valid MQTTClient_persistence structure. @return ::MQTTASYNC_SUCCESS if the client is successfully created, otherwise an error code is returned.

MQTTAsync_createWithOptions
MQTTAsync_destroy

This function frees the memory allocated to an MQTT client (see MQTTAsync_create()). It should be called when the client is no longer required. @param handle A pointer to the handle referring to the ::MQTTAsync structure to be freed.

MQTTAsync_disconnect

This function attempts to disconnect the client from the MQTT server. In order to allow the client time to complete handling of messages that are in-flight when this function is called, a timeout period is specified. When the timeout period has expired, the client disconnects even if there are still outstanding message acknowledgements. The next time the client connects to the same server, any QoS 1 or 2 messages which have not completed will be retried depending on the cleansession settings for both the previous and the new connection (see MQTTAsync_connectOptions.cleansession and MQTTAsync_connect()). @param handle A valid client handle from a successful call to MQTTAsync_create(). @param options The client delays disconnection for up to this time (in milliseconds) in order to allow in-flight message transfers to complete. @return ::MQTTASYNC_SUCCESS if the client successfully disconnects from the server. An error code is returned if the client was unable to disconnect from the server

MQTTAsync_free

This function frees memory allocated by the MQTT C client library, especially the topic name. This is needed on Windows when the client library and application program have been compiled with different versions of the C compiler. It is thus good policy to always use this function when freeing any MQTT C client- allocated memory. @param ptr The pointer to the client library storage to be freed.

MQTTAsync_freeMessage

This function frees memory allocated to an MQTT message, including the additional memory allocated to the message payload. The client application calls this function when the message has been fully processed. Important note: This function does not free the memory allocated to a message topic string. It is the responsibility of the client application to free this memory using the MQTTAsync_free() library function. @param msg The address of a pointer to the ::MQTTAsync_message structure to be freed.

MQTTAsync_getPendingTokens

This function sets a pointer to an array of tokens for messages that are currently in-flight (pending completion).

MQTTAsync_getVersionInfo

This function returns version information about the library. no trace information will be returned. The default trace level is MQTTASYNC_TRACE_MINIMUM @return an array of strings describing the library. The last entry is a NULL pointer.

MQTTAsync_global_init

Global init of mqtt library. Call once on program start to set global behaviour. handle_openssl_init - if mqtt library should handle openssl init (1) or rely on the caller to init it before using mqtt (0)

MQTTAsync_isComplete
MQTTAsync_isConnected

This function allows the client application to test whether or not a client is currently connected to the MQTT server. @param handle A valid client handle from a successful call to MQTTAsync_create(). @return Boolean true if the client is connected, otherwise false.

MQTTAsync_malloc

This function is used to allocate memory to be used or freed by the MQTT C client library, especially the data in the ::MQTTPersistence_afterRead and ::MQTTPersistence_beforeWrite callbacks. This is needed on Windows when the client library and application program have been compiled with different versions of the C compiler. @param size The size of the memory to be allocated.

MQTTAsync_reconnect

Reconnects a client with the previously used connect options. Connect must have previously been called for this to work. @param handle A valid client handle from a successful call to MQTTAsync_create(). @return ::MQTTASYNC_SUCCESS if the callbacks were correctly set, ::MQTTASYNC_FAILURE if an error occurred.

MQTTAsync_send

This function attempts to publish a message to a given topic (see also ::MQTTAsync_sendMessage()). An ::MQTTAsync_token is issued when this function returns successfully if the QoS is greater than 0. If the client application needs to test for successful delivery of messages, a callback should be set (see ::MQTTAsync_onSuccess() and ::MQTTAsync_deliveryComplete()). @param handle A valid client handle from a successful call to MQTTAsync_create(). @param destinationName The topic associated with this message. @param payloadlen The length of the payload in bytes. @param payload A pointer to the byte array payload of the message. @param qos The @ref qos of the message. @param retained The retained flag for the message. @param response A pointer to an ::MQTTAsync_responseOptions structure. Used to set callback functions. This is optional and can be set to NULL. @return ::MQTTASYNC_SUCCESS if the message is accepted for publication. An error code is returned if there was a problem accepting the message.

MQTTAsync_sendMessage

This function attempts to publish a message to a given topic (see also MQTTAsync_publish()). An ::MQTTAsync_token is issued when this function returns successfully if the QoS is greater than 0. If the client application needs to test for successful delivery of messages, a callback should be set (see ::MQTTAsync_onSuccess() and ::MQTTAsync_deliveryComplete()). @param handle A valid client handle from a successful call to MQTTAsync_create(). @param destinationName The topic associated with this message. @param msg A pointer to a valid MQTTAsync_message structure containing the payload and attributes of the message to be published. @param response A pointer to an ::MQTTAsync_responseOptions structure. Used to set callback functions. @return ::MQTTASYNC_SUCCESS if the message is accepted for publication. An error code is returned if there was a problem accepting the message.

MQTTAsync_setAfterPersistenceRead

Sets the MQTTPersistence_afterRead() callback function for a client. @param handle A valid client handle from a successful call to MQTTAsync_create(). @param context A pointer to any application-specific context. The the context pointer is passed to the callback function to provide access to the context information in the callback. @param co A pointer to an MQTTPersistence_beforeWrite() callback function. NULL removes the callback setting.

MQTTAsync_setBeforePersistenceWrite

Sets the MQTTPersistence_beforeWrite() callback function for a client. @param handle A valid client handle from a successful call to MQTTAsync_create(). @param context A pointer to any application-specific context. The the context pointer is passed to the callback function to provide access to the context information in the callback. @param co A pointer to an MQTTPersistence_beforeWrite() callback function. NULL removes the callback setting.

MQTTAsync_setCallbacks

This function sets the global callback functions for a specific client. If your client application doesn't use a particular callback, set the relevant parameter to NULL. Any necessary message acknowledgements and status communications are handled in the background without any intervention from the client application. If you do not set a messageArrived callback function, you will not be notified of the receipt of any messages as a result of a subscription.

MQTTAsync_setConnected

Sets the MQTTAsync_connected() callback function for a client. @param handle A valid client handle from a successful call to MQTTAsync_create(). @param context A pointer to any application-specific context. The the context pointer is passed to each of the callback functions to provide access to the context information in the callback. @param co A pointer to an MQTTAsync_connected() callback function. NULL removes the callback setting. @return ::MQTTASYNC_SUCCESS if the callbacks were correctly set, ::MQTTASYNC_FAILURE if an error occurred.

MQTTAsync_setConnectionLostCallback

This function sets the callback function for a connection lost event for a specific client. Any necessary message acknowledgements and status communications are handled in the background without any intervention from the client application.

MQTTAsync_setDeliveryCompleteCallback

This function sets the callback function for a delivery complete event for a specific client. Any necessary message acknowledgements and status communications are handled in the background without any intervention from the client application.

MQTTAsync_setDisconnected

Sets the MQTTAsync_disconnected() callback function for a client. @param handle A valid client handle from a successful call to MQTTAsync_create().

MQTTAsync_setMessageArrivedCallback

This function sets the callback function for a message arrived event for a specific client. Any necessary message acknowledgements and status communications are handled in the background without any intervention from the client application. If you do not set a messageArrived callback function, you will not be notified of the receipt of any messages as a result of a subscription.

MQTTAsync_setTraceCallback

This function sets the trace callback if needed. If set to NULL, no trace information will be returned. The default trace level is MQTTASYNC_TRACE_MINIMUM. @param callback a pointer to the function which will handle the trace information

MQTTAsync_setTraceLevel

This function sets the level of trace information which will be returned in the trace callback. @param level the trace level required

MQTTAsync_setUpdateConnectOptions

Sets the MQTTAsync_updateConnectOptions() callback function for a client. @param handle A valid client handle from a successful call to MQTTAsync_create(). @param context A pointer to any application-specific context. The the context pointer is passed to each of the callback functions to provide access to the context information in the callback. @param co A pointer to an MQTTAsync_updateConnectOptions() callback function. NULL removes the callback setting.

MQTTAsync_strerror

Returns a pointer to a string representation of the error code, or NULL. Do not free after use. Returns NULL if the error code is unknown. @param code the MQTTASYNC_ return code. @return a static string representation of the error code.

MQTTAsync_subscribe

This function attempts to subscribe a client to a single topic, which may contain wildcards (see @ref wildcard). This call also specifies the @ref qos requested for the subscription (see also MQTTAsync_subscribeMany()). @param handle A valid client handle from a successful call to MQTTAsync_create(). @param topic The subscription topic, which may include wildcards. @param qos The requested quality of service for the subscription. @param response A pointer to a response options structure. Used to set callback functions. @return ::MQTTASYNC_SUCCESS if the subscription request is successful. An error code is returned if there was a problem registering the subscription.

MQTTAsync_subscribeMany

This function attempts to subscribe a client to a list of topics, which may contain wildcards (see @ref wildcard). This call also specifies the @ref qos requested for each topic (see also MQTTAsync_subscribe()). @param handle A valid client handle from a successful call to MQTTAsync_create(). @param count The number of topics for which the client is requesting subscriptions. @param topic An array (of length count) of pointers to topics, each of which may include wildcards. @param qos An array (of length count) of @ref qos values. qos[n] is the requested QoS for topic[n]. @param response A pointer to a response options structure. Used to set callback functions. @return ::MQTTASYNC_SUCCESS if the subscription request is successful. An error code is returned if there was a problem registering the subscriptions.

MQTTAsync_unsubscribe

This function attempts to remove an existing subscription made by the specified client. @param handle A valid client handle from a successful call to MQTTAsync_create(). @param topic The topic for the subscription to be removed, which may include wildcards (see @ref wildcard). @param response A pointer to a response options structure. Used to set callback functions. @return ::MQTTASYNC_SUCCESS if the subscription is removed. An error code is returned if there was a problem removing the subscription.

MQTTAsync_unsubscribeMany

This function attempts to remove existing subscriptions to a list of topics made by the specified client. @param handle A valid client handle from a successful call to MQTTAsync_create(). @param count The number subscriptions to be removed. @param topic An array (of length count) of pointers to the topics of the subscriptions to be removed, each of which may include wildcards. @param response A pointer to a response options structure. Used to set callback functions. @return ::MQTTASYNC_SUCCESS if the subscriptions are removed. An error code is returned if there was a problem removing the subscriptions.

MQTTAsync_waitForCompletion

Waits for a request corresponding to a token to complete. This only works for messages with QoS greater than 0. A QoS 0 message has no MQTT token. This function will always return ::MQTTASYNC_SUCCESS for a QoS 0 message.

MQTTProperties_add

Add a property pointer to the property array. There is no memory allocation. @param props The property list to add the property to. @param prop The property to add to the list. @return 0 on success, -1 on failure.

MQTTProperties_copy

Copy the contents of a property list, allocating additional memory if needed. @param props pointer to the property list. @return the duplicated property list.

MQTTProperties_free

Free all memory allocated to the property list, including any to individual properties. @param properties pointer to the property list.

MQTTProperties_getNumericValue

Returns the integer value of a specific property. The property given must be a numeric type. @param props pointer to the property list. @param propid the property id to check for. @return the integer value of the property. -9999999 on failure.

MQTTProperties_getNumericValueAt

Returns the integer value of a specific property when it's not the only instance. The property given must be a numeric type. @param props pointer to the property list. @param propid the property id to check for. @param index the instance number, starting at 0. @return the integer value of the property. -9999999 on failure.

MQTTProperties_getProperty

Returns a pointer to the property structure for a specific property. @param props pointer to the property list. @param propid the property id to check for. @return the pointer to the property structure if found. NULL if not found.

MQTTProperties_getPropertyAt

Returns a pointer to the property structure for a specific property when it's not the only instance. @param props pointer to the property list. @param propid the property id to check for. @param index the instance number, starting at 0. @return the pointer to the property structure if found. NULL if not found.

MQTTProperties_hasProperty

Checks if property list contains a specific property. @param props pointer to the property list. @param propid the property id to check for. @return 1 if found, 0 if not.

MQTTProperties_len

Returns the length of the properties structure when serialized ready for network transmission. @param props an MQTT V5 property structure. @return the length in bytes of the properties when serialized.

MQTTProperties_propertyCount

Returns the number of instances of a property id. Most properties can exist only once. User properties and subscription ids can exist more than once. @param props pointer to the property list. @param propid the property id to check for. @return the number of times found. Can be 0.

MQTTProperties_read

Reads a property list from a character buffer into an array. @param properties pointer to the property list to be filled. Should be initalized but empty. @param pptr pointer to the character buffer. @param enddata pointer to the end of the character buffer so we don't read beyond. @return 1 if the properties were read successfully.

MQTTProperties_write

Serialize the given property list to a character buffer, e.g. for writing to the network. @param pptr pointer to the buffer - move the pointer as we add data @param properties pointer to the property list, can be NULL @return whether the write succeeded or not: number of bytes written, or < 0 on failure.

MQTTPropertyName

Returns a printable string description of an MQTT V5 property code. @param value an MQTT V5 property code. @return the printable string description of the input property code. NULL if the code was not found.

MQTTProperty_getType

Returns the MQTT V5 type code of an MQTT V5 property. @param value an MQTT V5 property code. @return the MQTT V5 type code of the input property. -1 if the code was not found.

MQTTReasonCode_toString

Returns a printable string description of an MQTT V5 reason code. @param value an MQTT V5 reason code. @return the printable string description of the input reason code. NULL if the code was not found.

_IO_feof
_IO_ferror
_IO_flockfile
_IO_free_backup_area
_IO_ftrylockfile
_IO_funlockfile
_IO_getc
_IO_padn
_IO_peekc_locked
_IO_putc
_IO_seekoff
_IO_seekpos
_IO_sgetn
_IO_vfprintf
_IO_vfscanf
__getdelim
__overflow
__uflow
__underflow
clearerr
clearerr_unlocked
ctermid
dprintf
fclose
fdopen
feof
feof_unlocked
ferror
ferror_unlocked
fflush
fflush_unlocked
fgetc
fgetc_unlocked
fgetpos
fgets
fileno
fileno_unlocked
flockfile
fmemopen
fopen
fprintf
fputc
fputc_unlocked
fputs
fread
fread_unlocked
freopen
fscanf
fscanf1
fseek
fseeko
fsetpos
ftell
ftello
ftrylockfile
funlockfile
fwrite
fwrite_unlocked
getc
getc_unlocked
getchar
getchar_unlocked
getdelim
getline
getw
open_memstream
pclose
perror
popen
printf
putc
putc_unlocked
putchar
putchar_unlocked
puts
putw
remove
rename
renameat
rewind
scanf
scanf1
setbuf
setbuffer
setlinebuf
setvbuf
snprintf
sprintf
sscanf
sscanf1
tempnam
tmpfile
tmpnam
tmpnam_r
ungetc
vdprintf
vfprintf
vfscanf
vfscanf1
vprintf
vscanf
vscanf1
vsnprintf
vsprintf
vsscanf
vsscanf1

Type Definitions

FILE
MQTTASYNC_TRACE_LEVELS
MQTTAsync

A handle representing an MQTT client. A valid client handle is available following a successful call to MQTTAsync_create().

MQTTAsync_callOptions

A synonym for responseOptions to better reflect its usage since MQTT 5.0

MQTTAsync_connected

This is a callback function, which will be called when the client library successfully connects. This is superfluous when the connection is made in response to a MQTTAsync_connect call, because the onSuccess callback can be used. It is intended for use when automatic reconnect is enabled, so that when a reconnection attempt succeeds in the background, the application is notified and can take any required actions.

MQTTAsync_connectionLost

This is a callback function. The client application must provide an implementation of this function to enable asynchronous notification of the loss of connection to the server. The function is registered with the client library by passing it as an argument to MQTTAsync_setCallbacks(). It is called by the client library if the client loses its connection to the server. The client application must take appropriate action, such as trying to reconnect or reporting the problem. This function is executed on a separate thread to the one on which the client application is running.

MQTTAsync_deliveryComplete

This is a callback function. The client application must provide an implementation of this function to enable asynchronous notification of delivery of messages to the server. The function is registered with the client library by passing it as an argument to MQTTAsync_setCallbacks(). It is called by the client library after the client application has published a message to the server. It indicates that the necessary handshaking and acknowledgements for the requested quality of service (see MQTTAsync_message.qos) have been completed. This function is executed on a separate thread to the one on which the client application is running.

MQTTAsync_disconnected

This is a callback function, which will be called when the client library receives a disconnect packet.

MQTTAsync_messageArrived

This is a callback function. The client application must provide an implementation of this function to enable asynchronous receipt of messages. The function is registered with the client library by passing it as an argument to MQTTAsync_setCallbacks(). It is called by the client library when a new message that matches a client subscription has been received from the server. This function is executed on a separate thread to the one on which the client application is running.

MQTTAsync_onFailure

This is a callback function. The client application must provide an implementation of this function to enable asynchronous notification of the unsuccessful completion of an API call. The function is registered with the client library by passing it as an argument in ::MQTTAsync_responseOptions.

MQTTAsync_onFailure5

This is a callback function, the MQTT V5 version of ::MQTTAsync_onFailure. The application must provide an implementation of this function to enable asynchronous notification of the unsuccessful completion of an API call. The function is registered with the client library by passing it as an argument in ::MQTTAsync_responseOptions.

MQTTAsync_onSuccess

This is a callback function. The client application must provide an implementation of this function to enable asynchronous notification of the successful completion of an API call. The function is registered with the client library by passing it as an argument in ::MQTTAsync_responseOptions.

MQTTAsync_onSuccess5

This is a callback function, the MQTT V5 version of ::MQTTAsync_onSuccess. The client application must provide an implementation of this function to enable asynchronous notification of the successful completion of an API call. The function is registered with the client library by passing it as an argument in ::MQTTAsync_responseOptions.

MQTTAsync_token

A value representing an MQTT message. A token is returned to the client application when a message is published. The token can then be used to check that the message was successfully delivered to its destination (see MQTTAsync_publish(), MQTTAsync_publishMessage(), MQTTAsync_deliveryComplete(), and MQTTAsync_getPendingTokens()).

MQTTAsync_traceCallback

This is a callback function prototype which must be implemented if you want to receive trace information. @param level the trace level of the message returned @param message the trace message. This is a pointer to a static buffer which will be overwritten on each call. You must copy the data if you want to keep it for later.

MQTTAsync_updateConnectOptions

This is a callback function which will allow the client application to update the connection data. @param data The connection data which can be modified by the application. @return Return a non-zero value to update the connect data, zero to keep the same data.

MQTTPersistence_afterRead

A callback which is invoked just after a read from persistence. This can be used to transform the data, for instance to decrypt it. @param context The context as set in ::MQTTAsync_setAfterPersistenceRead @param buffer The address of a pointer to a buffer. @param buflen The address of an int that is the length of the buffer. @return Return 0 if the function completes successfully, otherwise non 0.

MQTTPersistence_beforeWrite

A callback which is invoked just before a write to persistence. This can be used to transform the data, for instance to encrypt it. @param context The context as set in ::MQTTAsync_setBeforePersistenceWrite @param bufcount The number of buffers to write to the persistence store. @param buffers An array of pointers to the data buffers. @param buflens An array of lengths of the data buffers. @return Return 0 if the function completes successfully, otherwise non 0.

MQTTPropertyCodes

The one byte MQTT V5 property indicator

MQTTPropertyTypes

The one byte MQTT V5 property type

MQTTReasonCodes

The MQTT V5 one byte reason code

Persistence_clear

@brief Clears the persistence store, so that it no longer contains any persisted data.

Persistence_close

@brief Close the persistent store referred to by the handle.

Persistence_containskey

@brief Returns whether any data has been persisted using the specified key.

Persistence_get

@brief Retrieve the specified data from the persistent store.

Persistence_keys

@brief Returns the keys in this persistent data store.

Persistence_open

@brief Initialize the persistent store.

Persistence_put

@brief Put the specified data into the persistent store.

Persistence_remove

@brief Remove the data for the specified key from the store.

_IO_lock_t
__FILE
__blkcnt64_t
__blkcnt_t
__blksize_t
__builtin_va_list
__caddr_t
__clock_t
__clockid_t
__codecvt_result
__daddr_t
__dev_t
__fsblkcnt64_t
__fsblkcnt_t
__fsfilcnt64_t
__fsfilcnt_t
__fsword_t
__gid_t
__gnuc_va_list
__id_t
__ino64_t
__ino_t
__int8_t
__int16_t
__int32_t
__int64_t
__intmax_t
__intptr_t
__io_close_fn
__io_read_fn
__io_seek_fn
__io_write_fn
__key_t
__loff_t
__mode_t
__nlink_t
__off64_t
__off_t
__pid_t
__quad_t
__rlim64_t
__rlim_t
__sig_atomic_t
__socklen_t
__ssize_t
__suseconds_t
__syscall_slong_t
__syscall_ulong_t
__time_t
__timer_t
__u_char
__u_int
__u_long
__u_quad_t
__u_short
__uid_t
__uint8_t
__uint16_t
__uint32_t
__uint64_t
__uintmax_t
__useconds_t
fpos_t
off_t
size_t
ssize_t
va_list

Unions

MQTTAsync_successData5__bindgen_ty_1

A union of the different values that can be returned for subscribe, unsubscribe and publish.

MQTTAsync_successData__bindgen_ty_1

A union of the different values that can be returned for subscribe, unsubscribe and publish.

MQTTProperty__bindgen_ty_1

The value of the property, as a union of the different possible types.

__mbstate_t__bindgen_ty_1