VLDBluetoothPeripheral
Objective-C
@interface VLDBluetoothPeripheral
Swift
class VLDBluetoothPeripheral
The VLDBluetoothPeripheral class represents Bluetooth peripheral models that can be discovered or read from by VLDBluetoothPeripheralController.
-
Returns the peripheral for the given ID
Declaration
Objective-C
+ (nullable VLDBluetoothPeripheral *)peripheralForID:(NSUInteger)peripheralID;
Swift
/*not inherited*/ init?(forID peripheralID: Any!)
Parameters
peripheralID
the ID of the peripheral to retrieve.
-
Indicates if a peripheral model requires a Bluetooth pairing before it can be used. If a peripheral requires pairing, you must first call
-[VLDBluetoothPeripheralController pairPeripheral:]
on VLDBluetoothPeripheralController at least once before calling-[VLDBluetoothPeripheralController readFromPeripheral:]
on VLDBluetoothPeripheralController.Declaration
Objective-C
@property (nonatomic) BOOL requiresPairing;
Swift
var requiresPairing: Int32 { get set }
-
Text to be presented to the user when
-[VLDBluetoothPeripheralController readFromPeripheral:]
is called on VLDBluetoothPeripheralController.Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *instructions;
-
Text to be presented to the user when the
-[VLDBluetoothPeripheralControllerDelegate bluetoothPeripheralController:isReadyToReadFromPeripheral:]
callback is sent to the VLDBluetoothPeripheralControllerDelegate.Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *readingInstructions;
-
Text to be presented to the user when
-[VLDBluetoothPeripheralController pairPeripheral:]
is called on VLDBluetoothPeripheralController and VLDBluetoothPeripheral property requiresPairing is TRUEDeclaration
Objective-C
@property (nonatomic, copy, nullable) NSString *pairingInstructions;
-
A version string (e.g. 1.4.2) indicating which version of the library supports this peripheral model
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *version;
-
Accessor for regular expression based on broadcasting name
Declaration
Objective-C
@property (nonatomic, strong, readonly) NSRegularExpression *_Nonnull broadcastingNameRegex;
-
Use this method to store data (such as a user-entered encryption key) in the SDK.
Declaration
Objective-C
- (void)storeData:(nullable NSObject<NSSecureCoding> *)data forKey:(nonnull NSString *)key ofPeripheralUUID:(nonnull NSString *)uuid;
Swift
func storeData(_ data: Any!, forKey key: Any!, ofPeripheralUUID uuid: Any!)
Parameters
data
an object (
NSData
,NSNumber
, orNSString
) to associate with a peripheral, ornil
to remove stored data for a given key and peripheralkey
the key to associate that object with. Allowed values are [
kVLDBluetoothPeripheralDataKeyEncryptionKey
]uuid
the UUID of the specific peripheral to associate the data to. This often comes from
VLDBluetoothOperationMetadata.peripheralUUID