Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
M
 Memory allocation
 mosquitto.h
 mosquitto_auth_acl_check
 mosquitto_auth_plugin_cleanup
 mosquitto_auth_plugin_init
 mosquitto_auth_plugin_version
 mosquitto_auth_security_cleanup
 mosquitto_auth_security_init
 mosquitto_auth_start
 mosquitto_auth_unpwd_check
 mosquitto_broker.h
 mosquitto_broker_publish
 mosquitto_broker_publish_copy
 mosquitto_callback_register
 mosquitto_callback_unregister
 mosquitto_calloc
 mosquitto_client_address
 mosquitto_client_certificate
 mosquitto_client_clean_session
 mosquitto_client_id
 mosquitto_client_keepalive
 mosquitto_client_protocol
 mosquitto_client_protocol_version
 mosquitto_client_sub_count
 mosquitto_client_username
 mosquitto_connack_string
 mosquitto_connect
 mosquitto_connect_async
 mosquitto_connect_bind
 mosquitto_connect_bind_async
 mosquitto_connect_bind_v5
 mosquitto_connect_callback_set
 mosquitto_connect_srv
 mosquitto_connect_v5_callback_set
 mosquitto_connect_with_flags_callback_set
 mosquitto_destroy
 mosquitto_disconnect
 mosquitto_disconnect_callback_set
 mosquitto_disconnect_v5
 mosquitto_disconnect_v5_callback_set
 mosquitto_free
 mosquitto_int_option
 mosquitto_kick_client_by_clientid
 mosquitto_kick_client_by_username
 mosquitto_lib_cleanup
 mosquitto_lib_init
 mosquitto_lib_version
 mosquitto_log_callback_set
 mosquitto_log_printf
 mosquitto_loop
 mosquitto_loop_forever
 mosquitto_loop_misc
 mosquitto_loop_read
 mosquitto_loop_start
 mosquitto_loop_stop
 mosquitto_loop_write
 mosquitto_malloc
 mosquitto_max_inflight_messages_set
 mosquitto_message_callback_set
 mosquitto_message_copy
 mosquitto_message_free
 mosquitto_message_free_contents
 mosquitto_message_retry_set
 mosquitto_message_v5_callback_set
 mosquitto_new
 mosquitto_opts_set
 mosquitto_plugin.h
 mosquitto_plugin_cleanup
 mosquitto_plugin_init
 mosquitto_plugin_version
 mosquitto_property_add_binary
 mosquitto_property_add_byte
 mosquitto_property_add_int16
 mosquitto_property_add_int32
 mosquitto_property_add_string
 mosquitto_property_add_string_pair
 mosquitto_property_add_varint
 mosquitto_property_check_all
 mosquitto_property_check_command
 mosquitto_property_copy_all
 mosquitto_property_free_all
 mosquitto_property_identifier
 mosquitto_property_identifier_to_string
 mosquitto_property_next
 mosquitto_property_read_binary
 mosquitto_property_read_byte
 mosquitto_property_read_int16
 mosquitto_property_read_int32
 mosquitto_property_read_string
 mosquitto_property_read_string_pair
 mosquitto_property_read_varint
 mosquitto_psk_key_get
 mosquitto_pub_topic_check
 mosquitto_pub_topic_check2
 mosquitto_publish
 mosquitto_publish_callback_set
 mosquitto_publish_v5
 mosquitto_publish_v5_callback_set
 mosquitto_realloc
 mosquitto_reason_string
 mosquitto_reconnect
 mosquitto_reconnect_async
 mosquitto_reconnect_delay_set
 mosquitto_reinitialise
 mosquitto_set_username
 mosquitto_socket
 mosquitto_socks5_set
 mosquitto_ssl_get
 mosquitto_strdup
 mosquitto_strerror
 mosquitto_string_option
 mosquitto_string_to_command
 mosquitto_string_to_property_info
 mosquitto_sub_topic_check
 mosquitto_sub_topic_check2
 mosquitto_sub_topic_tokenise
 mosquitto_sub_topic_tokens_free
 mosquitto_subscribe
 mosquitto_subscribe_callback
 mosquitto_subscribe_callback_set
 mosquitto_subscribe_multiple
 mosquitto_subscribe_simple
 mosquitto_subscribe_v5
 mosquitto_subscribe_v5_callback_set
 mosquitto_threaded_set
 mosquitto_tls_insecure_set
 mosquitto_tls_opts_set
 mosquitto_tls_psk_set
 mosquitto_tls_set
 mosquitto_topic_matches_sub
 mosquitto_topic_matches_sub2
 mosquitto_unsubscribe
 mosquitto_unsubscribe_callback_set
 mosquitto_unsubscribe_multiple
 mosquitto_unsubscribe_v5
 mosquitto_unsubscribe_v5_callback_set
 mosquitto_user_data_set
 mosquitto_userdata
 mosquitto_username_pw_set
 mosquitto_validate_utf8
 mosquitto_void_option
 mosquitto_want_write
 mosquitto_will_clear
 mosquitto_will_set
 mosquitto_will_set_v5
 MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER
 MQTT_PROP_AUTHENTICATION_DATA
 MQTT_PROP_AUTHENTICATION_METHOD
 MQTT_PROP_CONTENT_TYPE
 MQTT_PROP_CORRELATION_DATA
 MQTT_PROP_MAXIMUM_PACKET_SIZE
 MQTT_PROP_MAXIMUM_QOS
 MQTT_PROP_MESSAGE_EXPIRY_INTERVAL
 MQTT_PROP_PAYLOAD_FORMAT_INDICATOR
 MQTT_PROP_REASON_STRING
 MQTT_PROP_RECEIVE_MAXIMUM
 MQTT_PROP_REQUEST_PROBLEM_INFORMATION
 MQTT_PROP_REQUEST_RESPONSE_INFORMATION
 MQTT_PROP_RESPONSE_INFORMATION
 MQTT_PROP_RESPONSE_TOPIC
 MQTT_PROP_RETAIN_AVAILABLE
 MQTT_PROP_SERVER_KEEP_ALIVE
 MQTT_PROP_SERVER_REFERENCE
 MQTT_PROP_SESSION_EXPIRY_INTERVAL
 MQTT_PROP_SHARED_SUB_AVAILABLE
 MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE
 MQTT_PROP_SUBSCRIPTION_IDENTIFIER
 MQTT_PROP_TOPIC_ALIAS
 MQTT_PROP_TOPIC_ALIAS_MAXIMUM
 MQTT_PROP_USER_PROPERTY
 MQTT_PROP_WILDCARD_SUB_AVAILABLE
 MQTT_PROP_WILL_DELAY_INTERVAL
 mqtt_protocol.h
 MQTT_RC_ADMINISTRATIVE_ACTION
 MQTT_RC_BAD_AUTHENTICATION_METHOD
 MQTT_RC_BAD_USERNAME_OR_PASSWORD
 MQTT_RC_BANNED
 MQTT_RC_CLIENTID_NOT_VALID
 MQTT_RC_CONNECTION_RATE_EXCEEDED
 MQTT_RC_CONTINUE_AUTHENTICATION
 MQTT_RC_DISCONNECT_WITH_WILL_MSG
 MQTT_RC_GRANTED_QOS0
 MQTT_RC_GRANTED_QOS1
 MQTT_RC_GRANTED_QOS2
 MQTT_RC_IMPLEMENTATION_SPECIFIC
 MQTT_RC_KEEP_ALIVE_TIMEOUT
 MQTT_RC_MALFORMED_PACKET
 MQTT_RC_MAXIMUM_CONNECT_TIME
 MQTT_RC_MESSAGE_RATE_TOO_HIGH
 MQTT_RC_NO_MATCHING_SUBSCRIBERS
 MQTT_RC_NO_SUBSCRIPTION_EXISTED
 MQTT_RC_NORMAL_DISCONNECTION
 MQTT_RC_NOT_AUTHORIZED
 MQTT_RC_PACKET_ID_IN_USE
 MQTT_RC_PACKET_ID_NOT_FOUND
 MQTT_RC_PACKET_TOO_LARGE
 MQTT_RC_PAYLOAD_FORMAT_INVALID
 MQTT_RC_PROTOCOL_ERROR
 MQTT_RC_QOS_NOT_SUPPORTED
 MQTT_RC_QUOTA_EXCEEDED
 MQTT_RC_REAUTHENTICATE
 MQTT_RC_RECEIVE_MAXIMUM_EXCEEDED
 MQTT_RC_RETAIN_NOT_SUPPORTED
 MQTT_RC_SERVER_BUSY
 MQTT_RC_SERVER_MOVED
 MQTT_RC_SERVER_SHUTTING_DOWN
 MQTT_RC_SERVER_UNAVAILABLE
 MQTT_RC_SESSION_TAKEN_OVER
 MQTT_RC_SHARED_SUBS_NOT_SUPPORTED
 MQTT_RC_SUBSCRIPTION_IDS_NOT_SUPPORTED
 MQTT_RC_SUCCESS
 MQTT_RC_TOPIC_ALIAS_INVALID
 MQTT_RC_TOPIC_FILTER_INVALID
 MQTT_RC_TOPIC_NAME_INVALID
 MQTT_RC_UNSPECIFIED
 MQTT_RC_UNSUPPORTED_PROTOCOL_VERSION
 MQTT_RC_USE_ANOTHER_SERVER
 MQTT_RC_WILDCARD_SUBS_NOT_SUPPORTED
 MQTT_SUB_OPT_NO_LOCAL
 MQTT_SUB_OPT_RETAIN_AS_PUBLISHED
 MQTT_SUB_OPT_SEND_RETAIN_ALWAYS
 MQTT_SUB_OPT_SEND_RETAIN_NEVER
 MQTT_SUB_OPT_SEND_RETAIN_NEW
 mqtt311_connack_codes
 mqtt5_property
 mqtt5_return_codes
 mqtt5_sub_options
