pub unsafe extern "C" fn esp_mqtt_client_subscribe_single(
    client: esp_mqtt_client_handle_t,
    topic: *const c_char,
    qos: c_int
) -> c_int
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.