Inherits from NSObject
Declared in SBKBeacon.h

Overview

The SBKBeacon class defines the interface of a sensoro beacon device. You can use instances of this class to get rssi, sensor data or configurate device settings. You do not create instances of this class directly. Use SBKBeaconManager to get SBKBeacon instances.

The identity of a beacon is defined by its beaconID properties.

Tasks

Setting and Getting the Delegate

General Properties

Establishing or Canceling Connections with Beacon

Beacon Configuration

Writing Authorization

Temperature, Light and Accelerometer Sensor

Bridge to Core Bluetooth

Eddystone.

Properties

accelerometerCount

The number of accelerometer count.

@property (readonly, nonatomic, copy) NSNumber *accelerometerCount

Discussion

The number of accelerometer count.

Sensor data can only be updated when the app is running in the foreground.

Declared In

SBKBeacon.h

accuracy

The accuracy of the proximity value, measured in meters from the beacon. (read-only)

@property (readonly, nonatomic) CLLocationAccuracy accuracy

Discussion

The accuracy of the proximity value, measured in meters from the beacon. (read-only)

Indicates the one sigma horizontal accuracy in meters. Use this property to differentiate between beacons with the same proximity value. Do not use it to identify a precise location for the beacon. Accuracy values may fluctuate due to RF interference. A negative value in this property signifies that the actual accuracy could not be determined.

Declared In

SBKBeacon.h

aliBeacon

The flag whether device is broadcasting ali beacon info.

@property (nonatomic, readonly) NSNumber *aliBeacon

Discussion

The flag whether device is broadcasting ali beacon info.

Declared In

SBKBeacon.h

assignedPeripheral

The CBPeripheral object assign to this beacon.this object may be changed continuously.

@property (readonly, nonatomic, strong) CBPeripheral *assignedPeripheral

Discussion

The CBPeripheral object assign to this beacon.this object may be changed continuously.

Declared In

SBKBeacon.h

baseSettings

The dictionary of beacon base configuration attributes. (read-only)

@property (readonly, nonatomic) NSDictionary *baseSettings

Discussion

The dictionary of beacon base configuration attributes. (read-only)

This property will be available after connect. For available options, see SBKBeaconBaseSettings.

Declared In

SBKBeacon.h

batteryLevel

The battery charge level for the device. (read-only)

@property (readonly, nonatomic, copy) NSNumber *batteryLevel

Discussion

The battery charge level for the device. (read-only)

Battery level ranges from 0.0 to 1.0 (100% charged).

Declared In

SBKBeacon.h

beaconID

A SBKBeaconID object identify the beacon. (read-only)

@property (readonly, nonatomic, copy) SBKBeaconID *beaconID

Discussion

A SBKBeaconID object identify the beacon. (read-only)

Declared In

SBKBeacon.h

broadcastInterval

The broadcast transmit interval.

@property (nonatomic, readonly) NSNumber *broadcastInterval

Discussion

The broadcast transmit interval.

Declared In

SBKBeacon.h

broadcastTransmitPower

The broadcast transmit power.

@property (nonatomic, readonly) NSNumber *broadcastTransmitPower

Discussion

The broadcast transmit power.

Declared In

SBKBeacon.h

delegate

The delegate of the app object.

@property (readwrite, nonatomic, weak) id<SBKBeaconDelegate> delegate

Discussion

The delegate of the app object.

Declared In

SBKBeacon.h

eddystoneBID

The BID of UID packet of eddystone.

@property (readonly, nonatomic) NSData *eddystoneBID

Discussion

The BID of UID packet of eddystone.

Declared In

SBKBeacon.h

eddystoneNID

The NID of UID packet of eddystone.

@property (readonly, nonatomic) NSData *eddystoneNID

Discussion

The NID of UID packet of eddystone.

Declared In

SBKBeacon.h

eddystoneTLMEnabled

The flag whether TLM packet of eddystone is broadcasted.

@property (readonly, nonatomic) NSNumber *eddystoneTLMEnabled

Discussion

The flag whether TLM packet of eddystone is broadcasted.

Declared In

SBKBeacon.h

eddystoneTLMInterval

The interval of TLM packet of eddystone.

@property (readonly, nonatomic) NSNumber *eddystoneTLMInterval

Discussion

The interval of TLM packet of eddystone.

Declared In

SBKBeacon.h

eddystoneUIDEnabled

The flag whether UID packet of eddystone is broadcasted.

@property (readonly, nonatomic) NSNumber *eddystoneUIDEnabled

