BLE SDK
Core module that provides low-level API for connecting to Corsano bracelets, performing commands on the bracelet, and getting raw data.
Main interfaces
The main entry point of BLE SDK is interface BleSdk. Its instance can be obtained by calling BleSdk.getInstance(). This method will always return the same (singleton) instance, so it is safe to keep a reference to it in the scope of your app.
Note: Make sure that
CosranoSdk.initialize()is called before accessing any other methods.
BleSdk – API surface of the BLE module, which provides access to other interfaces listed in the table below.
| Interface | Description | How to obtain |
|---|---|---|
| BleScanner | An abstraction around Android BLE Scanner for performing Corsano device lookup. | BleSdk.getScanner() |
| BleDevice | Represents physical Bluetooth device (bracelet) and provides methods for interaction with it. | BleSdk.getDevice(address) |
| BleRequest | Represents an intent to execute a command on the bracelet. Contains a command ID and parameters. | Create using public constructor, e.g. GetBatteryLevelRequest() |
| BleCommand | Represents an executable command. | BleDevice.newCommand(request) |
| BleFileTransfer | Special type of BleCommand for data streaming. | BleDevice.newFileTransfer(request) |
| NotificationSource | Interface for listening to Notifications from the device. | BleDevice.notifications |
| Bluetooth | Utility interface for working with Android BluetoothAdapter | BleSdk.getBluetooth() |