SimpleBLE

Examples

Code examples for SimpleBLE.

To learn how to use SimpleBLE, please refer to the examples provided in the repository. Those examples with a _safe suffix use the noexcept version of the library.

The following list briefly describes each example provided:

List Adapters

list_adapters

This example shows how to list all available Bluetooth adapters on the system. It prints the identifier and MAC address of each adapter.

Scan

scan

This example demonstrates how to scan for nearby BLE devices. It sets up callbacks to print information about devices as they are found and updated.

Connect

connect & connect_safe

This example connects to a specific BLE device (or the first one found) and lists its services and characteristics. It demonstrates the complete flow of scanning, connecting, and service discovery.

Read

read

This example shows how to read the value of a specific characteristic.

Write

write

This example shows how to write a value to a specific characteristic.

Notify

notify

This example demonstrates how to subscribe to notifications on a characteristic and receive updates asynchronously.

On this page