Discussion

The flag whether UID packet of eddystone is broadcasted.

Declared In

SBKBeacon.h

eddystoneURLEnabled

The flag whether URL packet of eddystone is broadcasted.

@property (readonly, nonatomic) NSNumber *eddystoneURLEnabled

Discussion

The flag whether URL packet of eddystone is broadcasted.

Declared In

SBKBeacon.h

eddystoneUrl

The URL of URL packet of eddystone.

@property (readonly, nonatomic) NSString *eddystoneUrl

Discussion

The URL of URL packet of eddystone.

Declared In

SBKBeacon.h

enhanceBroadcast

The flag whether beacon is in energy saving mode.

@property (nonatomic, readonly) NSNumber *enhanceBroadcast

Discussion

The flag whether beacon is in energy saving mode.

Declared In

SBKBeacon.h

firmwareVersion

The current firmware version for the device. (read-only)

@property (readonly, nonatomic, copy) NSString *firmwareVersion

Discussion

The current firmware version for the device. (read-only)

Declared In

SBKBeacon.h

hardwareModelName

The model of the device. (read-only)

@property (readonly, nonatomic, copy) NSString *hardwareModelName

Discussion

The model of the device. (read-only)

Declared In

SBKBeacon.h

inEnergySaving

The flag whether beacon is in energy saving mode.

@property (nonatomic, readonly) NSNumber *inEnergySaving

Discussion

The flag whether beacon is in energy saving mode.

Declared In

SBKBeacon.h

inRange

Returns a Boolean value that indicates whether the beacon is in range. (read-only)

@property (readonly, nonatomic, assign) BOOL inRange

Discussion

Returns a Boolean value that indicates whether the beacon is in range. (read-only)

Beacon will be marked out of range after approximate 8 second in order to prevent notifications delivering too frequently.

Declared In

SBKBeacon.h

inRangeMinimumRssiWhileEntering

the rssi value to decide if entering range of beacon.

@property (readwrite, nonatomic, assign) NSInteger inRangeMinimumRssiWhileEntering

Discussion

the rssi value to decide if entering range of beacon.

if received rssi is larger than this value, it is in range of this beacon.

Declared In

SBKBeacon.h

inRangeMinimumRssiWhileLeaving

the rssi value to decide if leaving range of beacon.

@property (readwrite, nonatomic, assign) NSInteger inRangeMinimumRssiWhileLeaving

Discussion

the rssi value to decide if leaving range of beacon.

if received rssi is less than this value, it is out of range of this beacon.

Declared In

SBKBeacon.h

light

The ambient light level in lux.

@property (readonly, nonatomic, copy) NSNumber *light

Discussion

The ambient light level in lux.

Sensor data can only be updated when the app is running in the foreground.

Declared In

SBKBeacon.h

moving

Flag indicating accelerometer state, boolean value wrapped in NSNumber.

@property (readonly, nonatomic, copy, getter=isMoving) NSNumber *moving

Discussion

Flag indicating accelerometer state, boolean value wrapped in NSNumber.

Sensor data can only be updated when the app is running in the foreground.

Declared In

SBKBeacon.h

proximity

The relative distance to the beacon. (read-only)

@property (readonly, nonatomic, assign) CLProximity proximity

Discussion

The relative distance to the beacon. (read-only)

The value in this property gives a general sense of the relative distance to the beacon. Use it to quickly identify beacons that are nearer to the user rather than farther away.

Declared In

SBKBeacon.h

rssi

The received signal strength of the beacon, measured in decibels. (read-only)

@property (readonly, nonatomic, assign) NSInteger rssi

Discussion

The received signal strength of the beacon, measured in decibels. (read-only)

If beacon is out of range, the value will be 0.

Declared In

SBKBeacon.h

secureBroadcastInterval

The value of sensor umm change interval attributes. (read-only)

@property (readonly, nonatomic) SBKBeaconSecureBroadcastInterval secureBroadcastInterval

Discussion

The value of sensor umm change interval attributes. (read-only)

you can change value, @see writeSecureBroadcastInterval:completion:

Declared In

SBKBeacon.h

sensorSettings

The dictionary of sensor configuration attributes. (read-only)

@property (readonly, nonatomic) NSDictionary *sensorSettings

Discussion

The dictionary of sensor configuration attributes. (read-only)

This property will be available after connect. For available options, see SBKBeaconSensorSettings.

Declared In

SBKBeacon.h

serialNumber

