VLDBluetoothPeripheralControllerDelegate Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | VLDBluetoothPeripheralControllerDelegate.h |
Overview
The VLDBluetoothPeripheralControllerDelegate protocol provides callbacks to indicate the status of a pairPeripheral: or readFromPeripheral: operation. When performing a readFromPeripheral: operation you should listen for the bluetoothPeripheralController:isReadyToReadFromPeripheral: callback and then display to the user the readingInstructions from the VLDBluetoothPeripheral object.
Pairing Peripheral
– bluetoothPeripheralController:didPairPeripheral:
Callback once a peripheral has been successfully found and paired if needed
- (void)bluetoothPeripheralController:(VLDBluetoothPeripheralController *)controller didPairPeripheral:(VLDBluetoothPeripheral *)peripheral
Parameters
controller |
The VLDBluetoothPeripheralController instance that was doing the pairing |
---|---|
peripheral |
The bluetooth peripheral that was being paired |
Discussion
Callback once a peripheral has been successfully found and paired if needed
Declared In
VLDBluetoothPeripheralControllerDelegate.h
– bluetoothPeripheralController:didNotPairPeripheral:error:
Callback if the peripheral was unable to be paired, or if the pairPeripheral: operation was cancelled
- (void)bluetoothPeripheralController:(VLDBluetoothPeripheralController *)controller didNotPairPeripheral:(VLDBluetoothPeripheral *)peripheral error:(NSError *)error
Parameters
controller |
The VLDBluetoothPeripheralController instance that was doing the pairing |
---|---|
peripheral |
The bluetooth peripheral that was being paired |
error |
An NSError object with a code from the values in VLDBluetoothErrorCode indicating the type of error that occured |
Discussion
Callback if the peripheral was unable to be paired, or if the pairPeripheral: operation was cancelled
Declared In
VLDBluetoothPeripheralControllerDelegate.h
Reading From Peripheral
– bluetoothPeripheralController:isReadyToReadFromPeripheral:
Callback indicating that the user can now begin taking a measurement with the peripheral
- (void)bluetoothPeripheralController:(VLDBluetoothPeripheralController *)controller isReadyToReadFromPeripheral:(VLDBluetoothPeripheral *)peripheral
Parameters
controller |
The VLDBluetoothPeripheralController instance that is taking a reading |
---|---|
peripheral |
The bluetooth peripheral that is being read from |
Discussion
Callback indicating that the user can now begin taking a measurement with the peripheral
Declared In
VLDBluetoothPeripheralControllerDelegate.h
– bluetoothPeripheralController:shouldSubmitReadings:fromPeripheral:
Callback passing back the VLDRecord objects with the measurement data received from the peripheral and asking if they should be submitted to Validic
- (BOOL)bluetoothPeripheralController:(VLDBluetoothPeripheralController *)controller shouldSubmitReadings:(NSArray<__kindofVLDRecord*> *)records fromPeripheral:(VLDBluetoothPeripheral *)peripheral
Parameters
controller |
The VLDBluetoothPeripheralController instance that took the readings |
---|---|
records |
An array of records containing the readings received from the peripheral. Most peripherals will return a single reading, some may return more. |
peripheral |
The bluetooth peripheral that the readings came from |
Discussion
Callback passing back the VLDRecord objects with the measurement data received from the peripheral and asking if they should be submitted to Validic
Declared In
VLDBluetoothPeripheralControllerDelegate.h
– bluetoothPeripheralController:didCancelReadingForPeripheral:
Callback indicating that the readFromPeripheral: operation was cancelled
- (void)bluetoothPeripheralController:(VLDBluetoothPeripheralController *)controller didCancelReadingForPeripheral:(VLDBluetoothPeripheral *)peripheral
Parameters
controller |
The VLDBluetoothPeripheralController instance that was taking a reading |
---|---|
peripheral |
The bluetooth peripheral that was being read from |
Discussion
Callback indicating that the readFromPeripheral: operation was cancelled
Declared In
VLDBluetoothPeripheralControllerDelegate.h
– bluetoothPeripheralController:readingFailedForPeripheral:error:
Callback indicating attempt to get a reading from the peripheral failed
- (void)bluetoothPeripheralController:(VLDBluetoothPeripheralController *)controller readingFailedForPeripheral:(VLDBluetoothPeripheral *)peripheral error:(NSError *)error
Parameters
controller |
The VLDBluetoothPeripheralController instance that was taking a reading |
---|---|
peripheral |
The bluetooth peripheral that was being read from |
error |
An NSError object with a code from the values in VLDBluetoothErrorCode indicating the type of error that occured |
Discussion
Callback indicating attempt to get a reading from the peripheral failed
Declared In
VLDBluetoothPeripheralControllerDelegate.h