From 89db2b75dc9714e29137077873202af21e697e3f Mon Sep 17 00:00:00 2001 From: Yuhan Wei Date: Mon, 26 Aug 2024 14:04:09 +0800 Subject: [PATCH] fix(ble): Removed the C5 support for examples in ble_get_started --- .../ble_get_started/nimble/NimBLE_Beacon/README.md | 8 ++++---- .../nimble/NimBLE_Connection/README.md | 10 +++++----- .../NimBLE_Connection/sdkconfig.defaults.esp32c5 | 2 -- .../nimble/NimBLE_GATT_Server/README.md | 12 ++++++------ .../NimBLE_GATT_Server/sdkconfig.defaults.esp32c5 | 2 -- .../ble_get_started/nimble/NimBLE_Security/README.md | 4 ++-- .../NimBLE_Security/sdkconfig.defaults.esp32c5 | 2 -- 7 files changed, 17 insertions(+), 23 deletions(-) delete mode 100644 examples/bluetooth/ble_get_started/nimble/NimBLE_Connection/sdkconfig.defaults.esp32c5 delete mode 100644 examples/bluetooth/ble_get_started/nimble/NimBLE_GATT_Server/sdkconfig.defaults.esp32c5 delete mode 100644 examples/bluetooth/ble_get_started/nimble/NimBLE_Security/sdkconfig.defaults.esp32c5 diff --git a/examples/bluetooth/ble_get_started/nimble/NimBLE_Beacon/README.md b/examples/bluetooth/ble_get_started/nimble/NimBLE_Beacon/README.md index f619b8dd14..5d9c10b752 100644 --- a/examples/bluetooth/ble_get_started/nimble/NimBLE_Beacon/README.md +++ b/examples/bluetooth/ble_get_started/nimble/NimBLE_Beacon/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | # NimBLE Beacon Example @@ -85,7 +85,7 @@ void app_main(void) { } ``` -Then, call `nimble_port_init` function to initialize NimBLE host stack. +Then, call `nimble_port_init` function to initialize NimBLE host stack. ``` C void app_main(void) { @@ -186,7 +186,7 @@ void app_main(void) { /* Start NimBLE host task thread and return */ xTaskCreate(nimble_host_task, "NimBLE Host", 4*1024, NULL, 5, NULL); - return; + return; } ``` diff --git a/examples/bluetooth/ble_get_started/nimble/NimBLE_Connection/README.md b/examples/bluetooth/ble_get_started/nimble/NimBLE_Connection/README.md index c5011ad4c9..065de9dd21 100644 --- a/examples/bluetooth/ble_get_started/nimble/NimBLE_Connection/README.md +++ b/examples/bluetooth/ble_get_started/nimble/NimBLE_Connection/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | # NimBLE Connection Example @@ -71,7 +71,7 @@ Please refer to the NimBLE Beacon Example for details. ### Start Advertising -There're some slight differences in this example when compared to NimBLE Beacon Example. First, in this example we are constructing a connectable peripheral, so connection mode is set to connectable, that is +There're some slight differences in this example when compared to NimBLE Beacon Example. First, in this example we are constructing a connectable peripheral, so connection mode is set to connectable, that is ``` C static void start_advertising(void) { @@ -201,7 +201,7 @@ static int gap_event_handler(struct ble_gap_event *event, void *arg) { #### Disconnect Event -On disconnect event, we simply +On disconnect event, we simply 1. Print out disconnect reason and connection descriptor 2. Turn off the LED @@ -254,7 +254,7 @@ static int gap_event_handler(struct ble_gap_event *event, void *arg) { } print_conn_desc(&desc); return rc; - + ... } ``` diff --git a/examples/bluetooth/ble_get_started/nimble/NimBLE_Connection/sdkconfig.defaults.esp32c5 b/examples/bluetooth/ble_get_started/nimble/NimBLE_Connection/sdkconfig.defaults.esp32c5 deleted file mode 100644 index 053efed5b7..0000000000 --- a/examples/bluetooth/ble_get_started/nimble/NimBLE_Connection/sdkconfig.defaults.esp32c5 +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_BLINK_GPIO=6 -CONFIG_BLINK_LED_STRIP=y diff --git a/examples/bluetooth/ble_get_started/nimble/NimBLE_GATT_Server/README.md b/examples/bluetooth/ble_get_started/nimble/NimBLE_GATT_Server/README.md index d4aaed0aff..2c4ea30990 100644 --- a/examples/bluetooth/ble_get_started/nimble/NimBLE_GATT_Server/README.md +++ b/examples/bluetooth/ble_get_started/nimble/NimBLE_GATT_Server/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | # NimBLE GATT Server Example @@ -69,7 +69,7 @@ See the [Getting Started Guide](https://idf.espressif.com/) for full steps to co In this example, we call GATT `gatt_svr_init` function to initialize GATT server in `app_main` before NimBLE host configuration. This is a custom function defined in `gatt_svc.c`, and basically we just call GATT service initialization API and add services to registration queue. -And there's another code added in `nimble_host_config_init`, which is +And there's another code added in `nimble_host_config_init`, which is ``` C static void nimble_host_config_init(void) { @@ -147,7 +147,7 @@ static const struct ble_gatt_svc_def gatt_svr_svcs[] = { .val_handle = &led_chr_val_handle}, {0}}, }, - + { 0, /* No more services. */ }, @@ -301,12 +301,12 @@ static int gap_event_handler(struct ble_gap_event *event, void *arg) { /* GATT subscribe event callback */ gatt_svr_subscribe_cb(event); return rc; - + ... } ``` -Then we'll check connection handle and attribute handle, if the attribute handle matches `heart_rate_chr_val_chandle`, `heart_rate_chr_conn_handle` and `heart_rate_ind_status` will be updated together. +Then we'll check connection handle and attribute handle, if the attribute handle matches `heart_rate_chr_val_chandle`, `heart_rate_chr_conn_handle` and `heart_rate_ind_status` will be updated together. ``` C void gatt_svr_subscribe_cb(struct ble_gap_event *event) { diff --git a/examples/bluetooth/ble_get_started/nimble/NimBLE_GATT_Server/sdkconfig.defaults.esp32c5 b/examples/bluetooth/ble_get_started/nimble/NimBLE_GATT_Server/sdkconfig.defaults.esp32c5 deleted file mode 100644 index 053efed5b7..0000000000 --- a/examples/bluetooth/ble_get_started/nimble/NimBLE_GATT_Server/sdkconfig.defaults.esp32c5 +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_BLINK_GPIO=6 -CONFIG_BLINK_LED_STRIP=y diff --git a/examples/bluetooth/ble_get_started/nimble/NimBLE_Security/README.md b/examples/bluetooth/ble_get_started/nimble/NimBLE_Security/README.md index bb7bec7eb5..5c7d982a7e 100644 --- a/examples/bluetooth/ble_get_started/nimble/NimBLE_Security/README.md +++ b/examples/bluetooth/ble_get_started/nimble/NimBLE_Security/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | # NimBLE Security Example diff --git a/examples/bluetooth/ble_get_started/nimble/NimBLE_Security/sdkconfig.defaults.esp32c5 b/examples/bluetooth/ble_get_started/nimble/NimBLE_Security/sdkconfig.defaults.esp32c5 deleted file mode 100644 index 053efed5b7..0000000000 --- a/examples/bluetooth/ble_get_started/nimble/NimBLE_Security/sdkconfig.defaults.esp32c5 +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_BLINK_GPIO=6 -CONFIG_BLINK_LED_STRIP=y