The beacon’s hardware serial number. (read-only)

@property (readonly, nonatomic, copy) NSString *serialNumber

Discussion

The beacon’s hardware serial number. (read-only)

Declared In

SBKBeacon.h

shakeToLightOn

Flag indicating switch state to shake to light on.

@property (readonly, nonatomic) NSNumber *shakeToLightOn

Discussion

Flag indicating switch state to shake to light on.

To shake to litght on is that you can use to ensure the device is working.

Declared In

SBKBeacon.h

temperature

Temperature value in Celsius

@property (readonly, nonatomic, copy) NSNumber *temperature

Discussion

Temperature value in Celsius

Sensor data can only be updated when the app is running in the foreground.

Declared In

SBKBeacon.h

workModel

The current work model for the device. (read-only)

@property (readonly, nonatomic) SBKBeaconWorkMode workModel

Discussion

The current work model for the device. (read-only)

Declared In

SBKBeacon.h

writePermissionStatus

Indicates if the application has permission to write setting to the beacon.

@property (readonly, nonatomic) SBKBeaconWritePermissionStatus writePermissionStatus

Discussion

Indicates if the application has permission to write setting to the beacon.

Declared In

SBKBeacon.h

Instance Methods

availableEnergySavingMode

Which energy saving mode the beacon supports.

- (SBKBeaconEnergySavingMode)availableEnergySavingMode

Return Value

Which energy saving mode the beacon supports.

Declared In

SBKBeacon.h

clearBroadcastKeyWithCompletion:

Clear the key to encrypt the broadcast packet.

- (BOOL)clearBroadcastKeyWithCompletion:(SBKBeaconCompletionBlock)completion

Parameters

completion

The block to execute after the clear is completed. If error parameter is nil means writing successfully.

Return Value

Can this clear operation be executed.

Discussion

Clear the key to encrypt the broadcast packet.

Declared In

SBKBeacon.h

clearWritePasswordWithCompletion:

Clear the beacon’s password.

- (BOOL)clearWritePasswordWithCompletion:(SBKBeaconCompletionBlock)completion

Parameters

completion

The block to execute after the writing is completed. If error parameter is nil means clear successfully.

Return Value

Can this clear operation be executed.

Discussion

Clear the beacon’s password.

Declared In

SBKBeacon.h

connectWithCompletion:

Establishes a connection to a beacon.

- (void)connectWithCompletion:(SBKBeaconCompletionBlock)completion

Parameters

completion

The block to execute after the connecting is completed. If error parameter is nil means connection has been established successfully.

Discussion

Establishes a connection to a beacon.

Declared In

SBKBeacon.h

connectionStatus

The current status of the connection.

- (SBKBeaconConnectionStatus)connectionStatus

Return Value

A SBKBeaconConnectionStatus enum value.

Discussion

The current status of the connection.

Declared In

SBKBeacon.h

disableAliBeaconWithCompletion:

Disable the AliBeacon broadcast.

- (BOOL)disableAliBeaconWithCompletion:(SBKBeaconCompletionBlock)completion

Parameters

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Disable the AliBeacon broadcast.

Declared In

SBKBeacon.h

disableEnhanceBroadcastWithCompletion:

Disable the enhance broadcast.

- (BOOL)disableEnhanceBroadcastWithCompletion:(SBKBeaconCompletionBlock)completion

Parameters

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Disable the enhance broadcast.

the Enhance broadcast can make the SDK find this device as Sensoro device even if iOS device was locked, in other words, the screen was turned off. Normally, this device can be found by iOS device as a iBeacon device. if you want use SDK and find Sensoro device when the iOS device was locked, you need enable this feature. To enable this mode will increase the power consumption.

Declared In

SBKBeacon.h

disableiBeaconWithCompletion:

Disable the iBeacon broadcast.

- (BOOL)disableiBeaconWithCompletion:(SBKBeaconCompletionBlock)completion

Parameters

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Disable the iBeacon broadcast.

Declared In

SBKBeacon.h

disconnect

Cancels an active or pending connection to a beacon.

- (void)disconnect

Discussion

Cancels an active or pending connection to a beacon.

Declared In

SBKBeacon.h

eddystonePackage:enable:completion:

enable some package of eddystone.

- (BOOL)eddystonePackage:(EddystonePackageType)package enable:(BOOL)enable completion:(SBKBeaconCompletionBlock)completion

Parameters

package

which package will enbaled or disabled;

enable

package is enbaled or disabled. YES : enable, NO : disable;

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

