From a5a7e60ad0bd0b00839310b6d28a87ae80fd0e94 Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Thu, 30 Nov 2023 10:42:49 +0800 Subject: [PATCH 1/3] docs(bt/bluedroid): Update ble example document --- .../gatt_server_service_table/main/gatts_table_creat_demo.c | 5 +++++ .../Gatt_Server_Service_Table_Example_Walkthrough.md | 1 + 2 files changed, 6 insertions(+) diff --git a/examples/bluetooth/bluedroid/ble/gatt_server_service_table/main/gatts_table_creat_demo.c b/examples/bluetooth/bluedroid/ble/gatt_server_service_table/main/gatts_table_creat_demo.c index 982927ef3b..cc43d728cc 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_server_service_table/main/gatts_table_creat_demo.c +++ b/examples/bluetooth/bluedroid/ble/gatt_server_service_table/main/gatts_table_creat_demo.c @@ -403,6 +403,11 @@ static void gatts_profile_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_ { indicate_data[i] = i % 0xff; } + + // if want to change the value in server database, call: + // esp_ble_gatts_set_attr_value(heart_rate_handle_table[IDX_CHAR_VAL_A], sizeof(indicate_data), indicate_data); + + //the size of indicate_data[] need less than MTU size esp_ble_gatts_send_indicate(gatts_if, param->write.conn_id, heart_rate_handle_table[IDX_CHAR_VAL_A], sizeof(indicate_data), indicate_data, true); diff --git a/examples/bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md b/examples/bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md index 7db332db2a..623043e713 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md +++ b/examples/bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md @@ -159,6 +159,7 @@ The application registration takes place inside ``app_main()`` using the ``esp_b ```c esp_ble_gatts_app_register(ESP_HEART_RATE_APP_ID); ``` +The ``ESP_HEART_RATE_APP_ID`` serves as an application ID, distinguishing between various application layer callbacks. This identifier corresponds to the ``app_id`` found within the ``gatts_reg_evt_param`` in ESP_GATTS_REG_EVT. ## Setting GAP Parameters From a1b678e7216a5ceeda5c2cb35395f77f1de46e44 Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Thu, 30 Nov 2023 10:43:12 +0800 Subject: [PATCH 2/3] fix(bt/bluedroid): Fix bluedroid menuconfig --- components/bt/host/bluedroid/Kconfig.in | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/components/bt/host/bluedroid/Kconfig.in b/components/bt/host/bluedroid/Kconfig.in index 479d0d6897..7b768745fd 100644 --- a/components/bt/host/bluedroid/Kconfig.in +++ b/components/bt/host/bluedroid/Kconfig.in @@ -1051,7 +1051,7 @@ config BT_ACL_CONNECTIONS config BT_MULTI_CONNECTION_ENBALE bool "Enable BLE multi-conections" - depends on BT_BLUEDROID_ENABLED + depends on BT_BLE_ENABLED default y help Enable this option if there are multiple connections @@ -1072,7 +1072,7 @@ config BT_BLE_DYNAMIC_ENV_MEMORY config BT_BLE_HOST_QUEUE_CONG_CHECK bool "BLE queue congestion check" - depends on BT_BLUEDROID_ENABLED + depends on BT_BLE_ENABLED default n help When scanning and scan duplicate is not enabled, if there are a lot of adv packets around @@ -1097,7 +1097,7 @@ config BT_BLE_ACT_SCAN_REP_ADV_SCAN config BT_BLE_ESTAB_LINK_CONN_TOUT int "Timeout of BLE connection establishment" - depends on BT_BLUEDROID_ENABLED + depends on BT_BLE_ENABLED range 1 60 default 30 help @@ -1133,7 +1133,7 @@ config BT_BLE_RPA_SUPPORTED config BT_BLE_RPA_TIMEOUT int "Timeout of resolvable private address" - depends on BT_BLUEDROID_ENABLED + depends on BT_BLE_ENABLED range 1 3600 default 900 help @@ -1142,14 +1142,14 @@ config BT_BLE_RPA_TIMEOUT config BT_BLE_50_FEATURES_SUPPORTED bool "Enable BLE 5.0 features" - depends on (BT_BLUEDROID_ENABLED && ((BT_CONTROLLER_ENABLED && SOC_BLE_50_SUPPORTED) || BT_CONTROLLER_DISABLED)) + depends on (BT_BLE_ENABLED && ((BT_CONTROLLER_ENABLED && SOC_BLE_50_SUPPORTED) || BT_CONTROLLER_DISABLED)) default y help - This enables BLE 5.0 features, this option only support esp32c3/esp32s3 chip + Enabling this option activates BLE 5.0 features. This option is universally supported in chips that support BLE, except for ESP32. config BT_BLE_42_FEATURES_SUPPORTED bool "Enable BLE 4.2 features" - depends on (BT_BLUEDROID_ENABLED && ((BT_CONTROLLER_ENABLED && SOC_BLE_SUPPORTED) || BT_CONTROLLER_DISABLED)) + depends on (BT_BLE_ENABLED && ((BT_CONTROLLER_ENABLED && SOC_BLE_SUPPORTED) || BT_CONTROLLER_DISABLED)) default n help This enables BLE 4.2 features. @@ -1170,7 +1170,7 @@ config BT_BLE_FEAT_PERIODIC_ADV_ENH config BT_BLE_HIGH_DUTY_ADV_INTERVAL bool "Enable BLE high duty advertising interval feature" - depends on BT_BLUEDROID_ENABLED + depends on BT_BLE_ENABLED default n help This enable BLE high duty advertising interval feature From d528cc598e774b289fb85efa8612e085b49d9097 Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Fri, 1 Dec 2023 16:55:40 +0800 Subject: [PATCH 3/3] fix(bt/bluedroid): Fix BLE SMP register log level --- components/bt/host/bluedroid/stack/smp/smp_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/bluedroid/stack/smp/smp_api.c b/components/bt/host/bluedroid/stack/smp/smp_api.c index df8f4cea21..78e295f4f1 100644 --- a/components/bt/host/bluedroid/stack/smp/smp_api.c +++ b/components/bt/host/bluedroid/stack/smp/smp_api.c @@ -125,7 +125,7 @@ BOOLEAN SMP_Register (tSMP_CALLBACK *p_cback) SMP_TRACE_EVENT ("SMP_Register state=%d", smp_cb.state); if (smp_cb.p_callback != NULL) { - SMP_TRACE_ERROR ("SMP_Register: duplicate registration, overwrite it"); + SMP_TRACE_WARNING ("SMP_Register: duplicate registration, overwrite it"); } smp_cb.p_callback = p_cback;