|
Veethree D7 SDK
|
This is an example to connect to a BLE peripheral, query services and receive notifications.
Before connecting to a BLE peripheral, open the D7 shell, enable Bluetooth and create a pairing request to the remote device using commands given in Bluetooth Basics.
Scan for the BLE peripheral on the D7:
The scan returns a list of BLE peripherals and the response may look like:
Connect to the BLE peripheral:
if the scan reported a Random MAC address, instead of Public, pass -t random to the command. The flag -I starts an interactive session. Connect to the device:
If connected to successfully, the session screen will show notifications when they occur from the remote device.
To list all primary services:
To list all characteristics:
To read a characteristic:
Note: Qt Bluetooth Low Energy Scanner provides GUI app to scan and browse BLE peripherals and this can be run on the D7 to view characteristics of scanned devices.