VLDBluetoothPeripheralControllerDelegate
@protocol VLDBluetoothPeripheralControllerDelegate
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.
-
Callback once a peripheral has been successfully found and paired if needed
Declaration
Objective-C
- (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
-
Callback if the peripheral was unable to be paired, or if the pairPeripheral: operation was cancelled
Declaration
Objective-C
- (void)bluetoothPeripheralController: (VLDBluetoothPeripheralController *)controller didNotPairPeripheral:(VLDBluetoothPeripheral *)peripheral error:(id)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
-
Callback indicating that the user can now begin taking a measurement with the peripheral
Declaration
Objective-C
- (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
-
Callback passing back the VLDRecord objects with the measurement data received from the peripheral and asking if they should be submitted to Validic
Declaration
Objective-C
- (id)bluetoothPeripheralController: (VLDBluetoothPeripheralController *)controller shouldSubmitReadings:(id)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
-
Callback indicating that the readFromPeripheral: operation was cancelled
Declaration
Objective-C
- (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
-
Callback indicating attempt to get a reading from the peripheral failed
Declaration
Objective-C
- (void)bluetoothPeripheralController: (VLDBluetoothPeripheralController *)controller readingFailedForPeripheral:(VLDBluetoothPeripheral *)peripheral error:(id)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
-
Callback indicating a serial number was read from a bluetooth connection
Declaration
Objective-C
- (void)bluetoothPeripheralController: (VLDBluetoothPeripheralController *)controller didReadSerialNumber:(id)serialNumber;
Parameters
controller
The VLDBluetoothPeripheralController instance that read the serial number
serialNumber
The serial number string read from the peripheral