ble: Bluetooth Low Energy (LX) |
Top Previous Next |
This Bluetooth library is used to communicate with Bluetooth Low Energy devices. This API is only supported on LX devices with BLE support. For BLE support on NX devices, see bt: Bluetooth functions (NX32L).
The examples BLE Scanner and BLE Beacon show how this API can be used.
. Common Bluetooth Low Energy management
Device connection handling
GATT Service and characteristics
Helper functions
MAC address formatBLE uses different kinds of MAC addresses. A public MAC address is a standard 48-bit MAC address as assigned by the IEEE Registration Authority. A random device address is generated on the device and might change on periodically. To differentiate between these addresses, this API uses strings of the following format to represent MAC addresses: "yXX:XX:XX:XX:XX:XX" y is the address type and is 'p' for public addresses and 'r' for random addresses. X is a hexadecimal value from 0-F, and is part of the normal address. The MAC address string can be created manually or using the bleMacCreate function.
Time unitsThis API uses the number of 0.625ms ticks for some time intervals. To convert a time in milliseconds to this format, use the bleTimeFromMs function
Error codesThe BLE API uses a number of common error codes across the functions. The following table lists the common error codes. The meaning may change slightly from function to function.
|