Function esp_idf_svc::hal::sys::esp_mqtt_client_subscribe_single
source ยท pub unsafe extern "C" fn esp_mqtt_client_subscribe_single(
client: *mut esp_mqtt_client,
topic: *const i8,
qos: i32,
) -> i32
Expand description
@brief Subscribe the client to defined topic with defined qos
Notes:
- Client must be connected to send subscribe message
- This API is could be executed from a user task or from a MQTT event callback i.e. internal MQTT task (API is protected by internal mutex, so it might block if a longer data receive operation is in progress.
esp_mqtt_client_subscribe
could be used to call this function.
@param client MQTT client handle @param topic topic filter to subscribe @param qos Max qos level of the subscription
@return message_id of the subscribe message on success -1 on failure -2 in case of full outbox.