Package 

Class BluetoothPeripheralController


  • 
    public final class BluetoothPeripheralController
    
                        

    BluetoothPeripheralController is the primary interface for detecting and reading from Bluetooth peripherals. All peripheral updates are given to the peripheral controller's interface, BluetoothPeripheralControllerListener. More than one BluetoothPeripheralController may be instanced at a time, but each controller only performs one operation at a time. Any current operations must finish or be cancelled before a new operation can be started. The two possible operations are .pairPeripheral and .readFromPeripheral.

    If the BluetoothPeripheral has "requiresPairing" set to true, then you must first call pairPeripheral: to ensure that we are able to communicate with the peripheral and to do any necessary pairing. When you call .pairPeripheral, you should then present to the user the . When the (BluetoothPeripheralController, callback is called, you can assume all pairing has been done and it is now safe to call .readFromPeripheral.

    To get a reading from a peripheral, call .readFromPeripheral and pass in the BluetoothPeripheral object that you want to take a reading from. The reading operation will have multiple callbacks at different stages that are reported to the BluetoothPeripheralControllerListener. When the Record object is returned via callback, it is also simultaneously uploaded to Validic. Do not submit these records to Validic as they have already been submitted.