bt: Bluetooth functions (NX) |
Top Previous Next |
This Bluetooth library is used to manage and communicate wireless with Bluetooth enabled devices. It supports both Bluetooth Classic and Bluetooth Low Energy. For LX devices a dedicated BLE API is available. See the section Bluetooth Low Energy (LX). Among the supported features are support for serial port profile(SPP) and Bluetooth Low Energy devices(BLE). The Bluetooth Server example provides an example of an SPP application.
Common Bluetooth management
Profiles
Bluetooth Low Energy(BLE)BLE devices typically broadcasts(advertises) some data which is made available in the manufacturer data. They may also provide a number of characteristics which are grouped by functionality into services. Each characteristic is used to manage a specific piece of data, e.g. a temperature or the battery level.
When dealing with a new device, it is necessary to use the btLEServiceGet and btLECharGet functions to determine the IDs of the wanted characteristics. Once the IDs are known, they can be used directly in the future, removing the need for the search. The Bluetooth Low Energy example provides an example on how to use the BLE functionality.
Error codesThe Bluetooth 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.
|