MQTTc_SubscribeMult
Send a 'Subscribe' message containing multiple topics to MQTT server.
Files
mqtt-c.h/mqtt-c.c
Prototype
void MQTTc_SubscribeMult ( MQTTc_CONN *p_conn, MQTTc_MSG *p_msg, const CPU_CHAR **topic_str_tbl, CPU_INT08U *req_qos_tbl, CPU_INT08U topic_nbr, MQTTc_ERR *p_err);
Arguments
p_conn
Pointer to MQTTc Connection to use.
p_msg
Pointer to MQTTc Message object to use.
topic_str_tbl
Table containing string of all the topic(s) at which to subscribe. Must all stay valid until the message has been completely sent.
req_qos_tbl
Table of the requested level of QoS for each subscription.
topic_nbr
Number of topic and QoS contained in tables.
p_err
Pointer to variable that will receive the return error code from this function:
MQTTc_ERR_NONE
MQTTc_ERR_NOT_INIT
MQTTc_ERR_NULL_PTR
MQTTc_ERR_INVALID_ARG
MQTTc_ERR_INVALID_BUF_SIZE
MQTTc_ERR_FAIL
Returned Values
None.
Required Configuration
None.
Notes / Warnings
- This function MUST be called after the µC/MQTT-client initialization has been completed.
- Both the
MQTTc_CONN
object and theMQTTc_MSG
object used MUST stay valid until the message has completed (callback has been called). To compare with the granted QoS returned by the server with the SUBACK message, the number of topics and their QoSes are kept before the actual content to send to the server.