BLUConfigurableBeacon Class Reference

Inherits from BLUBluetoothBeacon : BLUBeacon : NSObject
Declared in BLUConfigurableBeacon.h

Overview

BLUConfigurableBeacon objects represent beacons that have been identified as configurable by this framework.

Configurable beacons can be interacted with in various ways. They can be connected and disconnected. Their current configurations can be read in detail. New configurations can be written to them.

Properties

  delegate

The delegate object you want to receive BLUConfigurableBeacon events.

@property (nonatomic, weak, nullable) id<BLUConfigurableBeaconDelegate> delegate

Discussion

The delegate object you want to receive BLUConfigurableBeacon events.

Declared In

BLUConfigurableBeacon.h

  connectionState

The beacon’s current connection state.

@property (nonatomic, readonly) BLUConfigurableBeaconConnectionState connectionState

Discussion

The beacon’s current connection state.

Declared In

BLUConfigurableBeacon.h

  configuration

The beacon’s current configuration. This is only available after the beacon has been connected and read at least once during its lifetime.

@property (nonatomic, readonly) BLUBeaconConfiguration *configuration

Discussion

The beacon’s current configuration. This is only available after the beacon has been connected and read at least once during its lifetime.

Declared In

BLUConfigurableBeacon.h

  device

The device that is broadcasting the advertisements associated with this beacon.

@property (nonatomic, readonly) BLUDevice *device

Discussion

The device that is broadcasting the advertisements associated with this beacon.

See Also

Declared In

BLUConfigurableBeacon.h

  battery

The battery that is associated with this beacon.

@property (nonatomic, readonly) BLUBattery *battery

Discussion

The battery that is associated with this beacon.

See Also

Declared In

BLUConfigurableBeacon.h

Connection Methods

– connect

Initiates a connection attempt to the beacon.

- (void)connect

Discussion

Initiates a connection attempt to the beacon.

Declared In

BLUConfigurableBeacon.h

– forceConnectWithPassword:timeoutInterval:retryCount:

Initiates a forced connection attempt to the beacon. This option ignores all errors during a connection attempt.

- (void)forceConnectWithPassword:(nullable NSString *)password timeoutInterval:(NSTimeInterval)timeoutInterval retryCount:(NSUInteger)retryCount

Parameters

password

The password that will be used to connect to the beacon.

timeoutInterval

The amount of seconds the connection attempt can last before it is considered failed.

retryCount

The amount of connection attempts the framework will start before considering the connection failed.

Discussion

Initiates a forced connection attempt to the beacon. This option ignores all errors during a connection attempt.

Declared In

BLUConfigurableBeacon.h

– connectWithPassword:timeoutInterval:retryCount:

Initiates an advanced connection attempt to the beacon. Use this method to connect to password protected beacons.

- (NSError *)connectWithPassword:(nullable NSString *)password timeoutInterval:(NSTimeInterval)timeoutInterval retryCount:(NSUInteger)retryCount

Parameters

password

The password that will be used to connect to the beacon.

timeoutInterval

The amount of seconds the connection attempt can last before it is considered failed.

retryCount

The amount of connection attempts the framework will start before considering the connection failed.

Discussion

Initiates an advanced connection attempt to the beacon. Use this method to connect to password protected beacons.

Declared In

BLUConfigurableBeacon.h

Disconnection methods

– disconnect

Disconnects the beacon after all currently running operations have been finished.

- (void)disconnect

Discussion

Disconnects the beacon after all currently running operations have been finished.

Declared In

BLUConfigurableBeacon.h

– forceDisconnect

Disconnects the beacon immediately. Cancels all running operations.

- (void)forceDisconnect

Discussion

Disconnects the beacon immediately. Cancels all running operations.

Declared In

BLUConfigurableBeacon.h

Beacon settings

– enableBeaconSpeaker:andLED:

Flashes the beacon speaker and/or LED on supported Bluvision beacon models. The beacon needs to be connected in order to execute this.

