Examples
SimpleCBLE C examples that scan for peripherals, connect and list services, and subscribe to notifications, with the steps to build them with CMake.
You can find the official examples in the examples/simplecble directory of the repository.
- Scan: Scans for peripherals and prints their details.
- Connect: Connects to a selected peripheral and lists its services.
- Notify: Subscribes to notifications from a characteristic.
Building Examples
To build the examples:
cmake -S examples/simplecble -B build_examples
cmake --build build_examplesThe examples use the refactored error API and release all returned service/manufacturer snapshots. Run the executables from build_examples/bin. See the tutorial for local hosting and backend selection, and the migration guide to update an existing application.
API Reference
SimpleCBLE C API reference covering the calling convention, data ownership, errors, backends, adapters, peripherals and local peripheral hosting functions.
FAQ
Answers to common SimpleCBLE questions about freeing memory, error objects, owned collections, service snapshots and the lifetime of callback data.
