Examples
Runnable SimpleDelphiBLE examples for Delphi and Free Pascal that scan, connect, read, write, receive notifications, host a GATT service and use a Dongl.
The examples live alongside the other SimpleBLE binding examples. Each is a console program that asks which adapter, peripheral, or characteristic to use:
- list_adapters: Print whether Bluetooth is enabled, and each adapter's name and address.
- list_backends: List the backends and the adapters each one provides.
- power_cycle: Power each adapter off and on again.
- scan: Discover peripherals and print their addresses, transmit power, manufacturer data, and services.
- connect: Connect to a peripheral and list its services, characteristics, and capabilities.
- read: Connect to a peripheral and read a characteristic.
- write: Connect to a peripheral and write text to a characteristic.
- notify: Connect to a peripheral and print a characteristic's notifications for five seconds.
- peripheral: Host a GATT service that echoes writes to subscribed clients.
- dongl: Scan with a Dongl, connect, and answer pairing requests.
Open an example's .dpr file in RAD Studio or Lazarus, or build it with Free
Pascal:
fpc -Fu<simpledelphible>/source -Fi<simpledelphible>/source -Fl<simpledelphible>/lib/<platform> scan.dprKeep the native libraries for your platform next to the program when you run it.
For installation, ownership, and threads, see Usage.
Usage
Install SimpleDelphiBLE and use SimpleBLE from Delphi and Lazarus apps on Windows, macOS and Linux to scan, connect, use GATT, host services and use a Dongl.
Usage
Build and install SimpleBluez, the C++ library for the BlueZ D-Bus API on Linux, use it from CMake as an installed, local or vendored library, and run tests.
