Function 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
 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_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_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
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.
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 *props)
)
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 *props)
)
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.
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 *props)
)
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 *props)
)
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 *props)
)
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.
Close