BKDiscoveryData

open class BKDiscoveryData : NSObject, NSSecureCoding

Read only data object for emitted data of on BLE module.

BKDiscoveryData is a collection of BLE data that is scanned during one scan duration for one BLE module.

It contains the following values if it is provided by the module’s hardware and firmware

  • Device found date
  • RSSI value
  • blukii Hardware specific advertising data like firmware, blukii type, advertising interval, battery and txPower
  • Sensor data results of blukii sensor beacons. See BKBeaconSensorData
  • Key data of blukii SmartKeys. See BKKeyData
  • Eddystone protocol data values. See BKEddystoneData
  • iBeacon protocol data values. See BKiBeaconData

Note: If the scan scan duration (see BKDiscoverySettings.scanDuration) is longer than the advertising interval of the module than each value is read only once. The following data frames of the same type are ignored if the corresponding fields are already set in the BKDiscoveryData object. The discovery date (deviceFoundDate) is the timestamp of the last BLE frame that is scanned by the mobile device.

BKDiscoveryData is returned by teh delegate function BKClientDiscoveryDelegate.onDiscoveryResult(_:)

  • Gets the Timestamp of the first scanned BLE frame that is inside the relevant RSSI range (see setting BKDiscoverySettings.setRSSIThreshold(_:)).

    This field is set for every scanned BLE module.

    Declaration

    Swift

    internal(set) open var deviceFoundDate: Date?

    Return Value

    Timestamp in milliseconds

  • Gets the MacAdress of the BLE module

    Declaration

    Swift

    internal(set) open var macAddress: String?

    Return Value

    MAC-Adress of the BLE module

  • The blukii Id of the BLE module.

    This field is set for blukii modules only.

    Declaration

    Swift

    internal(set) open var blukiiId: String?

    Return Value

    blukii ID

  • Gets the identifier of the BLE module

    This field is set for every scanned BLE module. This value is to prefer, if you want to have a uniqe identifier.

    Declaration

    Swift

    internal(set) open var identifier: UUID?

    Return Value

    CBPeripheral Identifier

  • Gets the Device Name of the BLE module.

    This field is set for every scanned BLE module.

    Declaration

    Swift

    internal(set) open var deviceName: String?

    Return Value

    Device Name

  • Gets the Bluetooth Device Object (CBPeripheral) of the BLE module.

    This field is set for every scanned BLE module

    Declaration

    Swift

    internal(set) open var device: CBPeripheral?

    Return Value

    CBPeripheral Object

  • Gets the state if blukii is advertising secure beacon values.

    This field is only valid for blukii SmartBeacons. This field is only valid, if the BKDiscoverySettings.securebeaconUUID is set correct.

    Declaration

    Swift

    internal(set) open var secureBeaconState: BKSecureBeaconState

    Return Value

    BKSecureBeaconState

  • Gets the state if blukii is advertising event beacon values.

    This field is only valid for blukii SmartBeacons, since firmware 002.010

    Declaration

    Swift

    internal(set) open var eventBeaconState: BKCommonState

    Return Value

    BKCommonState

  • Gets a data object of blukii sensor data.

    This field is only valid for blukii beacons that contain sensors.

    Declaration

    Swift

    internal(set) open var beaconSensorData: BKBeaconSensorData?

    Return Value

    BKBeaconSensorData object, nil if no blukii beacon sensors are available

  • Gets the firmware number of a blukii

    It is a 4-digit string that you have to inerpret as follows for blukii 2.0: Firmware = ABCD means firmware number A.B.C.D

    For blukii 3.0 you have to interpret as follow: Firmware = AAABBB menas firmware number AAA.BBB

    Declaration

    Swift

    internal(set) open var firmware: String?

    Return Value

    Firmware string, nil if it is not supported

  • Gets the Product ID of a blukii

    This field can be “blukii 2.0” or “blukii 3.0”

    Declaration

    Swift

    internal(set) open var product: String?

    Return Value

    Product ID string, nil if it is not supported

  • Checks if blukii Service Mode is active.

    Service Mode is active for 30 seconds are re-inserting the battery.

    It is needed for security relevant configurations, e.g. for SmartKey

    Declaration

    Swift

    internal(set) open var serviceMode: Bool

    Return Value

    true, if blukii Service Mode is active

  • Gets data object of Eddystone beacon data.

    This field is only valid for beacons that emit Eddystone UID, URL or TLM.

    Declaration

    Swift

    internal(set) open var eddystoneData: BKEddystoneData?

    Return Value

    BKEddystoneData Object, nil if it is not a Eddystone beacon

  • Gets a data object of iBeacon data.

    This field is only valid for beacons that emit iBeacon

    Declaration

    Swift

    internal(set) open var iBeaconData: BKiBeaconData?

    Return Value

    BKiBeaconData object, nil if it is not a iBeacon

  • Gets a data object of key data.

    this field is only valid for blukii SmartKeys.

    Declaration

    Swift

    internal(set) open var keyData: BKKeyData?

    Return Value

    KeyData object, nil if it is not a blukii Smart Key

  • Gets the module type

    Declaration

    Swift

    internal(set) open var type: BKBlukiiType

    Return Value

    Modul Type as BlukiiType

  • Gets the advertising interval of a blukii.

    This field is only valid for Blukiis

    Declaration

    Swift

    internal(set) open var advInterval: Int

    Return Value

    advertising interval in milliseconds, 0 if is not a blukii

  • Gets the battery level value of a blukii

    Declaration

    Swift

    internal(set) open var battery: Int

    Return Value

    Battery charge in percent, Int.min if it is not supported

  • Gets the txPower value of a blukii.

    It stands for the physical hardware setting of the BLE sender.

    This field is only valid for blukiis.

    Declaration

    Swift

    internal(set) open var txPower: Int16

    Return Value

    TxPower in dBm, Int16.min if it is not supported.

Get/Set

  • Gets the RSSI value of the scanned BLE module.

    It depends on the Flag BKDiscoverySettings.calculatingRssiAverage how the rssi value is calculated:

    • flag is true: The average value of all BLE frames is calculated.
    • flag is false: The value of the last BLE frame is takedn. Note: BLE frames are only relevant if they are insede the RSSI range (@see setting BKDiscoverySettings.setRssiThreshold(_:)

    This field is set for every scanned BLE module.

    Declaration

    Swift

    open func getRssi() -> Int

    Return Value

    Int Rssi Value