VLDBluetoothPeripheralController Class Reference
Inherits from | NSObject |
---|---|
Declared in | VLDBluetoothPeripheralController.h |
Overview
VLDBluetoothPeripheralController is the primary interface for detecting and reading from Bluetooth peripherals. All peripheral updates are given to the peripheral controller’s delegate object (VLDBluetoothPeripheralControllerDelegate).
The peripheral 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 VLDBluetoothPeripheral 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 instructions of the VLDBluetoothPeripheral. When the
bluetoothPeripheralController:didPairPeripheral:
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 VLDBluetoothPeripheral object that you want to take a reading from. The reading operation will have multiple callbacks at different stages that are reported to the VLDBluetoothPeripheralControllerDelegate. When the VLDRecord 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.
delegate
The object that acts as the delegate of the peripheral controller.
@property (nonatomic, weak) id<VLDBluetoothPeripheralControllerDelegate> delegate
Discussion
The object that acts as the delegate of the peripheral controller.
Must conform to VLDBluetoothPeripheralControllerDelegate protocol.
Declared In
VLDBluetoothPeripheralController.h
– pairPeripheral:
Pairs a Bluetooth peripheral.
- (BOOL)pairPeripheral:(VLDBluetoothPeripheral *)peripheral
Parameters
peripheral |
the peripheral to pair with. |
---|
Discussion
Pairs a Bluetooth peripheral.
Returns NO if the controller is already pairing or reading from a peripheral.
Returns YES if the controller is available.
Declared In
VLDBluetoothPeripheralController.h
– readFromPeripheral:
Reads from a Bluetooth peripheral
- (BOOL)readFromPeripheral:(VLDBluetoothPeripheral *)peripheral
Parameters
peripheral |
the peripheral to read from. |
---|
Discussion
Reads from a Bluetooth peripheral
Returns NO if the controller is already pairing or reading from a peripheral
Returns YES if the controller is available
Declared In
VLDBluetoothPeripheralController.h
– cancel
Cancels all Bluetooth operations and disconnects from any connected peripherals
- (void)cancel
Discussion
Cancels all Bluetooth operations and disconnects from any connected peripherals
A new read or pair operation cannot begin until the current operation is finished or cancelled.
Declared In
VLDBluetoothPeripheralController.h
– operationInProgress
Determines if a read or pair operation is currently in progress
- (BOOL)operationInProgress
Discussion
Determines if a read or pair operation is currently in progress
If an operation is in progress, it will need to be cancelled before a new operation can be started.
Declared In
VLDBluetoothPeripheralController.h