Skip to content

Commit

Permalink
Add getter for BLE GATTS callback
Browse files Browse the repository at this point in the history
  • Loading branch information
hypnosvirtual-deploy committed Sep 11, 2023
1 parent 6d04316 commit cf9dd32
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/bt/host/bluedroid/api/esp_gatts_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ esp_err_t esp_ble_gatts_register_callback(esp_gatts_cb_t callback)
return (btc_profile_cb_set(BTC_PID_GATTS, callback) == 0 ? ESP_OK : ESP_FAIL);
}

esp_gatts_cb_t esp_ble_gatts_get_callback(void)
{
return (esp_gatts_cb_t) btc_profile_cb_get(BTC_PID_GATTS);
}

esp_err_t esp_ble_gatts_app_register(uint16_t app_id)
{
btc_msg_t msg = {0};
Expand Down
10 changes: 10 additions & 0 deletions components/bt/host/bluedroid/api/include/api/esp_gatts_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,16 @@ typedef void (* esp_gatts_cb_t)(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_
*/
esp_err_t esp_ble_gatts_register_callback(esp_gatts_cb_t callback);

/**
* @brief This function is called to get the current application callbacks
* with BTA GATTS module.
*
* @return
* - esp_gatts_cb_t : current callback
*
*/
esp_gatts_cb_t esp_ble_gatts_get_callback(void);

/**
* @brief This function is called to register application identifier
*
Expand Down

0 comments on commit cf9dd32

Please sign in to comment.