VLDBluetoothPeripheralControllerDelegate
Objective-C
@protocol VLDBluetoothPeripheralControllerDelegate <NSObject>
Swift
protocol VLDBluetoothPeripheralControllerDelegate : NSObjectProtocol
The VLDBluetoothPeripheralControllerDelegate protocol provides callbacks
to indicate the status of a -[VLDBluetoothPeripheralController pairPeripheral:]
or -[VLDBluetoothPeripheralController readFromPeripheral:]
operation. When performing a readFromPeripheral:
operation you should
listen for the -[VLDBluetoothPeripheralControllerDelegate bluetoothPeripheralController:isReadyToReadFromPeripheral:]
callback
and then display to the user the VLDBluetoothPeripheral.readingInstructions
from the
VLDBluetoothPeripheral object.
-
Callback once a peripheral has been successfully found and paired if needed
Declaration
Objective-C
- (void) bluetoothPeripheralController: (nonnull VLDBluetoothPeripheralController *)controller didPairPeripheral:(nonnull VLDBluetoothPeripheral *)peripheral metadata: (nonnull VLDBluetoothOperationMetadata *)metadata;
Swift
optional func bluetoothPeripheralController(_ controller: VLDBluetoothPeripheralController, didPairPeripheral peripheral: VLDBluetoothPeripheral, metadata: VLDBluetoothOperationMetadata)
Parameters
controller
The VLDBluetoothPeripheralController instance that was doing the pairing
peripheral
The bluetooth peripheral that was being paired
metadata
An object containing metatada about the operation
-
Callback if the peripheral was unable to be paired, or if the
-[VLDBluetoothPeripheralController pairPeripheral:]
operation was cancelledDeclaration
Objective-C
- (void) bluetoothPeripheralController: (nonnull VLDBluetoothPeripheralController *)controller didNotPairPeripheral:(nonnull VLDBluetoothPeripheral *)peripheral metadata: (nonnull VLDBluetoothOperationMetadata *)metadata error:(nullable NSError *)error;
Swift
optional func bluetoothPeripheralController(_ controller: VLDBluetoothPeripheralController, didNotPairPeripheral peripheral: VLDBluetoothPeripheral, metadata: VLDBluetoothOperationMetadata, error: (any Error)?)
Parameters
controller
The VLDBluetoothPeripheralController instance that was doing the pairing
peripheral
The bluetooth peripheral that was being paired
metadata
An object containing metatada about the operation
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: (nonnull VLDBluetoothPeripheralController *)controller isReadyToReadFromPeripheral:(nonnull VLDBluetoothPeripheral *)peripheral metadata: (nonnull VLDBluetoothOperationMetadata *)metadata;
Swift
optional func bluetoothPeripheralController(_ controller: VLDBluetoothPeripheralController, isReadyToReadFrom peripheral: VLDBluetoothPeripheral, metadata: VLDBluetoothOperationMetadata)
Parameters
controller
The VLDBluetoothPeripheralController instance that is taking a reading
peripheral
The bluetooth peripheral that is being read from
metadata
An object containing metatada about the operation
-
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
- (BOOL) bluetoothPeripheralController: (nonnull VLDBluetoothPeripheralController *)controller shouldSubmitReadings: (nonnull NSArray<__kindof VLDRecord *> *)records fromPeripheral:(nonnull VLDBluetoothPeripheral *)peripheral metadata: (nonnull VLDBluetoothOperationMetadata *)metadata;
Swift
optional func bluetoothPeripheralController(_ controller: VLDBluetoothPeripheralController, shouldSubmitReadings records: [VLDRecord], from peripheral: VLDBluetoothPeripheral, metadata: VLDBluetoothOperationMetadata) -> Bool
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
metadata
An object containing metatada about the operation
-
Callback indicating that the
-[VLDBluetoothPeripheralController readFromPeripheral:]
operation was cancelledDeclaration
Objective-C
- (void) bluetoothPeripheralController: (nonnull VLDBluetoothPeripheralController *)controller didCancelReadingForPeripheral:(nonnull VLDBluetoothPeripheral *)peripheral metadata: (nonnull VLDBluetoothOperationMetadata *)metadata;
Swift
optional func bluetoothPeripheralController(_ controller: VLDBluetoothPeripheralController, didCancelReadingFor peripheral: VLDBluetoothPeripheral, metadata: VLDBluetoothOperationMetadata)
Parameters
controller
The VLDBluetoothPeripheralController instance that was taking a reading
peripheral
The bluetooth peripheral that was being read from
metadata
An object containing metatada about the operation
-
Callback indicating attempt to get a reading from the peripheral failed
Declaration
Objective-C
- (void) bluetoothPeripheralController: (nonnull VLDBluetoothPeripheralController *)controller readingFailedForPeripheral:(nonnull VLDBluetoothPeripheral *)peripheral metadata: (nonnull VLDBluetoothOperationMetadata *)metadata error:(nullable NSError *)error;
Swift
optional func bluetoothPeripheralController(_ controller: VLDBluetoothPeripheralController, readingFailedFor peripheral: VLDBluetoothPeripheral, metadata: VLDBluetoothOperationMetadata, error: (any Error)?)
Parameters
controller
The VLDBluetoothPeripheralController instance that was taking a reading
peripheral
The bluetooth peripheral that was being read from
metadata
An object containing metatada about the operation
error
An NSError object with a code from the values in VLDBluetoothErrorCode indicating the type of error that occured
-
Deprecated
Use bluetoothPeripheralController:didPairPeripheral:metadata: instead.
Callback once a peripheral has been successfully found and paired if needed
Declaration
Objective-C
- (void)bluetoothPeripheralController: (VLDBluetoothPeripheralController *_Null_unspecified)controller didPairPeripheral: (VLDBluetoothPeripheral *_Null_unspecified)peripheral;
Swift
optional func bluetoothPeripheralController(_ controller: VLDBluetoothPeripheralController!, didPairPeripheral peripheral: VLDBluetoothPeripheral!)
Parameters
controller
The VLDBluetoothPeripheralController instance that was doing the pairing
peripheral
The bluetooth peripheral that was being paired
-
Deprecated
Use bluetoothPeripheralController:didNotPairPeripheral:metadata:error: instead.
Callback if the peripheral was unable to be paired, or if the
-[VLDBluetoothPeripheralController pairPeripheral:]
operation was cancelledDeclaration
Objective-C
- (void)bluetoothPeripheralController: (VLDBluetoothPeripheralController *_Null_unspecified)controller didNotPairPeripheral: (VLDBluetoothPeripheral *_Null_unspecified)peripheral error:(NSError *_Null_unspecified)error;
Swift
optional func bluetoothPeripheralController(_ controller: VLDBluetoothPeripheralController!, didNotPairPeripheral peripheral: VLDBluetoothPeripheral!, error: (any 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
-
Deprecated
Use bluetoothPeripheralController:isReadyToReadFromPeripheral:metadata: instead.
Callback indicating that the user can now begin taking a measurement with the peripheral
Declaration
Objective-C
- (void)bluetoothPeripheralController: (VLDBluetoothPeripheralController *_Null_unspecified)controller isReadyToReadFromPeripheral: (VLDBluetoothPeripheral *_Null_unspecified)peripheral;
Swift
optional func bluetoothPeripheralController(_ controller: VLDBluetoothPeripheralController!, isReadyToReadFrom peripheral: VLDBluetoothPeripheral!)
Parameters
controller
The VLDBluetoothPeripheralController instance that is taking a reading
peripheral
The bluetooth peripheral that is being read from
-
Deprecated
Use bluetoothPeripheralController:shouldSubmitReadings:fromPeripheral:metadata: instead.
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
- (BOOL)bluetoothPeripheralController: (VLDBluetoothPeripheralController *_Null_unspecified)controller shouldSubmitReadings: (NSArray<__kindof VLDRecord *> *_Null_unspecified)records fromPeripheral: (VLDBluetoothPeripheral *_Null_unspecified) peripheral;
Swift
optional func bluetoothPeripheralController(_ controller: VLDBluetoothPeripheralController!, shouldSubmitReadings records: [VLDRecord]!, from peripheral: VLDBluetoothPeripheral!) -> Bool
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
-
Deprecated
Use bluetoothPeripheralController:didCancelReadingForPeripheral:metadata: instead.
Callback indicating that the
-[VLDBluetoothPeripheralController readFromPeripheral:]
operation was cancelledDeclaration
Objective-C
- (void)bluetoothPeripheralController: (VLDBluetoothPeripheralController *_Null_unspecified)controller didCancelReadingForPeripheral: (VLDBluetoothPeripheral *_Null_unspecified)peripheral;
Swift
optional func bluetoothPeripheralController(_ controller: VLDBluetoothPeripheralController!, didCancelReadingFor peripheral: VLDBluetoothPeripheral!)
Parameters
controller
The VLDBluetoothPeripheralController instance that was taking a reading
peripheral
The bluetooth peripheral that was being read from
-
Deprecated
Use bluetoothPeripheralController:readingFailedForPeripheral:metadata:error: instead.
Callback indicating attempt to get a reading from the peripheral failed
Declaration
Objective-C
- (void)bluetoothPeripheralController: (VLDBluetoothPeripheralController *_Null_unspecified)controller readingFailedForPeripheral: (VLDBluetoothPeripheral *_Null_unspecified)peripheral error:(NSError *_Null_unspecified)error;
Swift
optional func bluetoothPeripheralController(_ controller: VLDBluetoothPeripheralController!, readingFailedFor peripheral: VLDBluetoothPeripheral!, error: (any 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