Class DiscoveryData
- All Implemented Interfaces:
android.os.Parcelable
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)
.
-
Nested Class Summary
-
Field Summary
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Method Summary
Modifier and TypeMethodDescriptionint
int
Gets the advertising interval of a blukii.int
Gets the battery level value of a blukii.Gets a data object of blukii sensor data.Gets the blukii Id of the BLE module.android.bluetooth.BluetoothDevice
Gets the BluetoothDevice object of the BLE module.long
Gets the Timestamp of the last scanned BLE frame that is inside the relevant RSSI range (see settingDiscoverySettings.setRssiThreshold(int)
).Gets the Device Name (scan response) of the BLE module.Gets a data object of device tracing.Gets a data object of Eddystone beacon data.Gets the state if blukii is advertising energy save frames.Gets the state if blukii is advertising event beacon values.Gets the firmware version of a blukii.Gets the hardware version of a blukii.Gets a data object of iBeacon data.Gets a data object of key data.Gets the MAC Address of the BLE module.Gets the product ID of a blukii.short
getRssi()
Gets the RSSI value of the scanned BLE module.Gets the state if blukii is advertising secure beacon values.Gets the module sub type asBlukiiSubType
.short
Gets the txPower value of a blukii.getType()
Gets the module type asBlukiiType
.boolean
Checks if blukii Service Mode is active.void
writeToParcel
(android.os.Parcel dest, int flags)
-
Field Details
-
CREATOR
-
-
Method Details
-
getDeviceFoundDate
public long getDeviceFoundDate()Gets the Timestamp of the last scanned BLE frame that is inside the relevant RSSI range (see settingDiscoverySettings.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
Gets the MAC Address of the BLE module.This field is set for every scanned BLE module.
- Returns:
- MAC Address
-
getBlukiiId
Gets the blukii Id of the BLE module.This field is set for blukii modules only.
- Returns:
- blukii Id
-
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
Gets the state if blukii is advertising secure beacon values.This field is only valid for blukii Smart Beacons.
- Returns:
- SecureBeacon state
-
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
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
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
Gets the firmware version of a blukii.- Returns:
- Firmware version string, null if it is not supported
-
getProduct
Gets the product ID of a blukii.- Returns:
- Product ID string, null if it is not supported
-
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
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
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
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
Gets a data object of device tracing.- Returns:
- DeviceTracing object, null if no iBeacon data has been received
- See Also:
-
getType
Gets the module type asBlukiiType
.- Returns:
- module type
-
getSubType
Gets the module sub type asBlukiiSubType
.- 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 interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags) - Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-