Class DiscoveryData

java.lang.Object
com.blukii.sdk.discovery.DiscoveryData
All Implemented Interfaces:
android.os.Parcelable

public final class DiscoveryData extends Object implements android.os.Parcelable
Read only data object for emitted data of one Bluetooth LE (BLE) module.

DiscoveryData 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 BeaconSensorData
  • Key data of blukii SmartKeys. See KeyData
  • Eddystone protocol data values. See EddystoneData
  • iBeacon protocol data values. See IBeaconData

Note: if the scan duration (see DiscoverySettings.setScanDuration(int)) is longer than the advertising interval of the module then 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 DiscoveryData object.
The discovery date (getDeviceFoundDate() is the timestamp of the last BLE frame that is scanned by the mobile device.

DiscoveryData is returned by the callback function BlukiiClient.OnDiscoveryListener.onDiscoveryResult(List) after calling BlukiiClient.initDiscovery(BlukiiClient.OnDiscoveryListener).

See Also:
  • Field Details

    • CREATOR

      public static final android.os.Parcelable.Creator<DiscoveryData> CREATOR
  • Method Details

    • getDeviceFoundDate

      public long getDeviceFoundDate()
      Gets the Timestamp of the last scanned BLE frame that is inside the relevant RSSI range (see setting DiscoverySettings.setRssiThreshold(int)).

      This field is set for every scanned BLE module.

      Returns:
      Timestamp in milliseconds
      See Also:
    • getRssi

      public short getRssi()
      Gets the RSSI value of the scanned BLE module.

      It depends on the flag DiscoverySettings.isCalculatingRssiAverage() 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 frames is taken.

      Note: BLE frames are only relevant if they are inside the RSSI range (see setting DiscoverySettings.setRssiThreshold(int)).

      This field is set for every scanned BLE module.

      Returns:
      RSSI value
      See Also:
    • getMacAddress

      public String getMacAddress()
      Gets the MAC Address of the BLE module.

      This field is set for every scanned BLE module.

      Returns:
      MAC Address
    • getBlukiiId

      public String getBlukiiId()
      Gets the blukii Id of the BLE module.

      This field is set for blukii modules only.

      Returns:
      blukii Id
    • getDeviceName

      public String getDeviceName()
      Gets the Device Name (scan response) of the BLE module.

      This field is set for every scanned BLE module.

      Returns:
      Device Name
    • getDevice

      public android.bluetooth.BluetoothDevice getDevice()
      Gets the BluetoothDevice object of the BLE module.

      This field is set for every scanned BLE module.

      Returns:
      BluetoothDevice object
    • getSecureBeaconState

      public SecureBeaconState getSecureBeaconState()
      Gets the state if blukii is advertising secure beacon values.

      This field is only valid for blukii Smart Beacons.

      Returns:
      SecureBeacon state
    • getEventBeaconState

      public CommonState getEventBeaconState()
      Gets the state if blukii is advertising event beacon values.

      This field is only valid for blukii Smart Beacons, since firmware 002.010.

      Returns:
      boolean state
    • getEnergySaveState

      public CommonState getEnergySaveState()
      Gets the state if blukii is advertising energy save frames.

      This field is only valid for blukii Smart Beacons since firmware 002.015 & since firmware 003.009

      Returns:
      CommonState state
    • getBeaconSensorData

      public BeaconSensorData getBeaconSensorData()
      Gets a data object of blukii sensor data.

      This field is only valid if sensor data has been received by blukii beacon, otherwise it is null.

      Important: BeaconSensorData is only received if DiscoverySettings.isScanBeaconSensorData() is set true.

      Returns:
      BeaconSensorData object, null if no blukii beacon sensor data has been received
      See Also:
    • getFirmware

      public String getFirmware()
      Gets the firmware version of a blukii.
      Returns:
      Firmware version string, null if it is not supported
    • getProduct

      public String getProduct()
      Gets the product ID of a blukii.
      Returns:
      Product ID string, null if it is not supported
    • getHardware

      public String getHardware()
      Gets the hardware version of a blukii.
      Returns:
      Hardware version string, null if it is not supported
    • isServiceMode

      public boolean isServiceMode()
      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

      Returns:
      true, if blukii Service Mode is active
    • getEddystoneData

      public EddystoneData getEddystoneData()
      Gets a data object of Eddystone beacon data.

      This field is only valid if Eddystone UID, URL or TLM data has been received by blukii beacon, otherwise it is null.

      Important: EddystoneData is only received if DiscoverySettings.isScanEddystoneData() is set true.

      Returns:
      EddystoneData object, null if no Eddystone data has been received
      See Also:
    • getiBeaconData

      public IBeaconData getiBeaconData()
      Gets a data object of iBeacon data.

      This field is only valid if iBeacon data has been received by blukii beacon, otherwise it is null.

      Important: IBeaconData is only received if DiscoverySettings.isScanIBeaconData() is set true.

      Returns:
      IBeaconData object, null if no iBeacon data has been received
      See Also:
    • getKeyData

      public KeyData getKeyData()
      Gets a data object of key data.

      This field is only valid for blukii Smart Keys.

      Returns:
      KeyData object, null if it is not a blukii SmartKey
      See Also:
    • getDeviceTracing

      public DeviceTracing getDeviceTracing()
      Gets a data object of device tracing.
      Returns:
      DeviceTracing object, null if no iBeacon data has been received
      See Also:
    • getType

      public BlukiiType getType()
      Gets the module type as BlukiiType.
      Returns:
      module type
    • getSubType

      public BlukiiSubType getSubType()
      Gets the module sub type as BlukiiSubType.
      Returns:
      module sub type
    • getAdvInterval

      public int getAdvInterval()
      Gets the advertising interval of a blukii.

      This field is only valid for blukiis.

      Returns:
      advertising interval in milliseconds, 0 if is not a blukii
    • getBattery

      public int getBattery()
      Gets the battery level value of a blukii.
      Returns:
      Battery charge in percent, Integer.MIN_VALUE if it is not supported
    • getTxPower

      public short getTxPower()
      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.

      Returns:
      TxPower in dBm, Short.MIN_VALUE if it is not supported
    • describeContents

      public int describeContents()
      Specified by:
      describeContents in interface android.os.Parcelable
    • writeToParcel

      public void writeToParcel(android.os.Parcel dest, int flags)
      Specified by:
      writeToParcel in interface android.os.Parcelable