forked from espressif/esp-idf
fix(ble): Removed the C5 support for examples in ble_get_started
This commit is contained in:
@@ -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
|
# 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
|
``` C
|
||||||
void app_main(void) {
|
void app_main(void) {
|
||||||
@@ -186,7 +186,7 @@ void app_main(void) {
|
|||||||
|
|
||||||
/* Start NimBLE host task thread and return */
|
/* Start NimBLE host task thread and return */
|
||||||
xTaskCreate(nimble_host_task, "NimBLE Host", 4*1024, NULL, 5, NULL);
|
xTaskCreate(nimble_host_task, "NimBLE Host", 4*1024, NULL, 5, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@@ -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
|
# NimBLE Connection Example
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ Please refer to the NimBLE Beacon Example for details.
|
|||||||
|
|
||||||
### Start Advertising
|
### 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
|
``` C
|
||||||
static void start_advertising(void) {
|
static void start_advertising(void) {
|
||||||
@@ -201,7 +201,7 @@ static int gap_event_handler(struct ble_gap_event *event, void *arg) {
|
|||||||
|
|
||||||
#### Disconnect Event
|
#### Disconnect Event
|
||||||
|
|
||||||
On disconnect event, we simply
|
On disconnect event, we simply
|
||||||
|
|
||||||
1. Print out disconnect reason and connection descriptor
|
1. Print out disconnect reason and connection descriptor
|
||||||
2. Turn off the LED
|
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);
|
print_conn_desc(&desc);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@@ -1,2 +0,0 @@
|
|||||||
CONFIG_BLINK_GPIO=6
|
|
||||||
CONFIG_BLINK_LED_STRIP=y
|
|
@@ -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
|
# 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.
|
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
|
``` C
|
||||||
static void nimble_host_config_init(void) {
|
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},
|
.val_handle = &led_chr_val_handle},
|
||||||
{0}},
|
{0}},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
0, /* No more services. */
|
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 subscribe event callback */
|
||||||
gatt_svr_subscribe_cb(event);
|
gatt_svr_subscribe_cb(event);
|
||||||
return rc;
|
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
|
``` C
|
||||||
void gatt_svr_subscribe_cb(struct ble_gap_event *event) {
|
void gatt_svr_subscribe_cb(struct ble_gap_event *event) {
|
||||||
|
@@ -1,2 +0,0 @@
|
|||||||
CONFIG_BLINK_GPIO=6
|
|
||||||
CONFIG_BLINK_LED_STRIP=y
|
|
@@ -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
|
# NimBLE Security Example
|
||||||
|
|
||||||
|
@@ -1,2 +0,0 @@
|
|||||||
CONFIG_BLINK_GPIO=6
|
|
||||||
CONFIG_BLINK_LED_STRIP=y
|
|
Reference in New Issue
Block a user