mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
docs: Rebase and typos fixed for the bluetooth README files
This commit is contained in:
parent
2e008825a9
commit
cb646ff068
@ -5,8 +5,9 @@ Note: To use examples in this directory, you need to have Bluetooth enabled in c
|
||||
# Example Layout
|
||||
|
||||
The examples are grouped into subdirectories by category. Each category directory contains one or more example projects:
|
||||
* `classic_bt` contains Classic BT examples
|
||||
* `ble` contains BLE examples
|
||||
* `ble_50` contains BLE 5.0 examples
|
||||
* `classic_bt` contains Classic BT examples
|
||||
* `coex` contains Classic BT and BLE coex examples
|
||||
|
||||
See the [README.md](../../README.md) file in the upper level [examples](../../) directory for more information about examples.
|
||||
|
@ -1,21 +1,61 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
ESP-IDF BLE ANCS Example
|
||||
==========================
|
||||
# ESP-IDF BLE ANCS Example
|
||||
|
||||
The purpose of the Apple Notification Center Service (ANCS) is to give Bluetooth accessories (that connect to iOS devices through a Bluetooth low-energy link) a simple and convenient way to access many kinds of notifications that are generated on iOS devices.
|
||||
|
||||
The Apple Notification Center Service is a primary service whose service UUID is 7905F431-B5CE-4E99-A40F-4B1E122D00D0.
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
The Apple Notification Center Service is a primary service whose service UUID is:
|
||||
|
||||
`7905F431-B5CE-4E99-A40F-4B1E122D00D0`
|
||||
|
||||
Only one instance of the ANCS may be present on an NP. Due to the nature of iOS, the ANCS is not guaranteed to always be present. As a result, the NC should look for and subscribe to the Service Changed characteristic of the GATT service in order to monitor for the potential publishing and unpublishing of the ANCS at any time.
|
||||
|
||||
In its basic form, the ANCS exposes three characteristics:
|
||||
Notification Source: UUID 9FBF120D-6301-42D9-8C58-25E699A21DBD (notifiable)
|
||||
Control Point: UUID 69D1D8F3-45E1-49A8-9821-9BBDFDAAD9D9 (writeable with response)
|
||||
Data Source: UUID 22EAC6E9-24D6-4BB5-BE44-B36ACE7C7BFB (notifiable)
|
||||
Notification Source: UUID `9FBF120D-6301-42D9-8C58-25E699A21DBD` (notifiable)
|
||||
Control Point: UUID `69D1D8F3-45E1-49A8-9821-9BBDFDAAD9D9` (writeable with response)
|
||||
Data Source: UUID `22EAC6E9-24D6-4BB5-BE44-B36ACE7C7BFB` (notifiable)
|
||||
|
||||
All these characteristics require authorization for access.
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (0) cpu_start: Starting scheduler on APP CPU.
|
||||
I (558) BTDM_INIT: BT controller compile version [1342a48]
|
||||
I (568) system_api: Base MAC address is not set
|
||||
I (568) system_api: read default base MAC address from EFUSE
|
||||
I (568) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
|
||||
I (918) BLE_ANCS: app_main init bluetooth
|
||||
I (1018) BLE_ANCS: REG_EVT
|
||||
E (1028) BT_BTM: BTM_BleConfigLocalIcon
|
||||
|
||||
I (1058) BLE_ANCS: advertising start success
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,19 +1,41 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
ESP-IDF BLE Compatibility Test Example
|
||||
=======================================
|
||||
# ESP-IDF BLE Compatibility Test Example
|
||||
|
||||
This demo is to test the compatibility of Bluetooth and mobile phones.
|
||||
This example is to test the Bluetooth compatibility and mobile phones.
|
||||
|
||||
* ESP32 Module: ESP-WROOM-32
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
### Test Scenario
|
||||
|
||||
* ESP32 Module: ESP32-WROOM-32x
|
||||
* IDF version: 7c29a39d6f9f2dfbefc49d34d34e9267afc7200d
|
||||
|
||||
* [Test case](https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/bluedroid/ble/ble_compatibility_test/ble_compatibility_test_case.md)
|
||||
|
||||
* Test APK: LightBlue V1.1.3
|
||||
|
||||
* [Test report](https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/bluedroid/ble/ble_compatibility_test/esp_ble_compatibility_test_report.md)
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,25 +1,68 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
ESP-IDF Eddystone demo
|
||||
========================
|
||||
This example demonstrates Eddystone-compatible BLE scanning of eddystone frame,including UID,URL.
|
||||
# ESP-IDF Eddystone Example
|
||||
|
||||
This example demonstrates Eddystone-compatible BLE scanning of eddystone frame, including UID and URL.
|
||||
|
||||
Eddystone is an open beacon protocol specification from Google aimed at improving “proximity-based experiences”
|
||||
with support for both Android and iOS smart device platforms.
|
||||
|
||||
Learn more on https://developers.google.com/beacons and https://github.com/google/eddystone.
|
||||
Learn more on [Beacons](https://developers.google.com/nearby/notifications/get-started) and [Eddystone](https://github.com/google/eddystone).
|
||||
|
||||
esp_eddystone_protocol.h
|
||||
==========================
|
||||
This header file includes some eddystone-protocol related definitions.
|
||||
## How to Use Example
|
||||
|
||||
esp_eddystone_api.h & esp_eddystone_api.c
|
||||
===========================================
|
||||
These files contains the decoding and decoded result of an eddystone frame packet.
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
You just need to include esp_eddystone_protocol.h, esp_eddystone_api.h and esp_eddystone_api.c for development.
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
esp_eddystone_demo.c
|
||||
======================
|
||||
This is an example/demo of using esp_eddystone_protocol.h, esp_eddystone_api.h and esp_eddystone_api.c files to resolve eddystone packet.
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (0) cpu_start: Starting scheduler on APP CPU.
|
||||
I (585) BTDM_INIT: BT controller compile version [1342a48]
|
||||
I (585) system_api: Base MAC address is not set
|
||||
I (585) system_api: read default base MAC address from EFUSE
|
||||
I (595) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
|
||||
I (995) EDDYSTONE_DEMO: Register callback
|
||||
I (1005) EDDYSTONE_DEMO: Start scanning...
|
||||
I (18135) EDDYSTONE_DEMO: --------Eddystone Found----------
|
||||
I (18145) EDDYSTONE_DEMO: Device address:: 55 5d 3b ea 11 88
|
||||
I (18145) EDDYSTONE_DEMO: RSSI of packet:-46 dbm
|
||||
I (18145) EDDYSTONE_DEMO: Eddystone UID inform:
|
||||
I (18155) EDDYSTONE_DEMO: Measured power(RSSI at 0m distance):-65 dbm
|
||||
I (18155) EDDYSTONE_DEMO: EDDYSTONE_DEMO: Namespace ID:0x
|
||||
I (18165) EDDYSTONE_DEMO: 6e a8 0f c9 3b 13 8e 6d 91 78
|
||||
I (18175) EDDYSTONE_DEMO: EDDYSTONE_DEMO: Instance ID:0x
|
||||
I (18175) EDDYSTONE_DEMO: 01 01 01 00 00 00
|
||||
I (18275) EDDYSTONE_DEMO: --------Eddystone Found----------
|
||||
I (18275) EDDYSTONE_DEMO: Device address:: 55 5d 3b ea 11 88
|
||||
I (18275) EDDYSTONE_DEMO: RSSI of packet:-46 dbm
|
||||
I (18285) EDDYSTONE_DEMO: Eddystone UID inform:
|
||||
I (18285) EDDYSTONE_DEMO: Measured power(RSSI at 0m distance):-65 dbm
|
||||
I (18295) EDDYSTONE_DEMO: EDDYSTONE_DEMO: Namespace ID:0x
|
||||
I (18295) EDDYSTONE_DEMO: 6e a8 0f c9 3b 13 8e 6d 91 78
|
||||
I (18305) EDDYSTONE_DEMO: EDDYSTONE_DEMO: Instance ID:0x
|
||||
I (18315) EDDYSTONE_DEMO: 01 01 01 00 00 00
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,34 +1,83 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
ESP-IDF BLE HID device demo
|
||||
========================
|
||||
This example Implemented BLE HID device profile related functions, in which the HID device has
|
||||
4 Reports (1 is mouse, 2 is keyboard and LED, 3 is Consumer Devices, 4 is Vendor devices).
|
||||
# ESP-IDF BLE HID Example
|
||||
|
||||
This example implement a BLE HID device profile related functions, in which the HID device has 4 Reports:
|
||||
|
||||
1. Mouse
|
||||
2. Keyboard and LED
|
||||
3. Consumer Devices
|
||||
4. Vendor devices
|
||||
|
||||
Users can choose different reports according to their own application scenarios.
|
||||
BLE HID profile inheritance and USB HID class.
|
||||
|
||||
ble_hidd_demo_main.c
|
||||
==========================
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Configure the Project
|
||||
|
||||
* `ble_hidd_demo_main.c`
|
||||
This file is the demo to show how to used the HID(you can used it to connected to the smart phone act as the consumer device then can used the button to
|
||||
volume++ or volume-- etc., or connected to the Windows 10 PC act as a keyboard or mouse)
|
||||
|
||||
hidd_le_prf_int.h
|
||||
==========================
|
||||
* `hidd_le_prf_int.h`
|
||||
This header file includes some HID profile related definitions.
|
||||
|
||||
esp_hidd_prf_api.h & esp_hidd_prf_api.c
|
||||
===========================================
|
||||
* `esp_hidd_prf_api.h` & `esp_hidd_prf_api.c`
|
||||
These files contains the the api of the HID profile
|
||||
|
||||
When you used the HID profile, you just need to added the esp_hidd_prf_api.h includes file and send the HID data used the function defined in the esp_hidd_prf_api.c file.
|
||||
|
||||
hid_dev.h & hid_dev.c
|
||||
======================
|
||||
* `hid_dev.h & hid_dev.c`
|
||||
These file define the HID spec related definitions
|
||||
|
||||
hid_device_le_prf.c
|
||||
======================
|
||||
* `hid_device_le_prf.c`
|
||||
This file is the HID profile definition file, it include the main function of the HID profile.
|
||||
It mainly includes how to create HID service. If you send and receive HID data and convert the data to keyboard keys,
|
||||
the mouse and consumer values are forwarded to the application.
|
||||
the mouse and consumer values are forwarded to the application.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (0) cpu_start: Starting scheduler on APP CPU.
|
||||
I (584) BTDM_INIT: BT controller compile version [1342a48]
|
||||
I (584) system_api: Base MAC address is not set
|
||||
I (584) system_api: read default base MAC address from EFUSE
|
||||
I (594) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
|
||||
I (1024) HID_LE_PRF: esp_hidd_prf_cb_hdl(), start added the hid service to the stack database. incl_handle = 40
|
||||
I (1034) HID_LE_PRF: hid svc handle = 2d
|
||||
I (5964) HID_LE_PRF: HID connection establish, conn_id = 0
|
||||
I (5964) HID_DEMO: ESP_HIDD_EVENT_BLE_CONNECT
|
||||
I (6744) HID_DEMO: remote BD_ADDR: 7767f4abe386
|
||||
I (6744) HID_DEMO: address type = 1
|
||||
I (6744) HID_DEMO: pair status = success
|
||||
I (8024) HID_DEMO: Send the volume
|
||||
I (16024) HID_DEMO: Send the volume
|
||||
I (24024) HID_DEMO: Send the volume
|
||||
I (27784) HID_DEMO: ESP_HIDD_EVENT_BLE_DISCONNECT
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -5,11 +5,17 @@
|
||||
|
||||
From welcoming people as they arrive at a sporting event to providing information about a nearby museum exhibit, iBeacon opens a new world of possibilities for location awareness, and countless opportunities for interactivity between iOS devices and iBeacon hardware.
|
||||
|
||||
## Using Example
|
||||
## How to Use Example
|
||||
|
||||
iBeacon is a trademark of Apple Inc.
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
Before building devices which use iBeacon technology, visit https://developer.apple.com/ibeacon/ to obtain a license.
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
**Note:** *iBeacon is a trademark of Apple Inc.*
|
||||
|
||||
Before building devices which use iBeacon technology, visit [Apple iBeacon](https://developer.apple.com/ibeacon/) to obtain a license.
|
||||
|
||||
### iBeacon Mode
|
||||
|
||||
@ -23,13 +29,15 @@ Which demo will be run depends on the menuconfig, developers can set it in `iBea
|
||||
|
||||
The default mode is iBeacon Sender.
|
||||
|
||||
### Menuconfig
|
||||
Before compiling the demo,developers also need to configure the project:
|
||||
### Configure the project
|
||||
|
||||
```c
|
||||
Open the project configuration menu:
|
||||
|
||||
```bash
|
||||
idf.py menuconfig
|
||||
```
|
||||
And then enter `Component config->Bluetooth->Bluedroid Enable`
|
||||
|
||||
And then enter `Component config --> Bluetooth --> Bluedroid Enable`
|
||||
|
||||
Because the number of peripherals may be very large, developers can enable the **BLE Scan Duplicate Options**, the maximum number of devices in scan duplicate filter depends on the free heap size, when the cache is full, it is cleared.
|
||||
|
||||
@ -45,19 +53,14 @@ switch (scan_result->scan_rst.search_evt) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
```
|
||||
### Build and Flash
|
||||
|
||||
Build each project and flash it to the board, then run monitor tool to view serial output:
|
||||
|
||||
```
|
||||
idp.py -p PORT flash monitor
|
||||
```
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
@ -113,4 +116,7 @@ I (329203) IBEACON_DEMO: ----------iBeacon Found----------
|
||||
I (329203) IBEACON_DEMO: Device address:: 30 ae a4 00 42 82
|
||||
I (329203) IBEACON_DEMO: Proximity UUID:: fd a5 06 93 a4 e2 4f b1 af cf c6 eb 07 64 78 25
|
||||
```
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -9,7 +9,13 @@
|
||||
|
||||
This vendor-specific custom profile is implemented in [spp_client_demo.c](../ble_spp_client/main/spp_client_demo.c) and [spp_server_demo.c](../ble_spp_server/main/ble_spp_server_demo.c).
|
||||
|
||||
## Using Examples
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
### Initialization
|
||||
|
||||
@ -81,15 +87,11 @@
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Build each project and flash it to the board, then run monitor tool to view serial output:
|
||||
|
||||
```
|
||||
idf.py -p PORT flash monitor
|
||||
```
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
@ -149,8 +151,9 @@ I (18462) GATTS_SPP_DEMO: event = 5
|
||||
I (27652) GATTS_SPP_DEMO: EVT 2, gatts if 3
|
||||
I (27652) GATTS_SPP_DEMO: event = 2
|
||||
I (27652) GATTS_SPP_DEMO: ESP_GATTS_WRITE_EVT : handle = 2
|
||||
|
||||
```
|
||||
if you input data to the Uart terminal, it will be printed in the remote device Uart terminal.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,6 +1,53 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
## ESP-IDF GATT SERVER SPP demo
|
||||
## ESP-IDF GATT SERVER SPP Example
|
||||
|
||||
For description of this application please refer to [ESP-IDF GATT CLIENT SPP demo](../ble_spp_client/README.md)
|
||||
For description of this application please refer to [ESP-IDF GATT CLIENT SPP Example](../ble_spp_client/README.md)
|
||||
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (4452) GATTS_SPP_DEMO: EVT 14, gatts if 3
|
||||
I (4452) GATTS_SPP_DEMO: event = e
|
||||
I (5022) GATTS_SPP_DEMO: EVT 4, gatts if 3
|
||||
I (5022) GATTS_SPP_DEMO: event = 4
|
||||
I (5152) GATTS_SPP_DEMO: EVT 2, gatts if 3
|
||||
I (5152) GATTS_SPP_DEMO: event = 2
|
||||
I (5152) GATTS_SPP_DEMO: ESP_GATTS_WRITE_EVT : handle = 5
|
||||
I (5242) GATTS_SPP_DEMO: EVT 2, gatts if 3
|
||||
I (5242) GATTS_SPP_DEMO: event = 2
|
||||
I (5242) GATTS_SPP_DEMO: ESP_GATTS_WRITE_EVT : handle = 10
|
||||
I (18462) GATTS_SPP_DEMO: EVT 5, gatts if 3
|
||||
I (18462) GATTS_SPP_DEMO: event = 5
|
||||
I (27652) GATTS_SPP_DEMO: EVT 2, gatts if 3
|
||||
I (27652) GATTS_SPP_DEMO: event = 2
|
||||
I (27652) GATTS_SPP_DEMO: ESP_GATTS_WRITE_EVT : handle = 2
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,16 +1,78 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
ESP-IDF BLE throughput GATT CLIENT demo
|
||||
========================
|
||||
# ESP-IDF BLE throughput GATT CLIENT Test
|
||||
|
||||
This is the demo used to test the BLE throughput, this demo should used with throughput server demo together.
|
||||
The throughput of BLE can up to 720-767 Kbps between to ESP32 board.
|
||||
Note:
|
||||
1. In order to maximize throughput, we need to set the uart print baud rate at 921600 or more (idf.py menuconfig --> Component config --> ESP32-specific --> UART console baud rate --> 921600(or 1500000)) and don't print too much log.
|
||||
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
To configure the project, you can follow these steps:
|
||||
|
||||
1. In order to maximize throughput, we need to set the uart print baud rate at `921600` or more:
|
||||
Go to: `idf.py menuconfig --> Component config --> ESP32-specific --> UART console baud rate` and set to `921600` or `1500000` and don't print too much log.
|
||||
2. We can only test notify or write throughput at the same time, this demo default to test the notify throughput, if want to test the write throughput,
|
||||
please set: idf.py menuconfig --> Component config --> Example 'GATT CLIENT THROUGHPUT' Config ---> then select the 'test the gattc write throughput' option
|
||||
please set: `idf.py menuconfig --> Component config --> Example 'GATT CLIENT THROUGHPUT' Config --->` then select the `test the gattc write throughput` option.
|
||||
3. This demo only test unidirectional throughput, if you want to test the bidirectional throughput please change the demo by yourself.
|
||||
4. Should change the CPU frequency to 160MHZ or 240MHz in the idf.py menuconfig --> Component config ---> ESP32-specific ---> CPU frequency (240 MHz or 160 MHz).
|
||||
5. Should change the bluetooth controller and Bluedroid run in different Core in the idf.py menuconfig --> Component config ---> Bluetooth ---> The cpu core which bluetooth controller run (Core 0 (PRO CPU)) & Bluedroid Enable ---> The cpu core which Bluedroid run (Core 1 (APP CPU)).
|
||||
6. In order to maximize throughput, please test in a clean environment without many BLE devices working and both test devices are ESP32.
|
||||
4. Should change the CPU frequency to 160 MHZ or 240 MHz in the `idf.py menuconfig` and `Component config ---> ESP32-specific ---> CPU frequency (240 MHz or 160 MHz)`.
|
||||
5. Should change the bluetooth controller and Bluedroid run in different Core in the `idf.py menuconfig` on `Component config ---> Bluetooth ---> The cpu core which bluetooth controller run (Core 0 (PRO CPU))` and `Bluedroid Enable ---> The cpu core which Bluedroid run (Core 1 (APP CPU))`.
|
||||
6. In order to maximize throughput, please test in a clean environment without many BLE devices working and esure both test devices are ESP32.
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (6061) GATTC_DEMO: fc f5 c4 3c 5e ca
|
||||
I (6061) GATTC_DEMO: searched Adv Data Len 29, Scan Response Len 29
|
||||
I (6061) GATTC_DEMO: searched Device Name Len 15
|
||||
I (6061) GATTC_DEMO: THROUGHPUT_DEMO
|
||||
I (6071) GATTC_DEMO:
|
||||
|
||||
I (6071) GATTC_DEMO: searched device THROUGHPUT_DEMO
|
||||
|
||||
I (6081) GATTC_DEMO: connect to the remote device.
|
||||
E (6081) BT_BTM: BTM_BleConfigConnParams
|
||||
|
||||
I (6091) GATTC_DEMO: stop scan successfully
|
||||
I (6361) GATTC_DEMO: ESP_GATTC_CONNECT_EVT conn_id 0, if 1
|
||||
I (6361) GATTC_DEMO: REMOTE BDA:
|
||||
I (6361) GATTC_DEMO: fc f5 c4 3c 5e ca
|
||||
I (6361) GATTC_DEMO: open success
|
||||
I (6921) GATTC_DEMO: Notify Bit rate = 0 Byte/s, = 0 bit/s
|
||||
I (7671) GATTC_DEMO: ESP_GATTC_CFG_MTU_EVT, Status 0, MTU 517, conn_id 0
|
||||
I (7671) GATTC_DEMO: ESP_GATTC_SEARCH_RES_EVT
|
||||
I (7671) GATTC_DEMO: service found
|
||||
I (7681) GATTC_DEMO: UUID16: ff
|
||||
I (7681) GATTC_DEMO: ESP_GATTC_SEARCH_CMPL_EVT
|
||||
I (7691) GATTC_DEMO: ESP_GATTC_REG_FOR_NOTIFY_EVT
|
||||
I (7831) GATTC_DEMO: write descr success
|
||||
I (8921) GATTC_DEMO: Notify Bit rate = 87534 Byte/s, = 700272 bit/s, time = 1s
|
||||
I (10921) GATTC_DEMO: Notify Bit rate = 82174 Byte/s, = 657392 bit/s, time = 3s
|
||||
I (12921) GATTC_DEMO: Notify Bit rate = 81480 Byte/s, = 651840 bit/s, time = 5s
|
||||
I (14921) GATTC_DEMO: Notify Bit rate = 77054 Byte/s, = 616432 bit/s, time = 7s
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,17 +1,91 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
ESP-IDF BLE throughput GATT SERVER demo
|
||||
========================
|
||||
# ESP-IDF BLE throughput GATT SERVER Test
|
||||
|
||||
This is the demo used to test the BLE throughput, this demo should used with throughput client demo together.
|
||||
The throughput of BLE can up to 720-767 Kbps between to ESP32 board.
|
||||
Note:
|
||||
1. In order to maximize throughput, we need to set the uart print baud rate at 921600 or more (idf.py menuconfig --> Component config --> ESP32-specific --> UART console baud rate --> 921600(or 1500000)) and don't print too much log;
|
||||
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
To configure the project, you can follow these steps:
|
||||
|
||||
1. In order to maximize throughput, we need to set the uart print baud rate at `921600` or more:
|
||||
Go to: `idf.py menuconfig --> Component config --> ESP32-specific --> UART console baud rate` and set to `921600` or `1500000` and don't print too much log.
|
||||
2. We can only test notify or write throughput at the same time, this demo default to test the notify throughput, if want to test the write throughput,
|
||||
please set: idf.py menuconfig --> Component config --> Example 'GATT SERVER THROUGHPUT' Config ---> then select the 'test the gattc write throughput' option
|
||||
please set: `idf.py menuconfig --> Component config --> Example 'GATT CLIENT THROUGHPUT' Config --->` then select the `test the gattc write throughput` option.
|
||||
3. This demo only test unidirectional throughput, if you want to test the bidirectional throughput please change the demo by yourself.
|
||||
4. Should change the CPU frequency to 160MHz or 240MHz in the idf.py menuconfig --> Component config ---> ESP32-specific ---> CPU frequency (160MHz or 240 MHz)
|
||||
5. Should change the bluetooth controller and Bluedroid run in different Core in the idf.py menuconfig --> Component config ---> Bluetooth ---> The cpu core which bluetooth controller run (Core 0 (PRO CPU)) & Bluedroid Enable ---> The cpu core which Bluedroid run (Core 1 (APP CPU))
|
||||
4. Should change the CPU frequency to 160 MHz or 240 MHz in the `idf.py menuconfig` and `Component config ---> ESP32-specific ---> CPU frequency (240 MHz or 160 MHz)`.
|
||||
5. Should change the bluetooth controller and Bluedroid run in different Core in the `idf.py menuconfig` on `Component config ---> Bluetooth ---> The cpu core which bluetooth controller run (Core 0 (PRO CPU))` and `Bluedroid Enable ---> The cpu core which Bluedroid run (Core 1 (APP CPU))`.
|
||||
6. In order to maximize throughput, please test in a clean environment without many BLE devices working and both test devices are ESP32.
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (0) cpu_start: Starting scheduler on APP CPU.
|
||||
I (498) BTDM_INIT: BT controller compile version [d03a5d3]
|
||||
I (498) system_api: Base MAC address is not set
|
||||
I (498) system_api: read default base MAC address from EFUSE
|
||||
I (508) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
|
||||
I (918) GATTS_DEMO: REGISTER_APP_EVT, status 0, app_id 0
|
||||
|
||||
W (918) BT_BTM: BTM_BleWriteAdvData, Partial data write into ADV
|
||||
W (918) BT_BTM: BTM_BleWriteScanRsp, Partial data write into ADV
|
||||
I (928) GATTS_DEMO: CREATE_SERVICE_EVT, status 0, service_handle 40
|
||||
|
||||
I (948) GATTS_DEMO: SERVICE_START_EVT, status 0, service_handle 40
|
||||
|
||||
I (948) GATTS_DEMO: ADD_CHAR_EVT, status 0, attr_handle 42, service_handle 40
|
||||
|
||||
I (948) GATTS_DEMO: the gatts demo char length = 3
|
||||
|
||||
I (958) GATTS_DEMO: prf_char[0] =11
|
||||
|
||||
I (958) GATTS_DEMO: prf_char[1] =22
|
||||
|
||||
I (968) GATTS_DEMO: prf_char[2] =33
|
||||
|
||||
I (968) GATTS_DEMO: ADD_DESCR_EVT, status 0, attr_handle 43, service_handle 40
|
||||
|
||||
I (6258) GATTS_DEMO: ESP_GATTS_CONNECT_EVT, conn_id 0, remote ac:67:b2:6d:4e:22:
|
||||
I (7538) GATTS_DEMO: ESP_GATTS_MTU_EVT, MTU 517
|
||||
I (7698) GATTS_DEMO: GATT_WRITE_EVT, conn_id 0, trans_id 2, handle 43
|
||||
I (7698) GATTS_DEMO: GATT_WRITE_EVT, value len 2, value :
|
||||
I (7698) GATTS_DEMO: 01 00
|
||||
I (7698) GATTS_DEMO: notify enable
|
||||
I (7708) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
|
||||
I (7718) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
|
||||
I (7718) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
|
||||
I (7728) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
|
||||
I (7728) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
|
||||
I (7738) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
|
||||
I (7738) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
|
||||
I (7748) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
|
||||
I (7748) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
|
||||
I (7758) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
|
||||
...
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,13 +1,119 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
ESP-IDF Gatt Client Demo
|
||||
========================
|
||||
# ESP-IDF Gatt Client Example
|
||||
|
||||
This is the demo for users to use ESP_APIs to create a GATT Client.
|
||||
This example shows how to use ESP APIs to create a GATT Client.
|
||||
|
||||
To test this demo, you can run the [gatt_server_demo](../gatt_server), which creates services and starts advertising. `Gatt_client_demo` will start scanning and connect to the `gatt_server_demo` automatically.
|
||||
## How to Use Example
|
||||
|
||||
This demo will enable gatt server's notification function once the connection is established and then the devices start exchanging data.
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
Please check the [tutorial](tutorial/Gatt_Client_Example_Walkthrough.md) for more information about this example.
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
To test this example, you first run the [gatt_server_demo](../gatt_server), which creates services and starts advertising. `Gatt_client_demo` will start scanning and connect to the `gatt_server_demo` automatically.
|
||||
|
||||
This example will enable gatt server's notification function once the connection is established and then the devices start exchanging data.
|
||||
|
||||
Please, check this [tutorial](tutorial/Gatt_Client_Example_Walkthrough.md) for more information about this example.
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
### Settings for UUID128
|
||||
|
||||
This example works with UUID16 as default. To change to UUID128, follow this steps:
|
||||
|
||||
1. Change the UIID16 to UUID128. You can change the UUID according to your needs.
|
||||
|
||||
```c
|
||||
// Create a new UUID128 (using random values for this example)
|
||||
static uint8_t gatts_xxx_uuid128[ESP_UUID_LEN_128] = {0x06, 0x18, 0x7a, 0xec, 0xbe, 0x11, 0x11, 0xea, 0x00, 0x16, 0x02, 0x42, 0x01, 0x13, 0x00, 0x04};
|
||||
```
|
||||
By adding this new UUID128, you can remove the `#define` macros with the old UUID16.
|
||||
|
||||
2. Change the structure to:
|
||||
|
||||
```c
|
||||
static esp_bt_uuid_t xxx_uuid = {
|
||||
.len = ESP_UUID_LEN_128,
|
||||
.uuid = {.uuid128 = { 0 },},
|
||||
};
|
||||
```
|
||||
|
||||
3. Add the new UUID128 to the profile.
|
||||
|
||||
```c
|
||||
// Copy the new UUID128 to the profile
|
||||
memcpy(xxx_uuid.uuid.uuid128, gatts_xxx_uuid128, ESP_UUID_LEN_128);
|
||||
```
|
||||
|
||||
4. Edit the `ESP_GATTC_SEARCH_RES_EVT` in order to filter the new UUID128.
|
||||
|
||||
```c
|
||||
case ESP_GATTC_SEARCH_RES_EVT: {
|
||||
ESP_LOGI(GATTC_TAG, "SEARCH RES: conn_id = %x is primary service %d", p_data->search_res.conn_id, p_data->search_res.is_primary);
|
||||
ESP_LOGI(GATTC_TAG, "start handle %d end handle %d current handle value %d", p_data->search_res.start_handle, p_data->search_res.end_handle, p_data->search_res.srvc_id.inst_id);
|
||||
if (p_data->search_res.srvc_id.uuid.len == ESP_UUID_LEN_128) {
|
||||
if(memcmp(p_data->search_res.srvc_id.uuid.uuid.uuid128, gatts_xxx_uuid128, ESP_UUID_LEN_128) == 0){
|
||||
ESP_LOGI(GATTC_TAG, "service uuid128 found");
|
||||
get_server = true;
|
||||
gl_profile_tab[PROFILE_X_APP_ID].service_start_handle = p_data->search_res.start_handle;
|
||||
gl_profile_tab[PROFILE_X_APP_ID].service_end_handle = p_data->search_res.end_handle;
|
||||
} else {
|
||||
ESP_LOGE(GATTC_TAG, "service not found");
|
||||
}
|
||||
}
|
||||
break;
|
||||
```
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (0) cpu_start: Starting scheduler on APP CPU.
|
||||
I (525) BTDM_INIT: BT controller compile version [1342a48]
|
||||
I (525) system_api: Base MAC address is not set
|
||||
I (525) system_api: read default base MAC address from EFUSE
|
||||
I (535) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
|
||||
I (945) GATTC_DEMO: REG_EVT
|
||||
I (955) GATTC_DEMO: scan start success
|
||||
I (1115) GATTC_DEMO: 08 ef 3b a7 04 41
|
||||
I (1115) GATTC_DEMO: searched Adv Data Len 9, Scan Response Len 15
|
||||
I (1115) GATTC_DEMO: searched Device Name Len 13
|
||||
I (1125) GATTC_DEMO: LG CM2760(41)
|
||||
I (1125) GATTC_DEMO:
|
||||
|
||||
I (1425) GATTC_DEMO: 08 ef 3b a7 04 41
|
||||
I (1425) GATTC_DEMO: searched Adv Data Len 9, Scan Response Len 15
|
||||
I (1425) GATTC_DEMO: searched Device Name Len 13
|
||||
I (1435) GATTC_DEMO: LG CM2760(41)
|
||||
I (1435) GATTC_DEMO:
|
||||
|
||||
I (1865) GATTC_DEMO: 38 68 a4 69 bb 7c
|
||||
I (1865) GATTC_DEMO: searched Adv Data Len 31, Scan Response Len 14
|
||||
I (1865) GATTC_DEMO: searched Device Name Len 0
|
||||
I (1875) GATTC_DEMO:
|
||||
|
||||
I (2185) GATTC_DEMO: 38 68 a4 69 bb 7c
|
||||
I (2185) GATTC_DEMO: searched Adv Data Len 31, Scan Response Len 14
|
||||
I (2185) GATTC_DEMO: searched Device Name Len 0
|
||||
I (2185) GATTC_DEMO:
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,16 +1,75 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
ESP-IDF Gatt Security Client Demo
|
||||
========================
|
||||
# ESP-IDF Gatt Security Client Example
|
||||
|
||||
This is the demo for users to use ESP BLE security APIs to connect to and encrypt with peer devices.
|
||||
This example shows how to use the ESP BLE security APIs to secure connect to and encrypt with peer devices.
|
||||
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
To test this demo, you can run the [gatt_security_server_demo](../gatt_security_server), which starts advertising and can be connected to this demo automatically.
|
||||
|
||||
There are some important points for this demo:
|
||||
1.`esp_ble_gap_set_security_param` should be used to set the security parameters in the initial stage;
|
||||
2.`esp_ble_set_encryption` should be used to start encryption with peer device. If the peer device initiates the encryption, `esp_ble_gap_security_rsp` should be used to send security response to the peer device when `ESP_GAP_BLE_SEC_REQ_EVT` is received.
|
||||
3.The `gatt_security_client_demo` will receive a `ESP_GAP_BLE_AUTH_CMPL_EVT` once the encryption procedure has completed.
|
||||
1. `esp_ble_gap_set_security_param` should be used to set the security parameters in the initial stage;
|
||||
2. `esp_ble_set_encryption` should be used to start encryption with peer device. If the peer device initiates the encryption, `esp_ble_gap_security_rsp` should be used to send security response to the peer device when `ESP_GAP_BLE_SEC_REQ_EVT` is received.
|
||||
3. The `gatt_security_client_demo` will receive a `ESP_GAP_BLE_AUTH_CMPL_EVT` once the encryption procedure has completed.
|
||||
|
||||
Please check the [tutorial](tutorial/Gatt_Security_Client_Example_Walkthrough.md) for more information about this example.
|
||||
Please, check this [tutorial](tutorial/Gatt_Security_Client_Example_Walkthrough.md) for more information about this example.
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (0) cpu_start: Starting scheduler on APP CPU.
|
||||
I (572) BTDM_INIT: BT controller compile version [1342a48]
|
||||
I (572) system_api: Base MAC address is not set
|
||||
I (572) system_api: read default base MAC address from EFUSE
|
||||
I (582) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
|
||||
I (1002) SEC_GATTC_DEMO: EVT 0, gattc if 1
|
||||
I (1002) SEC_GATTC_DEMO: REG_EVT
|
||||
I (1032) SEC_GATTC_DEMO: Scan start success
|
||||
I (1242) SEC_GATTC_DEMO: 38 68 a4 69 bb 7c
|
||||
I (1242) SEC_GATTC_DEMO: Searched Adv Data Len 31, Scan Response Len 14
|
||||
I (1242) SEC_GATTC_DEMO: Searched Device Name Len 0
|
||||
I (1242) SEC_GATTC_DEMO:
|
||||
|
||||
I (1262) SEC_GATTC_DEMO: 38 68 a4 69 bb 7c
|
||||
I (1262) SEC_GATTC_DEMO: Searched Adv Data Len 31, Scan Response Len 14
|
||||
I (1262) SEC_GATTC_DEMO: Searched Device Name Len 0
|
||||
I (1272) SEC_GATTC_DEMO:
|
||||
|
||||
I (1592) SEC_GATTC_DEMO: 38 68 a4 69 bb 7c
|
||||
I (1592) SEC_GATTC_DEMO: Searched Adv Data Len 31, Scan Response Len 14
|
||||
I (1592) SEC_GATTC_DEMO: Searched Device Name Len 0
|
||||
I (1602) SEC_GATTC_DEMO:
|
||||
|
||||
I (1912) SEC_GATTC_DEMO: 38 68 a4 69 bb 7c
|
||||
I (1912) SEC_GATTC_DEMO: Searched Adv Data Len 31, Scan Response Len 14
|
||||
I (1912) SEC_GATTC_DEMO: Searched Device Name Len 0
|
||||
I (1922) SEC_GATTC_DEMO:
|
||||
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,17 +1,56 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
ESP-IDF Gatt Security Server Demo
|
||||
========================
|
||||
# ESP-IDF Gatt Security Server Example
|
||||
|
||||
This is the demo of APIs to connect to and encrypt with peer devices.
|
||||
This example shows how to use the APIs to connect to and encrypt with peer devices.
|
||||
|
||||
To test this demo, you can run [gatt_security_client_demo](../gatt_security_client), which starts scanning, connects to and starts encryption with `gatt_security_server_demo` automatically.
|
||||
To test this example, you can run [gatt_security_client_demo](../gatt_security_client), which starts scanning, connects to and starts encryption with `gatt_security_server_demo` automatically.
|
||||
|
||||
Please, check this [tutorial](tutorial/Gatt_Security_Server_Example_Walkthrough.md) for more information about this example.
|
||||
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
There are some important points for this demo:
|
||||
1.`esp_ble_gap_set_security_param` should be used to set the security parameters in the initial stage;
|
||||
2.`esp_ble_set_encryption` should be used to start encryption with peer device. If the peer device initiates the encryption, `esp_ble_gap_security_rsp` should be used to send security response to the peer device when `ESP_GAP_BLE_SEC_REQ_EVT` is received.
|
||||
3.The `gatt_security_client_demo` will receive a `ESP_GAP_BLE_AUTH_CMPL_EVT` once the encryption procedure has completed.
|
||||
|
||||
Please check the [tutorial](tutorial/Gatt_Security_Server_Example_Walkthrough.md) for more information about this example.
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (0) cpu_start: Starting scheduler on APP CPU.
|
||||
I (545) BTDM_INIT: BT controller compile version [d03a5d3]
|
||||
I (545) system_api: Base MAC address is not set
|
||||
I (545) system_api: read default base MAC address from EFUSE
|
||||
I (555) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
|
||||
I (905) SEC_GATTS_DEMO: app_main init bluetooth
|
||||
I (1015) SEC_GATTS_DEMO: ESP_GAP_BLE_LOCAL_IR_EVT
|
||||
I (1015) SEC_GATTS_DEMO: ESP_GAP_BLE_LOCAL_ER_EVT
|
||||
I (1035) SEC_GATTS_DEMO: The number handle = 8
|
||||
I (1065) SEC_GATTS_DEMO: advertising start success
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,10 +1,9 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
ESP-IDF Gatt Server Demo
|
||||
========================
|
||||
# ESP-IDF Gatt Server Example
|
||||
|
||||
This is the demo of APIs to create a GATT service by adding attributes one by one. However, this method is defined by Bluedroid and is difficult for users to use.
|
||||
This example shows how create a GATT service by adding attributes one by one. However, this method is defined by Bluedroid and is difficult for users to use.
|
||||
|
||||
Hence, we also allow users to create a GATT service with an attribute table, which releases the user from adding attributes one by one. And it is recommended for users to use. For more information about this method, please refer to [gatt_server_service_table_demo](../gatt_server_service_table).
|
||||
|
||||
@ -12,5 +11,96 @@ This demo creates GATT a service and then starts advertising, waiting to be conn
|
||||
|
||||
To test this demo, we can run the [gatt_client_demo](../gatt_client), which can scan for and connect to this demo automatically. They will start exchanging data once the GATT client has enabled the notification function of the GATT server.
|
||||
|
||||
Please check the [tutorial](tutorial/Gatt_Server_Example_Walkthrough.md) for more information about this example.
|
||||
Please, check this [tutorial](tutorial/Gatt_Server_Example_Walkthrough.md) for more information about this example.
|
||||
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
### Settings for UUID128
|
||||
|
||||
This example works with UUID16 as default. To change to UUID128, follow this steps:
|
||||
|
||||
1. Change the UIID16 to UUID128. You can change the UUID according to your needs.
|
||||
|
||||
```c
|
||||
// Create a new UUID128 (using random values for this example)
|
||||
uint8_t gatts_service_uuid128_test_X[ESP_UUID_LEN_128] = {0x06, 0x18, 0x7a, 0xec, 0xbe, 0x11, 0x11, 0xea, 0x00, 0x16, 0x02, 0x42, 0x01, 0x13, 0x00, 0x04};
|
||||
```
|
||||
|
||||
By adding this new UUID128, you can remove the `#define` macros with the old UUID16.
|
||||
|
||||
2. Add the new UUID128 to the profile.
|
||||
|
||||
```c
|
||||
// Change the size of the UUID from 16 to 128
|
||||
gl_profile_tab[PROFILE_X_APP_ID].service_id.id.uuid.len = ESP_UUID_LEN_128;
|
||||
// Copy the new UUID128 to the profile
|
||||
memcpy(gl_profile_tab[PROFILE_X_APP_ID].service_id.id.uuid.uuid.uuid128, gatts_service_uuid128_test_X, ESP_UUID_LEN_128);
|
||||
```
|
||||
|
||||
3. Remove the following line(s)
|
||||
```c
|
||||
gl_profile_tab[PROFILE_X_APP_ID].service_id.id.uuid.uuid.uuid16 = GATTS_SERVICE_UUID_TEST_X;
|
||||
```
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (0) cpu_start: Starting scheduler on APP CPU.
|
||||
I (512) BTDM_INIT: BT controller compile version [1342a48]
|
||||
I (522) system_api: Base MAC address is not set
|
||||
I (522) system_api: read default base MAC address from EFUSE
|
||||
I (522) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
|
||||
I (922) GATTS_DEMO: REGISTER_APP_EVT, status 0, app_id 0
|
||||
|
||||
I (932) GATTS_DEMO: CREATE_SERVICE_EVT, status 0, service_handle 40
|
||||
|
||||
I (942) GATTS_DEMO: REGISTER_APP_EVT, status 0, app_id 1
|
||||
|
||||
I (952) GATTS_DEMO: SERVICE_START_EVT, status 0, service_handle 40
|
||||
|
||||
I (952) GATTS_DEMO: ADD_CHAR_EVT, status 0, attr_handle 42, service_handle 40
|
||||
|
||||
I (962) GATTS_DEMO: the gatts demo char length = 3
|
||||
|
||||
I (962) GATTS_DEMO: prf_char[0] =11
|
||||
|
||||
I (972) GATTS_DEMO: prf_char[1] =22
|
||||
|
||||
I (972) GATTS_DEMO: prf_char[2] =33
|
||||
|
||||
I (982) GATTS_DEMO: CREATE_SERVICE_EVT, status 0, service_handle 44
|
||||
|
||||
I (982) GATTS_DEMO: ADD_DESCR_EVT, status 0, attr_handle 43, service_handle 40
|
||||
|
||||
I (992) GATTS_DEMO: SERVICE_START_EVT, status 0, service_handle 44
|
||||
|
||||
I (1002) GATTS_DEMO: ADD_CHAR_EVT, status 0, attr_handle 46, service_handle 44
|
||||
|
||||
I (1012) GATTS_DEMO: ADD_DESCR_EVT, status 0, attr_handle 47, service_handle 44
|
||||
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,9 +1,49 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
ESP-IDF Gatt Server Service Table Demo
|
||||
===============================================
|
||||
# ESP-IDF Gatt Server Service Table Example
|
||||
|
||||
This demo shows how to create a GATT service with an attribute table defined in one place. Provided API releases the user from adding attributes one by one as implemented in BLUEDROID. A demo of the other method to create the attribute table is presented in [gatt_server_demo](../gatt_server).
|
||||
This example shows how to create a GATT service with an attribute table defined in one place. Provided API releases the user from adding attributes one by one as implemented in BLUEDROID. A demo of the other method to create the attribute table is presented in [gatt_server_demo](../gatt_server).
|
||||
|
||||
Please check the [tutorial](tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md) for more information about this example.
|
||||
Please, check this [tutorial](tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md) for more information about this example.
|
||||
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (0) cpu_start: Starting scheduler on APP CPU.
|
||||
I (512) BTDM_INIT: BT controller compile version [1342a48]
|
||||
I (522) system_api: Base MAC address is not set
|
||||
I (522) system_api: read default base MAC address from EFUSE
|
||||
I (522) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
|
||||
I (942) GATTS_TABLE_DEMO: create attribute table successfully, the number handle = 8
|
||||
|
||||
I (942) GATTS_TABLE_DEMO: SERVICE_START_EVT, status 0, service_handle 40
|
||||
I (962) GATTS_TABLE_DEMO: advertising start successfully
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,13 +1,84 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
ESP-IDF Gatt Client Multi Connection Demo
|
||||
========================
|
||||
# ESP-IDF Gatt Client Multi Connection Example
|
||||
|
||||
This is the demo of APIs to create a GATT multi-connection client. It can be used to connect to three GATT servers at the same time.
|
||||
This example shows the usage of APIs to create a GATT multi-connection client. It can be used to connect to three GATT servers at the same time.
|
||||
|
||||
To test this demo, please run [gatt_server_demo](../gatt_server) to create three GATT server devices, namely ESP_GATTS_DEMO_a, ESP_GATTS_DEMO_b and ESP_GATTS_DEMO_c, `Gatt_client_multi_connection_demo` will connect to these three gatt server demos, and then exchange data.
|
||||
To test this example, please run [gatt_server_demo](../gatt_server) to create three GATT server devices, namely ESP_GATTS_DEMO_a, ESP_GATTS_DEMO_b and ESP_GATTS_DEMO_c, `Gatt_client_multi_connection_demo` will connect to these three gatt server demos, and then exchange data.
|
||||
|
||||
Please, check this [tutorial](tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md) for more information about this example.
|
||||
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
The code can be modified to connect to more devices (up to 4 devices by default). If you need to connect to more devices (more than 4 devices), you need to change `BT/BLE MAX ACL CONNECTIONS` in menuconfig.
|
||||
|
||||
Please check the [tutorial](tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md) for more information about this example.
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (0) cpu_start: Starting scheduler on APP CPU.
|
||||
I (512) BTDM_INIT: BT controller compile version [1342a48]
|
||||
I (522) system_api: Base MAC address is not set
|
||||
I (522) system_api: read default base MAC address from EFUSE
|
||||
I (522) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
|
||||
I (932) GATTC_MULTIPLE_DEMO: REG_EVT
|
||||
I (932) GATTC_MULTIPLE_DEMO: REG_EVT
|
||||
I (932) GATTC_MULTIPLE_DEMO: REG_EVT
|
||||
I (942) GATTC_MULTIPLE_DEMO: Scan start success
|
||||
I (1072) GATTC_MULTIPLE_DEMO: 38 68 a4 69 bb 7c
|
||||
I (1072) GATTC_MULTIPLE_DEMO: Searched Adv Data Len 28, Scan Response Len 0
|
||||
I (1072) GATTC_MULTIPLE_DEMO: Searched Device Name Len 0
|
||||
I (1082) GATTC_MULTIPLE_DEMO:
|
||||
|
||||
I (1102) GATTC_MULTIPLE_DEMO: 08 ef 3b a7 04 41
|
||||
I (1102) GATTC_MULTIPLE_DEMO: Searched Adv Data Len 9, Scan Response Len 15
|
||||
I (1102) GATTC_MULTIPLE_DEMO: Searched Device Name Len 13
|
||||
I (1112) GATTC_MULTIPLE_DEMO: LG CM2760(41)
|
||||
I (1112) GATTC_MULTIPLE_DEMO:
|
||||
|
||||
I (1222) GATTC_MULTIPLE_DEMO: 38 68 a4 69 bb 7c
|
||||
I (1222) GATTC_MULTIPLE_DEMO: Searched Adv Data Len 28, Scan Response Len 0
|
||||
I (1222) GATTC_MULTIPLE_DEMO: Searched Device Name Len 0
|
||||
I (1232) GATTC_MULTIPLE_DEMO:
|
||||
|
||||
I (1372) GATTC_MULTIPLE_DEMO: 38 68 a4 69 bb 7c
|
||||
I (1372) GATTC_MULTIPLE_DEMO: Searched Adv Data Len 28, Scan Response Len 0
|
||||
I (1372) GATTC_MULTIPLE_DEMO: Searched Device Name Len 0
|
||||
I (1382) GATTC_MULTIPLE_DEMO:
|
||||
|
||||
I (1412) GATTC_MULTIPLE_DEMO: 08 ef 3b a7 04 41
|
||||
I (1412) GATTC_MULTIPLE_DEMO: Searched Adv Data Len 9, Scan Response Len 15
|
||||
I (1422) GATTC_MULTIPLE_DEMO: Searched Device Name Len 13
|
||||
I (1422) GATTC_MULTIPLE_DEMO: LG CM2760(41)
|
||||
I (1432) GATTC_MULTIPLE_DEMO:
|
||||
|
||||
I (1522) GATTC_MULTIPLE_DEMO: 38 68 a4 69 bb 7c
|
||||
I (1522) GATTC_MULTIPLE_DEMO: Searched Adv Data Len 28, Scan Response Len 0
|
||||
I (1522) GATTC_MULTIPLE_DEMO: Searched Device Name Len 0
|
||||
I (1532) GATTC_MULTIPLE_DEMO:
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -13,7 +13,9 @@ This example is designed to run on commonly available ESP32 development board, e
|
||||
|
||||
### Configure the project
|
||||
|
||||
```
|
||||
Open the project configuration menu:
|
||||
|
||||
```bash
|
||||
idf.py menuconfig
|
||||
```
|
||||
|
||||
|
@ -13,7 +13,9 @@ This example is designed to run on commonly available ESP32 development board, e
|
||||
|
||||
### Configure the project
|
||||
|
||||
```
|
||||
Open the project configuration menu:
|
||||
|
||||
```bash
|
||||
idf.py menuconfig
|
||||
```
|
||||
|
||||
|
@ -1,21 +1,88 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
ESP-IDF Blufi demo
|
||||
=======================
|
||||
# ESP-IDF Blufi Example
|
||||
|
||||
This is the demo for bluetooth config wifi connection to ap.
|
||||
This demo shows how to use the *Blufi* to configurate the Wi-Fi connection to AP.
|
||||
|
||||
The BluFi for ESP32 is a Wi-Fi network configuration function via Bluetooth channel. It provides a secure protocol to pass Wi-Fi configuration and credentials to the ESP32.
|
||||
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
To test this demo, you need to prepare a mobile phone with blufi application installed. You can download the blufi application from [Android version](https://github.com/EspressifApp/EspBlufi) and [iOS version](https://itunes.apple.com/cn/app/espblufi/id1450614082?mt=8).
|
||||
|
||||
Blufi is completely open source, here is the download link:
|
||||
|
||||
* [blufi source code](https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/blufi)
|
||||
|
||||
* [Blufi source code](https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/blufi)
|
||||
* [BluFi protocol](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/blufi.html?highlight=blufi#the-frame-formats-defined-in-blufi)
|
||||
|
||||
* [iOS source code](https://github.com/EspressifApp/EspBlufiForiOS)
|
||||
|
||||
* [Android source code](https://github.com/EspressifApp/EspBlufi)
|
||||
|
||||
* [Bluetooth Network User Guide CN](https://www.espressif.com/sites/default/files/documentation/esp32_bluetooth_networking_user_guide_cn.pdf)
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (0) cpu_start: Starting scheduler on APP CPU.
|
||||
I (708) wifi:wifi driver task: 3ffbb118, prio:23, stack:6656, core=0
|
||||
I (708) system_api: Base MAC address is not set
|
||||
I (708) system_api: read default base MAC address from EFUSE
|
||||
I (718) wifi:wifi firmware version: 44799ff
|
||||
I (718) wifi:wifi certification version: v7.0
|
||||
I (718) wifi:config NVS flash: enabled
|
||||
I (718) wifi:config nano formating: disabled
|
||||
I (728) wifi:Init data frame dynamic rx buffer num: 32
|
||||
I (728) wifi:Init management frame dynamic rx buffer num: 32
|
||||
I (738) wifi:Init management short buffer num: 32
|
||||
I (738) wifi:Init dynamic tx buffer num: 32
|
||||
I (748) wifi:Init static rx buffer size: 1600
|
||||
I (748) wifi:Init static rx buffer num: 10
|
||||
I (748) wifi:Init dynamic rx buffer num: 32
|
||||
I (758) wifi_init: rx ba win: 6
|
||||
I (758) wifi_init: tcpip mbox: 32
|
||||
I (768) wifi_init: udp mbox: 6
|
||||
I (768) wifi_init: tcp mbox: 6
|
||||
I (768) wifi_init: tcp tx win: 5744
|
||||
I (778) wifi_init: tcp rx win: 5744
|
||||
I (778) wifi_init: tcp mss: 1440
|
||||
I (788) wifi_init: WiFi IRAM OP enabled
|
||||
I (788) wifi_init: WiFi RX IRAM OP enabled
|
||||
I (798) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
|
||||
I (908) wifi:mode : sta (fc:f5:c4:3c:62:90)
|
||||
I (908) wifi:enable tsf
|
||||
I (908) BTDM_INIT: BT controller compile version [1342a48]
|
||||
I (1198) BLUFI_EXAMPLE: BD ADDR: fc:f5:c4:3c:62:92
|
||||
|
||||
I (1198) BLUFI_EXAMPLE: BLUFI VERSION 0102
|
||||
|
||||
I (1198) BLUFI_EXAMPLE: BLUFI init finish
|
||||
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
<<<<<<< HEAD:examples/bluetooth/blufi/README.md
|
||||
* [Bluetooth Network User Guide CN](https://www.espressif.com/sites/default/files/documentation/esp32_bluetooth_networking_user_guide_cn.pdf)
|
||||
=======
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
>>>>>>> c552024ca7 (Changes on README files on ANCS, Eddystone, HID and NimBLE):examples/bluetooth/bluedroid/ble/blufi/README.md
|
||||
|
@ -5,7 +5,18 @@
|
||||
|
||||
This demo use APIs which esp_hid component provided to create a BT, BLE or Bluetooth dual mode hid device. Users can choose mode by setting `HID_DEV_MODE`.
|
||||
|
||||
|
||||
This example works in companion with the [BLE HID Host Example](../esp_hid_host/README.md)
|
||||
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
The BT hid device plays as a mouse. When the connection is successfully established, users can follow the usage below to operate the 'mouse'.
|
||||
|
||||
```
|
||||
########################################################################
|
||||
BT hid mouse demo usage:
|
||||
@ -21,3 +32,64 @@ h -- show the help
|
||||
```
|
||||
|
||||
The BLE hid device plays as a remote control. When the connection is successfully established, the remote control will set volume up and down periodically.
|
||||
This example implements a BLE HID device.
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Configure the Project
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Build the project and flash it to the board, then run monitor tool to view serial output.
|
||||
|
||||
```
|
||||
idf.py -p PORT flash monitor
|
||||
```
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (0) cpu_start: Starting scheduler on APP CPU.
|
||||
I (607) BTDM_INIT: BT controller compile version [d03a5d3]
|
||||
I (607) system_api: Base MAC address is not set
|
||||
I (607) system_api: read default base MAC address from EFUSE
|
||||
I (617) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
|
||||
W (1337) BT_BTM: BTM_BleWriteAdvData, Partial data write into ADV
|
||||
I (1357) HID_DEV_DEMO: START
|
||||
I (25067) HID_DEV_DEMO: CONNECT
|
||||
I (25357) HID_DEV_DEMO: Send the volume
|
||||
E (25437) BT_SMP: Value for numeric comparison = 125657
|
||||
I (25437) ESP_HID_GAP: BLE GAP NC_REQ passkey:125657
|
||||
W (25517) BT_SMP: FOR LE SC LTK IS USED INSTEAD OF STK
|
||||
I (25587) ESP_HID_GAP: BLE GAP KEY type = ESP_LE_KEY_LENC
|
||||
I (25587) ESP_HID_GAP: BLE GAP KEY type = ESP_LE_KEY_PENC
|
||||
I (25587) ESP_HID_GAP: BLE GAP KEY type = ESP_LE_KEY_LID
|
||||
I (25647) ESP_HID_GAP: BLE GAP KEY type = ESP_LE_KEY_PID
|
||||
I (25757) ESP_HID_GAP: BLE GAP AUTH SUCCESS
|
||||
I (27457) HID_DEV_DEMO: Send the volume
|
||||
I (29557) HID_DEV_DEMO: Send the volume
|
||||
I (31657) HID_DEV_DEMO: Send the volume
|
||||
I (33757) HID_DEV_DEMO: Send the volume
|
||||
I (35857) HID_DEV_DEMO: Send the volume
|
||||
I (37957) HID_DEV_DEMO: Send the volume
|
||||
I (40057) HID_DEV_DEMO: Send the volume
|
||||
I (42157) HID_DEV_DEMO: Send the volume
|
||||
I (44257) HID_DEV_DEMO: Send the volume
|
||||
I (46357) HID_DEV_DEMO: Send the volume
|
||||
I (48457) HID_DEV_DEMO: Send the volume
|
||||
I (50557) HID_DEV_DEMO: Send the volume
|
||||
...
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -3,4 +3,97 @@
|
||||
|
||||
# ESP-IDF BT/BLE HID Host Demo
|
||||
|
||||
This demo use APIs which esp_hid component provided to create a Bluetooth dual mode hid host. After the program is started, the HID host will scan the surrounding Bluetooth HID device, and try to connect to the last device which has been scanned. When the connection is successfully established, the HID host will dump the HID device information, and can receive the data sent by the HID device.
|
||||
|
||||
# ESP-IDF BLE HID Host Demo
|
||||
|
||||
This demo use APIs which esp_hid component provided to create a Bluetooth dual mode hid host. After the program is started, the HID host will scan the surrounding Bluetooth HID device and try to connect to the last device which has been scanned. When the connection is successfully established, the HID host will dump the HID device information and can receive the data sent by the HID device.
|
||||
|
||||
This example works in companion with the [BLE HID Device Example](../esp_hid_device/README.md)
|
||||
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Configure the Project
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Build the project and flash it to the board, then run monitor tool to view serial output.
|
||||
|
||||
```
|
||||
idf.py -p PORT flash monitor
|
||||
```
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
```
|
||||
I (0) cpu_start: Starting scheduler on APP CPU.
|
||||
I (602) BTDM_INIT: BT controller compile version [d03a5d3]
|
||||
I (612) system_api: Base MAC address is not set
|
||||
I (612) system_api: read default base MAC address from EFUSE
|
||||
I (612) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
|
||||
I (1332) ESP_HIDH_DEMO: SCAN...
|
||||
I (7212) ESP_HIDH_DEMO: SCAN: 1 results
|
||||
BLE: fc:f5:c4:3c:62:92, RSSI: -29, USAGE: GENERIC, APPEARANCE: 0x03c0, ADDR_TYPE: 'PUBLIC', NAME: ESP BLE HID2
|
||||
I (7332) ESP_HID_GAP: BLE GAP SEC_REQ
|
||||
E (7702) BT_SMP: Value for numeric comparison = 125657
|
||||
I (7702) ESP_HID_GAP: BLE GAP NC_REQ passkey:125657
|
||||
W (7742) BT_SMP: FOR LE SC LTK IS USED INSTEAD OF STK
|
||||
I (7892) ESP_HID_GAP: BLE GAP KEY type = ESP_LE_KEY_PID
|
||||
I (7892) ESP_HID_GAP: BLE GAP KEY type = ESP_LE_KEY_LENC
|
||||
I (7892) ESP_HID_GAP: BLE GAP KEY type = ESP_LE_KEY_PENC
|
||||
I (7892) ESP_HID_GAP: BLE GAP KEY type = ESP_LE_KEY_LID
|
||||
I (8142) ESP_HID_GAP: BLE GAP AUTH SUCCESS
|
||||
I (9332) ESP_HIDH_DEMO: fc:f5:c4:3c:62:92 OPEN: ESP BLE HID2
|
||||
BDA:fc:f5:c4:3c:62:92, Appearance: 0x03c0, Connection ID: 0
|
||||
Name: ESP BLE HID2, Manufacturer: Espressif, Serial Number: 1234567890
|
||||
PID: 0x05df, VID: 0x16c0, VERSION: 0x0100
|
||||
Battery: Handle: 42, CCC Handle: 43
|
||||
Report Maps: 2
|
||||
Report Map Length: 38
|
||||
VENDOR FEATURE REPORT, ID: 1, Length: 8, Permissions: 0x0a, Handle: 71, CCC Handle: 0
|
||||
VENDOR OUTPUT REPORT, ID: 1, Length: 8, Permissions: 0x0a, Handle: 68, CCC Handle: 0
|
||||
VENDOR INPUT REPORT, ID: 1, Length: 8, Permissions: 0x12, Handle: 64, CCC Handle: 65
|
||||
Report Map Length: 111
|
||||
CCONTROL INPUT REPORT, ID: 3, Length: 2, Permissions: 0x12, Handle: 85, CCC Handle: 86
|
||||
I (9722) ESP_HIDH_DEMO: fc:f5:c4:3c:62:92 INPUT: CCONTROL, MAP: 1, ID: 3, Len: 2, Data:
|
||||
I (9722) ESP_HIDH_DEMO: 40 00
|
||||
I (9812) ESP_HIDH_DEMO: fc:f5:c4:3c:62:92 INPUT: CCONTROL, MAP: 1, ID: 3, Len: 2, Data:
|
||||
I (9812) ESP_HIDH_DEMO: 00 00
|
||||
I (11822) ESP_HIDH_DEMO: fc:f5:c4:3c:62:92 INPUT: CCONTROL, MAP: 1, ID: 3, Len: 2, Data:
|
||||
I (11822) ESP_HIDH_DEMO: 80 00
|
||||
I (11912) ESP_HIDH_DEMO: fc:f5:c4:3c:62:92 INPUT: CCONTROL, MAP: 1, ID: 3, Len: 2, Data:
|
||||
I (11912) ESP_HIDH_DEMO: 00 00
|
||||
I (13922) ESP_HIDH_DEMO: fc:f5:c4:3c:62:92 INPUT: CCONTROL, MAP: 1, ID: 3, Len: 2, Data:
|
||||
I (13922) ESP_HIDH_DEMO: 40 00
|
||||
I (14012) ESP_HIDH_DEMO: fc:f5:c4:3c:62:92 INPUT: CCONTROL, MAP: 1, ID: 3, Len: 2, Data:
|
||||
I (14012) ESP_HIDH_DEMO: 00 00
|
||||
I (16022) ESP_HIDH_DEMO: fc:f5:c4:3c:62:92 INPUT: CCONTROL, MAP: 1, ID: 3, Len: 2, Data:
|
||||
I (16022) ESP_HIDH_DEMO: 80 00
|
||||
I (16112) ESP_HIDH_DEMO: fc:f5:c4:3c:62:92 INPUT: CCONTROL, MAP: 1, ID: 3, Len: 2, Data:
|
||||
I (16112) ESP_HIDH_DEMO: 00 00
|
||||
I (18122) ESP_HIDH_DEMO: fc:f5:c4:3c:62:92 INPUT: CCONTROL, MAP: 1, ID: 3, Len: 2, Data:
|
||||
I (18122) ESP_HIDH_DEMO: 40 00
|
||||
I (18212) ESP_HIDH_DEMO: fc:f5:c4:3c:62:92 INPUT: CCONTROL, MAP: 1, ID: 3, Len: 2, Data:
|
||||
I (18212) ESP_HIDH_DEMO: 00 00
|
||||
...
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -4,40 +4,16 @@ Note: To use examples in this directory, you need to have Bluetooth enabled in c
|
||||
|
||||
# Example Layout
|
||||
|
||||
This directory includes examples to demonstrate BLE functionality using Apache MyNewt NimBLE (https://github.com/apache/mynewt-nimble) host stack.
|
||||
This directory includes examples to demonstrate BLE functionality using [Apache MyNewt NimBLE](https://github.com/apache/mynewt-nimble) host stack.
|
||||
|
||||
## bleprph
|
||||
* `blecent` Shows how ESP32 acts as a BLE central.
|
||||
* `blehr` Demonstrates standard Heart Rate measurement BLE peripheral.
|
||||
* `blemesh` Demonstrates BLE mesh functionality of NimBLE.
|
||||
* `bleprph` Shows how ESP32 acts as a BLE Peripheral.
|
||||
* `bleprph_wifi_coex` ESP32 acts as a BLE Peripheral and simultaneously performs Wi-Fi ping to configured IP address.
|
||||
|
||||
Shows how ESP32 acts as a BLE Peripheral.
|
||||
|
||||
See the [README.md](./bleprph/README.md) file in the example [bleprph](./bleprph/).
|
||||
|
||||
## bleprph_wifi_coex
|
||||
|
||||
|
||||
ESP32 acts as a BLE Peripheral and simultaneously performs WiFi ping to configured IP address.
|
||||
|
||||
See the [README.md](./bleprph_wifi_coex/README.md) file in the example [bleprph_wifi_coex](./bleprph_wifi_coex/).
|
||||
|
||||
## blecent
|
||||
|
||||
Shows how ESP32 acts as a BLE central.
|
||||
|
||||
See the [README.md](./blecent/README.md) file in the example [blecent](./blecent/).
|
||||
|
||||
## blemesh
|
||||
|
||||
Demonstrates BLE mesh functionality of NimBLE.
|
||||
|
||||
See the [README.md](./blemesh/README.md) file in the example [blemesh](./blemesh/).
|
||||
|
||||
## blehr
|
||||
|
||||
Demonstrates standard Heart Rate measurement BLE peripheral.
|
||||
|
||||
See the [README.md](./blehr/README.md) file in the example [blehr](./blehr/).
|
||||
See the [README.md](../../README.md) file in the upper level [examples](../../) directory for more information about examples.
|
||||
|
||||
# More
|
||||
|
||||
See the [README.md](../../README.md) file in the upper level [examples](../../) directory for more information about examples.
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
| Supported Targets | ESP32 |
|
||||
| ----------------- | ----- |
|
||||
|
||||
# BLE central example
|
||||
# BLE Central Example
|
||||
|
||||
(See the README.md file in the upper level 'examples' directory for more information about examples.)
|
||||
|
||||
@ -30,25 +30,40 @@ Note :
|
||||
* Make sure to run `python -m pip install --user -r $IDF_PATH/requirements.txt -r $IDF_PATH/tools/ble/requirements.txt` to install the dependency packages needed.
|
||||
* Currently this Python utility is only supported on Linux (BLE communication is via BLuez + DBus).
|
||||
|
||||
## How to use example
|
||||
## How to Use Example
|
||||
|
||||
### Configure the project
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Configure the Project
|
||||
|
||||
Open the project configuration menu:
|
||||
|
||||
```bash
|
||||
idf.py menuconfig
|
||||
```
|
||||
|
||||
In the `Example Configuration` menu:
|
||||
|
||||
* Change the `Peer Address` option if needed.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Build the project and flash it to the board, then run monitor tool to view serial output:
|
||||
|
||||
```
|
||||
idf.py -p PORT flash monitor
|
||||
```
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
@ -158,3 +173,7 @@ Subscribe passed
|
||||
ClientCharacteristicConfigurationDescriptor
|
||||
Subscribe Status: 0
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,7 +1,7 @@
|
||||
| Supported Targets | ESP32 |
|
||||
| ----------------- | ----- |
|
||||
|
||||
# BLE Heart Rate Measurement example
|
||||
# BLE Heart Rate Measurement Example
|
||||
|
||||
(See the README.md file in the upper level 'examples' directory for more information about examples.)
|
||||
|
||||
@ -20,26 +20,28 @@ Note :
|
||||
* Make sure to run `python -m pip install --user -r $IDF_PATH/requirements.txt -r $IDF_PATH/tools/ble/requirements.txt` to install the dependency packages needed.
|
||||
* Currently this Python utility is only supported on Linux (BLE communication is via BLuez + DBus).
|
||||
|
||||
## How to Use Example
|
||||
|
||||
## How to use example
|
||||
|
||||
### Configure the project
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
idf.py menuconfig
|
||||
```
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Build the project and flash it to the board, then run monitor tool to view serial output:
|
||||
|
||||
```
|
||||
idf.py -p PORT flash monitor
|
||||
```
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
@ -114,3 +116,7 @@ device disconnected
|
||||
powering off adapter...
|
||||
bluetooth adapter powered off
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -6,35 +6,38 @@
|
||||
(See the README.md file in the upper level 'examples' directory for more information about examples.)
|
||||
|
||||
This example implements Bluetooth Mesh node that supports On/Off and Level models.
|
||||
|
||||
It has suport for both Advertising Bearer and GATT Bearer.
|
||||
|
||||
For more information on NimBLE MESH, please visit [NimBLE_MESH](https://mynewt.apache.org/latest/network/mesh/index.html#bluetooth-mesh).
|
||||
|
||||
It uses ESP32's Bluetooth controller and NimBLE stack based BLE host.
|
||||
|
||||
This example can be starting step to get basic understanding on how to build BLE MESH node.
|
||||
|
||||
To test this demo, any BLE mesh provisioner app can be used.
|
||||
|
||||
|
||||
## How to use example
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
### Configure the project
|
||||
|
||||
```
|
||||
Open the project configuration menu:
|
||||
|
||||
```bash
|
||||
idf.py menuconfig
|
||||
```
|
||||
|
||||
* Select 'Enable BLE mesh functionality' under 'Component config > Bluetooth > Enable NimBLE host stack'.
|
||||
* Select `Enable BLE mesh functionality` under `Component config --> Bluetooth --> Enable NimBLE host stack`.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Build the project and flash it to the board, then run monitor tool to view serial output:
|
||||
|
||||
```
|
||||
idf.py -p PORT flash monitor
|
||||
```
|
||||
`idf.py -p PORT flash monitor`
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
@ -86,5 +89,8 @@ I (11885) NimBLE_MESH: Local node provisioned, primary address 0x0002
|
||||
|
||||
GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=0 own_addr_type=1 adv_filter_policy=0 adv_itvl_min=1600 adv_itvl_max=1920
|
||||
GAP procedure initiated: stop advertising.
|
||||
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,7 +1,7 @@
|
||||
| Supported Targets | ESP32 |
|
||||
| ----------------- | ----- |
|
||||
|
||||
# BLE peripheral example
|
||||
# BLE Peripheral Example
|
||||
|
||||
(See the README.md file in the upper level 'examples' directory for more information about examples.)
|
||||
|
||||
@ -24,36 +24,40 @@ Note :
|
||||
* Make sure to run `python -m pip install --user -r $IDF_PATH/requirements.txt -r $IDF_PATH/tools/ble/requirements.txt` to install the dependency packages needed.
|
||||
* Currently this Python utility is only supported on Linux (BLE communication is via BLuez + DBus).
|
||||
|
||||
## How to use example
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
### Configure the project
|
||||
|
||||
```
|
||||
Open the project configuration menu:
|
||||
|
||||
```bash
|
||||
idf.py menuconfig
|
||||
```
|
||||
|
||||
* Select I/O capabilities of device from 'Example Configuration > I/O Capability', default is 'Just_works'.
|
||||
In the `Example Configuration` menu:
|
||||
|
||||
* Enable/Disable other security related parameters 'Bonding, MITM option, secure connection(SM SC)' from 'Example Configuration'.
|
||||
* Select I/O capabilities of device from `Example Configuration --> I/O Capability`, default is `Just_works`.
|
||||
* Enable/Disable other security related parameters `Bonding, MITM option, secure connection(SM SC)`.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Build the project and flash it to the board, then run monitor tool to view serial output:
|
||||
|
||||
```
|
||||
idf.py -p PORT flash monitor
|
||||
```
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
There is this console output when bleprph is connected and characteristic is read:
|
||||
|
||||
```
|
||||
|
||||
I (118) BTDM_INIT: BT controller compile version [fe7ced0]
|
||||
I (118) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
|
||||
W (128) phy_init: failed to load RF calibration data (0xffffffff), falling back to full calibration
|
||||
@ -79,12 +83,11 @@ peer_id_addr=xx:xx:xx:xx:xx:xx conn_itvl=6 conn_latency=0 supervision_timeout=50
|
||||
|
||||
connection updated; status=0 handle=0 our_ota_addr_type=0 our_ota_addr=xx:xx:xx:xx:xx:xx our_id_addr_type=0 our_id_addr=xx:xx:xx:xx:xx:xx
|
||||
peer_ota_addr_type=1 peer_ota_addr=xx:xx:xx:xx:xx:xx peer_id_addr_type=1 peer_id_addr=xx:xx:xx:xx:xx:xx conn_itvl=39 conn_latency=0 supervision_timeout=500 encrypted=1 authenticated=1 bonded=1
|
||||
|
||||
```
|
||||
|
||||
## Running Python Utility
|
||||
|
||||
```
|
||||
```bash
|
||||
python bleprph_test.py
|
||||
```
|
||||
|
||||
@ -151,3 +154,7 @@ bluetooth adapter powered off
|
||||
|
||||
## Note
|
||||
* NVS support is not yet integrated to bonding. So, for now, bonding is not persistent across reboot.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
@ -1,7 +1,7 @@
|
||||
| Supported Targets | ESP32 |
|
||||
| ----------------- | ----- |
|
||||
|
||||
# BLE peripheral with ICMP Echo-Reply.
|
||||
# BLE Peripheral with ICMP Echo-Reply
|
||||
|
||||
(See the README.md file in the upper level 'examples' directory for more information about examples.)
|
||||
|
||||
@ -21,16 +21,25 @@ Ping operates by sending Internet Control Message Protocol (ICMP) echo request p
|
||||
|
||||
**Notes:** Currently this example only supports IPv4.
|
||||
|
||||
## How to Use Example
|
||||
|
||||
## How to use example
|
||||
Before project configuration and build, be sure to set the correct chip target using:
|
||||
|
||||
```bash
|
||||
idf.py set-target <chip_name>
|
||||
```
|
||||
|
||||
### Configure the project
|
||||
|
||||
```
|
||||
Open the project configuration menu:
|
||||
|
||||
```bash
|
||||
idf.py menuconfig
|
||||
```
|
||||
* Enter SSID and password of known WiFi AP with connectivity to internet.
|
||||
|
||||
In the `Example Configuration` menu:
|
||||
|
||||
* Enter SSID and password of known Wi-Fi AP with connectivity to internet.
|
||||
* Enter desired ping IP Address. Default is set to `93.184.216.34` ( This is the IP address of https://example.com ).
|
||||
|
||||
* Enter other related parameters like count of ping and maximum numbers of retry.
|
||||
@ -41,12 +50,12 @@ To test this demo, any BLE scanner app and a WiFi access point with internet con
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Build the project and flash it to the board, then run monitor tool to view serial output:
|
||||
|
||||
```
|
||||
idf.py -p PORT flash monitor
|
||||
```
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
|
||||
See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
Loading…
Reference in New Issue
Block a user