docs(ble/bluedroid): Optimize doc for registering BLE callback functions

This commit is contained in:
zhanghaipeng
2024-07-10 14:58:34 +08:00
parent 3cb2d9c3c6
commit d84ccadf90
5 changed files with 10 additions and 4 deletions

View File

@@ -1593,6 +1593,8 @@ typedef void (* esp_gap_ble_cb_t)(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_p
* *
* @param[in] callback: callback function * @param[in] callback: callback function
* *
* @note Avoid performing time-consuming operations within the callback functions.
*
* @return * @return
* - ESP_OK : success * - ESP_OK : success
* - other : failed * - other : failed

View File

@@ -266,6 +266,8 @@ typedef void (* esp_gattc_cb_t)(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_
* *
* @param[in] callback : pointer to the application callback function. * @param[in] callback : pointer to the application callback function.
* *
* @note Avoid performing time-consuming operations within the callback functions.
*
* @return * @return
* - ESP_OK: success * - ESP_OK: success
* - other: failed * - other: failed

View File

@@ -289,6 +289,8 @@ typedef void (* esp_gatts_cb_t)(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_
* @brief This function is called to register application callbacks * @brief This function is called to register application callbacks
* with BTA GATTS module. * with BTA GATTS module.
* *
* @note Avoid performing time-consuming operations within the callback functions.
*
* @return * @return
* - ESP_OK : success * - ESP_OK : success
* - other : failed * - other : failed

View File

@@ -493,15 +493,15 @@ void app_main(void)
ESP_LOGE(GATTC_TAG, "%s enable bluetooth failed: %s", __func__, esp_err_to_name(ret)); ESP_LOGE(GATTC_TAG, "%s enable bluetooth failed: %s", __func__, esp_err_to_name(ret));
return; return;
} }
// Note: Avoid performing time-consuming operations within callback functions.
//register the callback function to the gap module // Register the callback function to the gap module
ret = esp_ble_gap_register_callback(esp_gap_cb); ret = esp_ble_gap_register_callback(esp_gap_cb);
if (ret){ if (ret){
ESP_LOGE(GATTC_TAG, "%s gap register failed, error code = %x", __func__, ret); ESP_LOGE(GATTC_TAG, "%s gap register failed, error code = %x", __func__, ret);
return; return;
} }
//register the callback function to the gattc module // Register the callback function to the gattc module
ret = esp_ble_gattc_register_callback(esp_gattc_cb); ret = esp_ble_gattc_register_callback(esp_gattc_cb);
if(ret){ if(ret){
ESP_LOGE(GATTC_TAG, "%s gattc register failed, error code = %x", __func__, ret); ESP_LOGE(GATTC_TAG, "%s gattc register failed, error code = %x", __func__, ret);

View File

@@ -725,7 +725,7 @@ void app_main(void)
ESP_LOGE(GATTS_TAG, "%s enable bluetooth failed: %s", __func__, esp_err_to_name(ret)); ESP_LOGE(GATTS_TAG, "%s enable bluetooth failed: %s", __func__, esp_err_to_name(ret));
return; return;
} }
// Note: Avoid performing time-consuming operations within callback functions.
ret = esp_ble_gatts_register_callback(gatts_event_handler); ret = esp_ble_gatts_register_callback(gatts_event_handler);
if (ret){ if (ret){
ESP_LOGE(GATTS_TAG, "gatts register error, error code = %x", ret); ESP_LOGE(GATTS_TAG, "gatts register error, error code = %x", ret);