- (void)enableBeaconSpeaker:(BOOL)enableSpeaker andLED:(BOOL)enableLED

Parameters

enableSpeaker

YES to enable the speaker. NO to ignore it.

enableLED

YES to enable the LED. NO ignore it.

Discussion

Flashes the beacon speaker and/or LED on supported Bluvision beacon models. The beacon needs to be connected in order to execute this.

Declared In

BLUConfigurableBeacon.h

– setNewBeaconPassword:completion:

Sets a new password on the beacon. If a valid password is specified, the beacon will be locked and only be accessible by connecting with that password. If no password is specified, the password protection of the beacon will be removed. The beacon needs to be connected in order to execute this.

- (void)setNewBeaconPassword:(nullable NSString *)password completion:(nullable void ( ^ ) ( NSError *__nullable error ))completion

Parameters

password

The password the beacon will be protected with or nil.

completion

The completion block that will be executed once the password operation has finished.

Discussion

Sets a new password on the beacon. If a valid password is specified, the beacon will be locked and only be accessible by connecting with that password. If no password is specified, the password protection of the beacon will be removed. The beacon needs to be connected in order to execute this.

Declared In

BLUConfigurableBeacon.h

Configuration

– setConfiguration:options:completion:

Sets a new configuration on the beacon. The configuration can either be written completely or by just overriding the changed beacon settings. The beacon needs to be connected in order to execute this.

- (void)setConfiguration:(BLUBeaconConfiguration *)configuration options:(BLUBeaconConfigurationOptions)options completion:(nullable void ( ^ ) ( BLUBeaconConfiguration *__nullable writtenConfiguration , NSError *__nullable error ))completion

Parameters

configuration

The scheduled configuration that will be written to the beacon.

options

The options specifying the type of the write operation.

completion

The completion block that will be executed once the configuration operation has finished.

Discussion

Sets a new configuration on the beacon. The configuration can either be written completely or by just overriding the changed beacon settings. The beacon needs to be connected in order to execute this.

Declared In

BLUConfigurableBeacon.h

– restoreDefaultSettingsWithCompletion:

Writes the default configuration to the beacon. The default configuration will disable all beacon advertisements except for sBeacon. The beacon needs to be connected in order to execute this.

- (void)restoreDefaultSettingsWithCompletion:(nullable void ( ^ ) ( BOOL success , NSError *__nullable error ))completion

Parameters

completion

The completion block that will be executed once the configuration operation has finished.

Discussion

Writes the default configuration to the beacon. The default configuration will disable all beacon advertisements except for sBeacon. The beacon needs to be connected in order to execute this.

Declared In

BLUConfigurableBeacon.h

Firmware updates

– updateFirmwareWithImage:progress:completion:

Updates the connected configurable beacon with new firmware provided as NSData.

- (void)updateFirmwareWithImage:(BLUFirmwareImage *)firmwareImage progress:(nullable void ( ^ ) ( float percentComplete ))progress completion:(nullable void ( ^ ) ( BOOL success , NSError *__nullable error ))completion

Parameters

firmwareImage

An BLUFirmwareImage object containing the firmware update image.

progress

A float for percentage ranging from 0.0 to 100.0.

completion

A completion block that will be executed once when the firmware has been updated.

Discussion

Updates the connected configurable beacon with new firmware provided as NSData.

Declared In

BLUConfigurableBeacon.h

– requiresLoaderImageForFirmwareImage:

Checks if a provided firmware image can be installed directly or needs to be updated in a two-step process.

- (BOOL)requiresLoaderImageForFirmwareImage:(BLUFirmwareImage *)firmwareImage

Parameters

firmwareImage

An BLUFirmwareImage object containing the firmware update image.

Return Value

A boolean specifying whether a loader image needs to be installed before installing the specified image.

Discussion

Checks if a provided firmware image can be installed directly or needs to be updated in a two-step process.

Declared In

BLUConfigurableBeacon.h