mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2026-07-04 23:41:07 +02:00
59ef15a218
Co-authored-by: doudar <17362216+doudar@users.noreply.github.com>
NimBLE Stream Echo Example
This is the simplest example demonstrating NimBLEStreamServer. It echoes back any data received from BLE clients.
Features
- Minimal code showing essential NimBLE Stream usage
- Echoes all received data back to the client
- Uses default service and characteristic UUIDs
- Perfect starting point for learning the Stream interface
How it Works
- Initializes BLE with minimal configuration
- Creates a stream server with default UUIDs
- Waits for client connection and data
- Echoes received data back to the client
- Displays received data in the ESP-IDF monitor output
Default UUIDs
- Service:
0xc0de - Characteristic:
0xfeed
Usage
- Build and flash this example to your ESP32 using ESP-IDF (
idf.py build flash monitor) - Connect with a BLE client app (nRF Connect, Serial Bluetooth Terminal, etc.)
- Find the service
0xc0deand characteristic0xfeed - Subscribe to notifications
- Write data to the characteristic
- The data will be echoed back and displayed in
idf.py monitor
Good For
- Learning the basic NimBLE Stream API
- Testing BLE connectivity
- Starting point for custom applications
- Understanding Stream read/write operations