enable some package of eddystone.

Declared In

SBKBeacon.h

enableAliBeaconWithCompletion:

Enable the AliBeacon broadcast.

- (BOOL)enableAliBeaconWithCompletion:(SBKBeaconCompletionBlock)completion

Parameters

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Enable the AliBeacon broadcast.

Declared In

SBKBeacon.h

enableEnhanceBroadcastWithCompletion:

Enable the enhance broadcast.

- (BOOL)enableEnhanceBroadcastWithCompletion:(SBKBeaconCompletionBlock)completion

Parameters

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Enable the enhance broadcast.

the Enhance broadcast can make the SDK find this device as Sensoro device even if iOS device was locked, in other words, the screen was turned off. Normally, this device can be found by iOS device as a iBeacon device. if you want use SDK and find Sensoro device when the iOS device was locked, you need enable this feature. To enable this mode will increase the power consumption.

Declared In

SBKBeacon.h

enableiBeaconWithCompletion:

Enable the iBeacon broadcast.

- (BOOL)enableiBeaconWithCompletion:(SBKBeaconCompletionBlock)completion

Parameters

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Enable the iBeacon broadcast.

Declared In

SBKBeacon.h

flashLightWithCommand:repeat:completion:

flash light of SmartBeacon.

- (BOOL)flashLightWithCommand:(UInt8)command repeat:(UInt8)repeatCount completion:(SBKBeaconCompletionBlock)completion

Parameters

command

If the bit of command is 1, then this light will turn on one times, if 0 ,the light turn off. you can use custom command, or use @see SBKCommonLigthFlashCommand

repeatCount

The count that command was repeat.

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

flash light of SmartBeacon.

Declared In

SBKBeacon.h

isAccelerometerAvailable

Flag indicating whether accelerometer sensor is available.

- (BOOL)isAccelerometerAvailable

Return Value

Flag indicating whether accelerometer sensor is available.

Declared In

SBKBeacon.h

isBeacon

Flag indicating whether this beacon has beacon information, uuid, major, minor, proximity, accuracy etc..

- (BOOL)isBeacon

Return Value

Flag indicating whether this beacon has beacon information, uuid, major, minor, proximity, accuracy etc..

Declared In

SBKBeacon.h

isLightSensorAvailable

Flag indicating whether light sensor is available.

- (BOOL)isLightSensorAvailable

Return Value

Flag indicating whether light sensor is available.

Declared In

SBKBeacon.h

isSensor

Flag indicating whether this beacon has sensor information, temprature, light, accelerometer etc..

- (BOOL)isSensor

Return Value

Flag indicating whether this beacon has sensor information, temprature, light, accelerometer etc..

Declared In

SBKBeacon.h

isTemperatureSensorAvailable

Flag indicating whether temperature sensor is available.

- (BOOL)isTemperatureSensorAvailable

Return Value

Flag indicating whether temperature sensor is available.

Declared In

SBKBeacon.h

reloadSensorDataWithCompletion:

Causes beacon to reload temperature and light sensors data immediately.

- (BOOL)reloadSensorDataWithCompletion:(SBKBeaconCompletionBlock)completion

Parameters

completion

The block to execute after the operation is completed. If error parameter is nil means success.

Return Value

Can this operation be executed.

Discussion

Causes beacon to reload temperature and light sensors data immediately.

Declared In

SBKBeacon.h

requireWritePermissionWithPassword:completion:

You should use this method to request write permission if writePermissionStatus property is restricted.

- (BOOL)requireWritePermissionWithPassword:(NSString *)password completion:(SBKBeaconCompletionBlock)completion

Parameters

password

Password string.

completion

The block to execute after the operation is completed. If error parameter is nil means success.

Return Value

Can this operation be executed.

Discussion

You should use this method to request write permission if writePermissionStatus property is restricted.

Declared In

SBKBeacon.h

resetAccelerometerCountWithCompletion:

Resets accelerometer counter value to zero.

- (BOOL)resetAccelerometerCountWithCompletion:(SBKBeaconCompletionBlock)completion

Parameters

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this operation be executed.

Discussion

Resets accelerometer counter value to zero.

Declared In

SBKBeacon.h

resetToFactorySettingsWithCompletion:

Resets beacon to factory settings. This will reset proximityUUID, major, minor, baseSettings and sensorSettings to original values.

- (BOOL)resetToFactorySettingsWithCompletion:(SBKBeaconCompletionBlock)completion

