feat(ble/bluedroid): Add getter for BLE GATTC calllback

This commit is contained in:
zhanghaipeng 2024-01-09 16:45:49 +08:00 committed by Wei Yu Han
parent 217ed6c1bf
commit 9b2e0a2a01
2 changed files with 16 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -29,6 +29,11 @@ esp_err_t esp_ble_gattc_register_callback(esp_gattc_cb_t callback)
return ESP_OK;
}
esp_gattc_cb_t esp_ble_gattc_get_callback(void)
{
return (esp_gattc_cb_t) btc_profile_cb_get(BTC_PID_GATTC);
}
esp_err_t esp_ble_gattc_app_register(uint16_t app_id)
{
btc_msg_t msg = {0};

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -273,6 +273,15 @@ typedef void (* esp_gattc_cb_t)(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_
*/
esp_err_t esp_ble_gattc_register_callback(esp_gattc_cb_t callback);
/**
* @brief This function is called to get the current application callbacks
* with BTA GATTC module.
*
* @return
* - esp_gattC_cb_t : current callback
*
*/
esp_gattc_cb_t esp_ble_gattc_get_callback(void);
/**
* @brief This function is called to register application callbacks