BKDiscoverySettings

open class BKDiscoverySettings: NSObject

Property set of settings to configure the discovering process.

The DiscoverySettings properties are affecting the discovery process that is started by BKClient.initDiscovery() and the BKDiscoveryData contents of the result delegate.

You can access the DiscoverySettings by BKClient.discoverySettings

Every setting value is writeable and has a default value that is used if not changed by the developer.

  • Maximum value for rssi threshold: -20

    Declaration

    Swift

    open let RSSI_MAX = -20
  • Minimum value for rssi threshold: -120

    Declaration

    Swift

    open let RSSI_MIN = -120
  • Default value for rssi threshold: -85

    Declaration

    Swift

    open let RSSI_DEFAULT = -85
  • Gets the rssi threshold for the discovery.

    BLE modules with a higher rssi value will be discovered only.

    Declaration

    Swift

    open func getRssiThreshold() -> Int

    Return Value

    rssi threshold value, default is RSSI_DEFAULT

  • Sets the rssi threshold for the discovery.

    BLE modules with a higher rssi value will be discovered only.

    The valid range for the rssi threshold is limited by RSSI_MIN and RSSI_MAX

    Declaration

    Swift

    open func setRssiThreshold(_ rssiThreshold: Int)
  • Scan duration of one discovery phase: 5000 milliseconds.

    Declaration

    Swift

    open let SCANDURATION_DEFAULT = 5000
  • Value of the duration of one discovery phase in milliseconds. Default is SCANDURATION_DEFAULT

    After the scan duration has finished all scanned BLE data is saved into a list of BKOutputElement and returned by delegate BKClientDiscoveryDelegate.onDiscoveryResult(discoveryResultList: [BKOutputElement])

    Declaration

    Swift

    open var scanDuration: Int
  • Scan Wait duration between two discovery phase: 15000 milliseconds

    Declaration

    Swift

    open let SCANWAITDURATION_DEFAULT = 15000
  • Value of the waiting time between two discovery phase in milliseconds. Default is SCANWAITDURATION_DEFAULT

    Declaration

    Swift

    open var scanWaitDuration: Int
  • Default Value for disableWaitTimeAtStartForTime

    Declaration

    Swift

    open let DISABLESCANWAITTIMEATSTARTFORTIME_DEFAULT = 120
  • Value of the Time in seconds, wich the scanWaitDuration will be disabled, at the start of a scan. Default is DISABLEWAITTIMEATSTARTFORTIME_DEFAULT

    Declaration

    Swift

    open var disableScanWaitTimeAtStartForTime: Int
  • Enables / Disables Background scanning.

    Background mode: If the app change to the background, the scan will not stop. Conditions:

    • capabilities -> Background Modes -> Location Update -> enable
    • capabilities -> Background Modes -> Use Bluetooth LE accessoires -> enable
    • info.plist: Enter a value for NSLocationAlwaysUsageDescription Insert the following code in the didEnterBackground Delegate in the AppDelegate: var task = UIBackgroundTaskIdentifier() task = UIApplication.shared.beginBackgroundTask { UIApplication.shared.endBackgroundTask(task) task = UIBackgroundTaskInvalid }

    For power saving BLE scan is only in a iBeacon region active (Default-Region: 01234567-89AB-CDEF-000000000001 and 01234567-89AB-CDEF-000000000002) . If you want to scan an InfoBeacon in Background, you have to configure the blukii smartBeacon in Multimode, so that the blukii smartBeacon send iBeacon an infoBeacon protocol.

    Declaration

    Swift

    open var scanInBackground = true
  • State if the scan wait duration between two discovery phases is disabled on background. Default value is false

    Declaration

    Swift

    open var scanContinuouslyOnBackground = false
  • Sate if the scan wait duration between two discovery phases is disabled on foreground. Default value is true

    Declaration

    Swift

    open var scanContinuouslyOnForeground = true
  • Value, if discovery should scan for non blukii BLE modules.

    Note: The majority of BKOutputElement data is only supported for blukii modules: BKBeaconSensorData, BKResolveData and some value of BKDiscoveryData. BKEddystoneData and BKiBeaconData is also supported for non blukii modules.

    Default value is false

    Declaration

    Swift

    open var scanNonBlukiis = false
  • Sets the stat if discovery should scan for sensor data of blukii beacons.

    If this flag is set BKOutputElement.discoveryData may contain a valid BKBeaconSensorData object.

    Note: This flag is only relevant for blukii beacons

    Default value is true

    Declaration

    Swift

    open var scanBeaconSensorData = true
  • Sets the state if discovery should scan for Eddystone data.

    If this flag is set BKOutputElement.discoveryData may contain a valid BKEddystoneData object.

    Default value is false

    Declaration

    Swift

    open var scanEddystoneData = false
  • Set the state if discovery should scan for iBeacon data.

    If this flag is set BKOutputElement.discoveryData may contain a valid BKiBeaconData object.

    Note: For scanning iBeacons in the info.plist it is reuqiered to enter a value for NSLocationAlwaysUsageDescription.

    Default value is false

    Declaration

    Swift

    open var scanIBeaconData = false
  • Default Value iBeacon UUID Regions

    Values:

    • 01234567-89AB-CDEF-0123-000000000001
    • 01234567-89AB-CDEF-0123-000000000002

    Declaration

    Swift

    open let IBEACONREGIONS_DEFAULT = ["01234567-89AB-CDEF-0123-000000000001", "01234567-89AB-CDEF-0123-000000000002"]
  • Set the Regions that will be scanned by the Discovery Service.

    Default Value is IBEACONREGIONS_DEFAULT

    Declaration

    Swift

    open func setScanIBeaconRegions(_ regions: [String])

    Parameters

    regions

    Array with Region IDs

  • Get the Regions that will be scanned by the Discovery Service.

    Declaration

    Swift

    open func getScanIBeaconRegions() -> [String]

    Return Value

    Array with the Region UUID as String