Use these functions when allocating or freeing memory to have your memory included in the memory tracking on the broker.
This header contains functions and definitions for use with libmosquitto, the Mosquitto client library.
mosq_plugin_EXPORT int mosquitto_auth_acl_check(
   void *user_data,
   int access,
   struct mosquitto *client,
   const struct mosquitto_acl_msg *msg
)
Called by the broker when topic access must be checked.
mosq_plugin_EXPORT int mosquitto_auth_plugin_cleanup(
   void *user_data,
   struct mosquitto_opt *opts,
   int opt_count
)
Called when the broker is shutting down.
mosq_plugin_EXPORT int mosquitto_auth_plugin_init(void **user_data,
struct mosquitto_opt *opts,
int opt_count)
Called after the plugin has been loaded and mosquitto_auth_plugin_version has been called.
mosq_plugin_EXPORT int mosquitto_auth_plugin_version(void)
The broker will call this function immediately after loading the plugin to check it is a supported plugin version.
mosq_plugin_EXPORT int mosquitto_auth_security_cleanup(
   void *user_data,
   struct mosquitto_opt *opts,
   int opt_count,
   bool reload
)
1.
mosq_plugin_EXPORT int mosquitto_auth_security_init(
   void *user_data,
   struct mosquitto_opt *opts,
   int opt_count,
   bool reload
)
1.
mosq_plugin_EXPORT int mosquitto_auth_start(void *user_data,
struct mosquitto *client,
const char *method,
bool reauth,
const void *data_in,
uint16_t data_in_len,
void **data_out,
uint16_t *data_out_len)
This function is OPTIONAL.
mosq_plugin_EXPORT int mosquitto_auth_unpwd_check(void *user_data,
struct mosquitto *client,
const char *username,
const char *password)
This function is OPTIONAL.
This header contains functions for use by plugins.
mosq_EXPORT int mosquitto_broker_publish(const char *clientid,
const char *topic,
int payloadlen,
void *payload,
int qos,
bool retain,
mosquitto_property *properties)
Publish a message from within a plugin.
mosq_EXPORT int mosquitto_broker_publish_copy(const char *clientid,
const char *topic,
int payloadlen,
const void *payload,
int qos,
bool retain,
mosquitto_property *properties)
Publish a message from within a plugin.
mosq_EXPORT int mosquitto_callback_register(mosquitto_plugin_id_t *identifier,
int event,
MOSQ_FUNC_generic_callback cb_func,
const void *event_data,
void *userdata)
Register a callback for an event.
mosq_EXPORT int mosquitto_callback_unregister(
   mosquitto_plugin_id_t *identifier,
   int event,
   MOSQ_FUNC_generic_callback cb_func,
   const void *event_data
)
Unregister a previously registered callback function.
mosq_EXPORT void *mosquitto_calloc(size_t nmemb,
size_t size)
mosq_EXPORT const char *mosquitto_client_address(
   const struct mosquitto *client
)
Retrieve the IP address of the client as a string.
mosq_EXPORT void *mosquitto_client_certificate(const struct mosquitto *client)
If TLS support is enabled, return the certificate provided by a client as an X509 pointer from openssl.
mosq_EXPORT bool mosquitto_client_clean_session(const struct mosquitto *client)
Retrieve the clean session flag value for a client.
mosq_EXPORT const char *mosquitto_client_id(const struct mosquitto *client)
Retrieve the client id associated with a client.
mosq_EXPORT int mosquitto_client_keepalive(const struct mosquitto *client)
Retrieve the keepalive value for a client.
mosq_EXPORT int mosquitto_client_protocol(const struct mosquitto *client)
mp_mqtt (MQTT over TCP) mp_mqttsn (MQTT-SN) mp_websockets (MQTT over Websockets)
mosq_EXPORT int mosquitto_client_protocol_version(
   const struct mosquitto *client
)
mosq_EXPORT int mosquitto_client_sub_count(const struct mosquitto *client)
Retrieve the number of subscriptions that have been made by a client.
mosq_EXPORT const char *mosquitto_client_username(
   const struct mosquitto *client
)
Retrieve the username associated with a client.
libmosq_EXPORT const char *mosquitto_connack_string(int connack_code)
Call to obtain a const string description of an MQTT connection result.
libmosq_EXPORT int mosquitto_connect(struct mosquitto *mosq,
const char *host,
int port,
int keepalive)
Connect to an MQTT broker.
libmosq_EXPORT int mosquitto_connect_async(struct mosquitto *mosq,
const char *host,
int port,
int keepalive)
Connect to an MQTT broker.
libmosq_EXPORT int mosquitto_connect_bind(struct mosquitto *mosq,
const char *host,
int port,
int keepalive,
const char *bind_address)
Connect to an MQTT broker.
libmosq_EXPORT int mosquitto_connect_bind_async(struct mosquitto *mosq,
const char *host,
int port,
int keepalive,
const char *bind_address)
Connect to an MQTT broker.
libmosq_EXPORT int mosquitto_connect_bind_v5(
   struct mosquitto *mosq,
   const char *host,
   int port,
   int keepalive,
   const char *bind_address,
   const mosquitto_property *properties
)
Connect to an MQTT broker.
libmosq_EXPORT void mosquitto_connect_callback_set(
   struct mosquitto *mosq,
   void (*on_connect)(struct mosquitto *, void *, int)
)
Set the connect callback.
libmosq_EXPORT int mosquitto_connect_srv(struct mosquitto *mosq,
const char *host,
int keepalive,
const char *bind_address)
Connect to an MQTT broker.
libmosq_EXPORT void mosquitto_connect_v5_callback_set(
   struct mosquitto *mosq,
   void (*on_connect)(struct mosquitto *, void *, int, int, const mosquitto_property *props)
)
Set the connect callback.
libmosq_EXPORT void mosquitto_connect_with_flags_callback_set(
   struct mosquitto *mosq,
   void (*on_connect)(struct mosquitto *, void *, int, int)
)
Set the connect callback.
libmosq_EXPORT void mosquitto_destroy(struct mosquitto *mosq)
Use to free memory associated with a mosquitto client instance.
libmosq_EXPORT int mosquitto_disconnect(struct mosquitto *mosq)
Disconnect from the broker.
libmosq_EXPORT void mosquitto_disconnect_callback_set(
   struct mosquitto *mosq,
   void (*on_disconnect)(struct mosquitto *, void *, int)
)
Set the disconnect callback.
libmosq_EXPORT int mosquitto_disconnect_v5(
   struct mosquitto *mosq,
   int reason_code,
   const mosquitto_property *properties
)
Disconnect from the broker, with attached MQTT properties.
libmosq_EXPORT void mosquitto_disconnect_v5_callback_set(
   struct mosquitto *mosq,
   void (*on_disconnect)(struct mosquitto *, void *, int, const mosquitto_property *)
)
Set the disconnect callback.
mosq_EXPORT void mosquitto_free(void *mem)
libmosq_EXPORT int mosquitto_int_option(struct mosquitto *mosq,
enum mosq_opt_t option,
int value)
Used to set integer options for the client.
mosq_EXPORT int mosquitto_kick_client_by_clientid(const char *clientid,
bool with_will)
Forcefully disconnect a client from the broker.
mosq_EXPORT int mosquitto_kick_client_by_username(const char *username,
bool with_will)
Forcefully disconnect a client from the broker.
libmosq_EXPORT int mosquitto_lib_cleanup(void)
Call to free resources associated with the library.
libmosq_EXPORT int mosquitto_lib_init(void)
Must be called before any other mosquitto functions.
libmosq_EXPORT int mosquitto_lib_version(int *major,
int *minor,
int *revision)
Can be used to obtain version information for the mosquitto library.
libmosq_EXPORT void mosquitto_log_callback_set(
   struct mosquitto *mosq,
   void (*on_log)(struct mosquitto *, void *, int, const char *)
)
Set the logging callback.
mosq_EXPORT void mosquitto_log_printf(int level,
const char *fmt,
 ...)
