fix(ble/bluedroid): Remove BLE functions discard declaration

fix(nt/bluedroid): Split the device name set functions

feat(bt/bluedroid): added APIs to get/set device name on BT GAP side

change(bt/common): Marked some APIs in device module as deprecated

1. esp_bt_dev_set_device_name
2. esp_bt_dev_get_device_name

change(bt/bluedroid): use BT GAP APIs to set/get device name in bluetooth classic examples

change(bt/bluedroid): use BT/BLE GAP APIs to set/get device name in coexist examples
This commit is contained in:
zhiweijian
2024-04-03 11:53:08 +08:00
parent 5725595d84
commit b9a1756202
62 changed files with 395 additions and 174 deletions
@@ -665,7 +665,7 @@ esp_err_t esp_hid_ble_gap_adv_init(uint16_t appearance, const char *device_name)
//esp_ble_io_cap_t iocap = ESP_IO_CAP_OUT;//you have to enter the key on the host
//esp_ble_io_cap_t iocap = ESP_IO_CAP_IN;//you have to enter the key on the device
esp_ble_io_cap_t iocap = ESP_IO_CAP_IO;//you have to agree that key matches on both
//esp_ble_io_cap_t iocap = ESP_IO_CAP_NONE;//device is not capable of input or output, unsecure
//esp_ble_io_cap_t iocap = ESP_IO_CAP_NONE;//device is not capable of input or output, insecure
uint8_t init_key = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
uint8_t rsp_key = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
uint8_t key_size = 16; //the key size should be 7~16 bytes
@@ -701,7 +701,7 @@ esp_err_t esp_hid_ble_gap_adv_init(uint16_t appearance, const char *device_name)
return ret;
}
if ((ret = esp_bt_dev_set_device_name(device_name)) != ESP_OK) {
if ((ret = esp_ble_gap_set_device_name(device_name)) != ESP_OK) {
ESP_LOGE(TAG, "GAP set_device_name failed: %d", ret);
return ret;
}