Parameters

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Resets beacon to factory settings. This will reset proximityUUID, major, minor, baseSettings and sensorSettings to original values.

Declared In

SBKBeacon.h

updateWritePassword:completion:

Changes the beacon’s password.

- (BOOL)updateWritePassword:(NSString *)password completion:(SBKBeaconCompletionBlock)completion

Parameters

password

New password string.

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Changes the beacon’s password.

Declared In

SBKBeacon.h

writeBaseSettings:completion:

Updates base settings of this beacon.

- (BOOL)writeBaseSettings:(NSDictionary *)settings completion:(SBKBeaconCompletionBlock)completion

Parameters

settings

Configuration attributes you try to update in a dictionary. For available options, see SBKBeaconBaseSettings.

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Updates base settings of this beacon.

Declared In

SBKBeacon.h

writeBroadcastKey:completion:

Updates the key to encrypt the broadcast packet.

- (BOOL)writeBroadcastKey:(NSString *)key completion:(SBKBeaconCompletionBlock)completion

Parameters

key

the key to encrypt the broadcast packet;

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Updates the key to encrypt the broadcast packet.

Declared In

SBKBeacon.h

writeEddystoneBID:completion:

write eddystone bid of UID package.

- (BOOL)writeEddystoneBID:(NSString *)bidString completion:(SBKBeaconCompletionBlock)completion

Parameters

bidString

bid presented by hex string;

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

write eddystone bid of UID package.

Declared In

SBKBeacon.h

writeEddystoneNID:completion:

write eddystone nid of UID package.

- (BOOL)writeEddystoneNID:(NSString *)nidString completion:(SBKBeaconCompletionBlock)completion

Parameters

nidString

nid presented by hex string;

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

write eddystone nid of UID package.

Declared In

SBKBeacon.h

writeEddystoneTLMInterval:completion:

write eddystone interval of TLM package.

- (BOOL)writeEddystoneTLMInterval:(EddystoneTLMInterval)interval completion:(SBKBeaconCompletionBlock)completion

Parameters

interval

broadcast on this interval;

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

write eddystone interval of TLM package.

Declared In

SBKBeacon.h

writeEddystoneUrl:completion:

Write a url to eddystone.

- (BOOL)writeEddystoneUrl:(NSString *)url completion:(SBKBeaconCompletionBlock)completion

Parameters

url

The url that eddystone broadcast with url frame;

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Write a url to eddystone.

Declared In

SBKBeacon.h

writeMajor:minor:completion:

Updates major and minor of this beacon.

- (BOOL)writeMajor:(NSNumber *)major minor:(NSNumber *)minor completion:(SBKBeaconCompletionBlock)completion

Parameters

major

The major value.

minor

The minor value.

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Updates major and minor of this beacon.

Declared In

SBKBeacon.h

writeProximityUUID:completion:

Updates proximity UUID of this beacon.

- (BOOL)writeProximityUUID:(NSUUID *)proximityUUID completion:(SBKBeaconCompletionBlock)completion

Parameters

proximityUUID

Proximity UUID in NSUUID object.

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Updates proximity UUID of this beacon.

Declared In

SBKBeacon.h

writeSecureBroadcastInterval:completion:

Updates UMM Change interval.

- (BOOL)writeSecureBroadcastInterval:(SBKBeaconSecureBroadcastInterval)interval completion:(SBKBeaconCompletionBlock)completion

Parameters

interval

The Secure Broadcast change interval. it is enum of @see SBKBeaconSecureBroadcastInterval;

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Updates UMM Change interval.

Declared In

SBKBeacon.h

writeSensorSettings:completion:

Updates sensor settings of this beacon.

- (BOOL)writeSensorSettings:(NSDictionary *)settings completion:(SBKBeaconCompletionBlock)completion

Parameters

settings

Configuration attributes you try to update in a dictionary. For available options, see SBKBeaconSensorSettings.

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this writing operation be executed.

Discussion

Updates sensor settings of this beacon.

Declared In

SBKBeacon.h

writeShakeToLightOnState:completion:

Write the state of switch to shake to light on.

- (BOOL)writeShakeToLightOnState:(BOOL)state completion:(SBKBeaconCompletionBlock)completion

Parameters

state

YES: turn on this switch, NO: turn off this switch.

completion

The block to execute after the writing is completed. If error parameter is nil means writing successfully.

Return Value

Can this operation be executed.

Discussion

Write the state of switch to shake to light on.

Declared In

SBKBeacon.h