Write a log message using the broker configured logging.
libmosq_EXPORT int mosquitto_loop(struct mosquitto *mosq,
int timeout,
int max_packets)
The main network loop for the client.
libmosq_EXPORT int mosquitto_loop_forever(struct mosquitto *mosq,
int timeout,
int max_packets)
This function call loop() for you in an infinite blocking loop.
libmosq_EXPORT int mosquitto_loop_misc(struct mosquitto *mosq)
Carry out miscellaneous operations required as part of the network loop.
libmosq_EXPORT int mosquitto_loop_read(struct mosquitto *mosq,
int max_packets)
Carry out network read operations.
libmosq_EXPORT int mosquitto_loop_start(struct mosquitto *mosq)
This is part of the threaded client interface.
libmosq_EXPORT int mosquitto_loop_stop(struct mosquitto *mosq,
bool force)
This is part of the threaded client interface.
libmosq_EXPORT int mosquitto_loop_write(struct mosquitto *mosq,
int max_packets)
Carry out network write operations.
mosq_EXPORT void *mosquitto_malloc(size_t size)
libmosq_EXPORT int mosquitto_max_inflight_messages_set(
   struct mosquitto *mosq,
   unsigned int max_inflight_messages
)
This function is deprected.
libmosq_EXPORT void mosquitto_message_callback_set(
   struct mosquitto *mosq,
   void (*on_message)(struct mosquitto *, void *, const struct mosquitto_message *)
)
Set the message callback.
libmosq_EXPORT int mosquitto_message_copy(struct mosquitto_message *dst,
const struct mosquitto_message *src)
Copy the contents of a mosquitto message to another message.
libmosq_EXPORT void mosquitto_message_free(struct mosquitto_message **message)
Completely free a mosquitto_message struct.
libmosq_EXPORT void mosquitto_message_free_contents(
   struct mosquitto_message *message
)
Free a mosquitto_message struct contents, leaving the struct unaffected.
libmosq_EXPORT void mosquitto_message_retry_set(struct mosquitto *mosq,
unsigned int message_retry)
This function now has no effect.
libmosq_EXPORT void mosquitto_message_v5_callback_set(
   struct mosquitto *mosq,
   void (*on_message)(struct mosquitto *, void *, const struct mosquitto_message *, const mosquitto_property *)
)
Set the message callback.
libmosq_EXPORT struct mosquitto *mosquitto_new(const char *id,
bool clean_session,
void *obj)
Create a new mosquitto client instance.
libmosq_EXPORT int mosquitto_opts_set(struct mosquitto *mosq,
enum mosq_opt_t option,
void *value)
Used to set options for the client.
This header contains function declarations for use when writing a Mosquitto plugin.
mosq_plugin_EXPORT int mosquitto_plugin_cleanup(void *userdata,
struct mosquitto_opt *options,
int option_count)
Called when the broker is shutting down.
mosq_plugin_EXPORT int mosquitto_plugin_init(mosquitto_plugin_id_t *identifier,
void **userdata,
struct mosquitto_opt *options,
int option_count)
Called after the plugin has been loaded and mosquitto_plugin_version has been called.
mosq_plugin_EXPORT int mosquitto_plugin_version(int supported_version_count,
const int *supported_versions)
The broker will attempt to call this function immediately after loading the plugin to check it is a supported plugin version.
libmosq_EXPORT int mosquitto_property_add_binary(mosquitto_property **proplist,
int identifier,
const void *value,
uint16_t len)
Add a new binary property to a property list.
libmosq_EXPORT int mosquitto_property_add_byte(mosquitto_property **proplist,
int identifier,
uint8_t value)
Add a new byte property to a property list.
libmosq_EXPORT int mosquitto_property_add_int16(mosquitto_property **proplist,
int identifier,
uint16_t value)
Add a new int16 property to a property list.
libmosq_EXPORT int mosquitto_property_add_int32(mosquitto_property **proplist,
int identifier,
uint32_t value)
Add a new int32 property to a property list.
libmosq_EXPORT int mosquitto_property_add_string(mosquitto_property **proplist,
int identifier,
const char *value)
Add a new string property to a property list.
libmosq_EXPORT int mosquitto_property_add_string_pair(
   mosquitto_property **proplist,
   int identifier,
   const char *name,
   const char *value
)
Add a new string pair property to a property list.
libmosq_EXPORT int mosquitto_property_add_varint(mosquitto_property **proplist,
int identifier,
uint32_t value)
Add a new varint property to a property list.
libmosq_EXPORT int mosquitto_property_check_all(
   int command,
   const mosquitto_property *properties
)
Check whether a list of properties are valid for a particular command, whether there are duplicates, and whether the values are valid where possible.
libmosq_EXPORT int mosquitto_property_check_command(int command,
int identifier)
Check whether a property identifier is valid for the given command.
libmosq_EXPORT int mosquitto_property_copy_all(mosquitto_property **dest,
const mosquitto_property *src)
libmosq_EXPORT void mosquitto_property_free_all(mosquitto_property **properties)
Free all properties from a list of properties.
libmosq_EXPORT int mosquitto_property_identifier(
   const mosquitto_property *property
)
Return the property identifier for a single property.
libmosq_EXPORT const char *mosquitto_property_identifier_to_string(
   int identifier
)
Return the property name as a string for a property identifier.
libmosq_EXPORT const mosquitto_property *mosquitto_property_next(
   const mosquitto_property *proplist
)
Return the next property in a property list.
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_binary(
   const mosquitto_property *proplist,
   int identifier,
   void **value,
   uint16_t *len,
   bool skip_first
)
Read a binary property value from a property.
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_byte(
   const mosquitto_property *proplist,
   int identifier,
   uint8_t *value,
   bool skip_first
)
Attempt to read a byte property matching an identifier, from a property list or single property.
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_int16(
   const mosquitto_property *proplist,
   int identifier,
   uint16_t *value,
   bool skip_first
)
Read an int16 property value from a property.
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_int32(
   const mosquitto_property *proplist,
   int identifier,
   uint32_t *value,
   bool skip_first
)
Read an int32 property value from a property.
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_string(
   const mosquitto_property *proplist,
   int identifier,
   char **value,
   bool skip_first
)
Read a string property value from a property.
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_string_pair(
   const mosquitto_property *proplist,
   int identifier,
   char **name,
   char **value,
   bool skip_first
)
Read a string pair property value pair from a property.
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_varint(
   const mosquitto_property *proplist,
   int identifier,
   uint32_t *value,
   bool skip_first
)
Read a varint property value from a property.
This function is OPTIONAL.
libmosq_EXPORT int mosquitto_pub_topic_check(const char *topic)
Check whether a topic to be used for publishing is valid.
libmosq_EXPORT int mosquitto_pub_topic_check2(const char *topic,
size_t topiclen)
Check whether a topic to be used for publishing is valid.
libmosq_EXPORT int mosquitto_publish(struct mosquitto *mosq,
int *mid,
const char *topic,
int payloadlen,
const void *payload,
int qos,
bool retain)
Publish a message on a given topic.
libmosq_EXPORT void mosquitto_publish_callback_set(
   struct mosquitto *mosq,
   void (*on_publish)(struct mosquitto *, void *, int)
)
Set the publish callback.
libmosq_EXPORT int mosquitto_publish_v5(struct mosquitto *mosq,
int *mid,
const char *topic,
int payloadlen,
const void *payload,
int qos,
bool retain,
const mosquitto_property *properties)
Publish a message on a given topic, with attached MQTT properties.
libmosq_EXPORT void mosquitto_publish_v5_callback_set(
   struct mosquitto *mosq,
   void (*on_publish)(struct mosquitto *, void *, int, int, const mosquitto_property *)
)
Set the publish callback.
mosq_EXPORT void *mosquitto_realloc(void *ptr,
size_t size)
libmosq_EXPORT const char *mosquitto_reason_string(int reason_code)
Call to obtain a const string description of an MQTT reason code.
libmosq_EXPORT int mosquitto_reconnect(struct mosquitto *mosq)
Reconnect to a broker.
libmosq_EXPORT int mosquitto_reconnect_async(struct mosquitto *mosq)
Reconnect to a broker.
libmosq_EXPORT int mosquitto_reconnect_delay_set(
   struct mosquitto *mosq,
   unsigned int reconnect_delay,
   unsigned int reconnect_delay_max,
   bool reconnect_exponential_backoff
)
Control the behaviour of the client when it has unexpectedly disconnected in mosquitto_loop_forever or after mosquitto_loop_start.
libmosq_EXPORT int mosquitto_reinitialise(struct mosquitto *mosq,
const char *id,
bool clean_session,
void *obj)
This function allows an existing mosquitto client to be reused.
mosq_EXPORT int mosquitto_set_username(struct mosquitto *client,
const char *username)
Set the username for a client.
libmosq_EXPORT int mosquitto_socket(struct mosquitto *mosq)
Return the socket handle for a mosquitto instance.
libmosq_EXPORT int mosquitto_socks5_set(struct mosquitto *mosq,
const char *host,
int port,
const char *username,
const char *password)
Configure the client to use a SOCKS5 proxy when connecting.
libmosq_EXPORT void *mosquitto_ssl_get(struct mosquitto *mosq)
Retrieve a pointer to the SSL structure used for TLS connections in this client.
mosq_EXPORT char *mosquitto_strdup(const char *s)
libmosq_EXPORT const char *mosquitto_strerror(int mosq_errno)
Call to obtain a const string description of a mosquitto error number.
libmosq_EXPORT int mosquitto_string_option(struct mosquitto *mosq,
enum mosq_opt_t option,
const char *value)
Used to set const char* options for the client.
libmosq_EXPORT int mosquitto_string_to_command(const char *str,
int *cmd)
Take a string input representing an MQTT command and convert it to the libmosquitto integer representation.
libmosq_EXPORT int mosquitto_string_to_property_info(const char *propname,
int *identifier,
int *type)
Parse a property name string and convert to a property identifier and data type.
libmosq_EXPORT int mosquitto_sub_topic_check(const char *topic)
Check whether a topic to be used for subscribing is valid.
libmosq_EXPORT int mosquitto_sub_topic_check2(const char *topic,
size_t topiclen)
Check whether a topic to be used for subscribing is valid.
libmosq_EXPORT int mosquitto_sub_topic_tokenise(const char *subtopic,
char ***topics,
int *count)
Tokenise a topic or subscription string into an array of strings representing the topic hierarchy.
libmosq_EXPORT int mosquitto_sub_topic_tokens_free(char ***topics,
int count)
Free memory that was allocated in mosquitto_sub_topic_tokenise.
libmosq_EXPORT int mosquitto_subscribe(struct mosquitto *mosq,
int *mid,
const char *sub,
int qos)
Subscribe to a topic.
libmosq_EXPORT int mosquitto_subscribe_callback(
   int (*callback)(struct mosquitto *, void *, const struct mosquitto_message *),
   void *userdata,
   const char *topic,
   int qos,
   const char *host,
   int port,
   const char *client_id,
   int keepalive,
   bool clean_session,
   const char *username,
   const char *password,
   const struct libmosquitto_will *will,
   const struct libmosquitto_tls *tls
)
Helper function to make subscribing to a topic and processing some messages very straightforward.
libmosq_EXPORT void mosquitto_subscribe_callback_set(
   struct mosquitto *mosq,
   void (*on_subscribe)(struct mosquitto *, void *, int, int, const int *)
)
Set the subscribe callback.
libmosq_EXPORT int mosquitto_subscribe_multiple(
   struct mosquitto *mosq,
   int *mid,
   int sub_count,
   char *const *const sub,
   int qos,
   int options,
   const mosquitto_property *properties
)
Subscribe to multiple topics.
libmosq_EXPORT int mosquitto_subscribe_simple(
   struct mosquitto_message **messages,
   int msg_count,
   bool want_retained,
   const char *topic,
   int qos,
   const char *host,
   int port,
   const char *client_id,
   int keepalive,
   bool clean_session,
   const char *username,
   const char *password,
   const struct libmosquitto_will *will,
   const struct libmosquitto_tls *tls
)
Helper function to make subscribing to a topic and retrieving some messages very straightforward.
libmosq_EXPORT int mosquitto_subscribe_v5(struct mosquitto *mosq,
int *mid,
const char *sub,
int qos,
int options,
const mosquitto_property *properties)
Subscribe to a topic, with attached MQTT properties.
libmosq_EXPORT void mosquitto_subscribe_v5_callback_set(
   struct mosquitto *mosq,
   void (*on_subscribe)(struct mosquitto *, void *, int, int, const int *, const mosquitto_property *)
)
Set the subscribe callback.
libmosq_EXPORT int mosquitto_threaded_set(struct mosquitto *mosq,
bool threaded)
Used to tell the library that your application is using threads, but not using mosquitto_loop_start.
libmosq_EXPORT int mosquitto_tls_insecure_set(struct mosquitto *mosq,
bool value)
Configure verification of the server hostname in the server certificate.
libmosq_EXPORT int mosquitto_tls_opts_set(struct mosquitto *mosq,
int cert_reqs,
const char *tls_version,
const char *ciphers)
Set advanced SSL/TLS options.
libmosq_EXPORT int mosquitto_tls_psk_set(struct mosquitto *mosq,
const char *psk,
const char *identity,
const char *ciphers)
Configure the client for pre-shared-key based TLS support.
libmosq_EXPORT int mosquitto_tls_set(
   struct mosquitto *mosq,
   const char *cafile,
   const char *capath,
   const char *certfile,
   const char *keyfile,
   int (*pw_callback)(char *buf, int size, int rwflag, void *userdata)
)
Configure the client for certificate based SSL/TLS support.
libmosq_EXPORT int mosquitto_topic_matches_sub(const char *sub,
const char *topic,
bool *result)
Check whether a topic matches a subscription.
libmosq_EXPORT int mosquitto_topic_matches_sub2(const char *sub,
size_t sublen,
const char *topic,
size_t topiclen,
bool *result)
Check whether a topic matches a subscription.
libmosq_EXPORT int mosquitto_unsubscribe(struct mosquitto *mosq,
int *mid,
const char *sub)
Unsubscribe from a topic.
libmosq_EXPORT void mosquitto_unsubscribe_callback_set(
   struct mosquitto *mosq,
   void (*on_unsubscribe)(struct mosquitto *, void *, int)
)
Set the unsubscribe callback.
libmosq_EXPORT int mosquitto_unsubscribe_multiple(
   struct mosquitto *mosq,
   int *mid,
   int sub_count,
   char *const *const sub,
   const mosquitto_property *properties
)
Unsubscribe from multiple topics.
libmosq_EXPORT int mosquitto_unsubscribe_v5(
   struct mosquitto *mosq,
   int *mid,
   const char *sub,
   const mosquitto_property *properties
)
Unsubscribe from a topic, with attached MQTT properties.
libmosq_EXPORT void mosquitto_unsubscribe_v5_callback_set(
   struct mosquitto *mosq,
   void (*on_unsubscribe)(struct mosquitto *, void *, int, const mosquitto_property *)
)
Set the unsubscribe callback.
libmosq_EXPORT void mosquitto_user_data_set(struct mosquitto *mosq,
void *obj)
When mosquitto_new is called, the pointer given as the “obj” parameter will be passed to the callbacks as user data.
libmosq_EXPORT void *mosquitto_userdata(struct mosquitto *mosq)
Retrieve the “userdata” variable for a mosquitto client.
libmosq_EXPORT int mosquitto_username_pw_set(struct mosquitto *mosq,
const char *username,
const char *password)
Configure username and password for a mosquitto instance.
libmosq_EXPORT int mosquitto_validate_utf8(const char *str,
int len)
Helper function to validate whether a UTF-8 string is valid, according to the UTF-8 spec and the MQTT additions.
libmosq_EXPORT int mosquitto_void_option(struct mosquitto *mosq,
enum mosq_opt_t option,
void *value)
Used to set void* options for the client.
libmosq_EXPORT bool mosquitto_want_write(struct mosquitto *mosq)
Returns true if there is data ready to be written on the socket.
libmosq_EXPORT int mosquitto_will_clear(struct mosquitto *mosq)
Remove a previously configured will.
libmosq_EXPORT int mosquitto_will_set(struct mosquitto *mosq,
const char *topic,
int payloadlen,
const void *payload,
int qos,
bool retain)
Configure will information for a mosquitto instance.
libmosq_EXPORT int mosquitto_will_set_v5(struct mosquitto *mosq,
const char *topic,
int payloadlen,
const void *payload,
int qos,
bool retain,
mosquitto_property *properties)
Configure will information for a mosquitto instance, with attached properties.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
property option.
This header contains definitions of MQTT values as defined in the specifications.
152
140
134
138
133
159
24
4
0
1
2
131
141
129
160
150
16
17
0
135
145
146
149
153
130
155
151
25
147
154
137
157
139
136
142
158
161
0
148
143
144
128
132
156
162
with this option set, if this client publishes to a topic to which it is subscribed, the broker will not publish the message back to the client.
with this option set, messages published for this subscription will keep the retain flag as was set by the publishing client.
with this option set, pre-existing retained messages are sent as soon as the subscription is made, even if the subscription already exists.
with this option set, pre-existing retained messages will never be sent for this subscription.
with this option set, pre-existing retained messages for this subscription will be sent when the subscription is made, but only if the subscription does not already exist.
The CONNACK results for MQTT v3.1.1, and v3.1.
Options for use with MQTTv5 properties.
The reason codes returned in various MQTT commands.
Options for use with MQTTv5 subscriptions.
Close