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_connack_string
 mosquitto_connect
 mosquitto_connect_async
 mosquitto_connect_bind
 mosquitto_connect_bind_async
 mosquitto_connect_callback_set
 mosquitto_connect_srv
 mosquitto_destroy
 mosquitto_disconnect
 mosquitto_disconnect_callback_set
 mosquitto_lib_cleanup
 mosquitto_lib_init
 mosquitto_lib_version
 mosquitto_log_callback_set
 mosquitto_loop
 mosquitto_loop_forever
 mosquitto_loop_misc
 mosquitto_loop_read
 mosquitto_loop_start
 mosquitto_loop_stop
 mosquitto_loop_write
 mosquitto_max_inflight_messages_set
 mosquitto_message_callback_set
 mosquitto_message_copy
 mosquitto_message_free
 mosquitto_message_free_contents
 mosquitto_message_retry_set
 mosquitto_new
 mosquitto_opts_set
 mosquitto_pub_topic_check
 mosquitto_publish
 mosquitto_publish_callback_set
 mosquitto_reconnect
 mosquitto_reconnect_async
 mosquitto_reconnect_delay_set
 mosquitto_reinitialise
 mosquitto_socket
 mosquitto_socks5_set
 mosquitto_strerror
 mosquitto_sub_topic_check
 mosquitto_sub_topic_tokenise
 mosquitto_sub_topic_tokens_free
 mosquitto_subscribe
 mosquitto_subscribe_callback
 mosquitto_subscribe_callback_set
 mosquitto_subscribe_simple
 mosquitto_threaded_set
 mosquitto_tls_insecure_set
 mosquitto_tls_opts_set
 mosquitto_tls_psk_set
 mosquitto_tls_set
 mosquitto_topic_matches_sub
 mosquitto_unsubscribe
 mosquitto_unsubscribe_callback_set
 mosquitto_user_data_set
 mosquitto_username_pw_set
 mosquitto_validate_utf8
 mosquitto_want_write
 mosquitto_will_clear
 mosquitto_will_set
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 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_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_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.
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.
libmosq_EXPORT int mosquitto_max_inflight_messages_set(
   struct mosquitto *mosq,
   unsigned int max_inflight_messages
)
Set the number of QoS 1 and 2 messages that can be “in flight” at one time.
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 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.
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_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_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.
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 const char *mosquitto_strerror(int mosq_errno)
Call to obtain a const string description of a mosquitto error number.
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_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_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_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_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 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 int mosquitto_username_pw_set(struct mosquitto *mosq,
const char *username,
const char *password)
Configure username and password for a mosquitton 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 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.
Close