Class DiscoverySettings
- All Implemented Interfaces:
android.os.Parcelable
The DiscoverySettings properties are affecting the discovery process that is started by
BlukiiClient.startDiscovery() and the DiscoveryData contents of the result
callbacks.
You can access the DiscoverySettings by calling BlukiiClient.getDiscoverySettings().
Every settings value is writable and has a default value that is used if not changed by the developer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHelper for Default Filter Lists -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final android.os.Parcelable.Creator<DiscoverySettings>static final intDefault value for rssi threshold: -85.static final intMaximum value for rssi threshold: -20.static final intMinimum value for rssi threshold: -120.static final intScan duration of one discovery phase: 5000 milliseconds.static final intScan mode with balanced power consumption and scan frequency:ScanSettings.SCAN_MODE_BALANCED.static final intScan mode with high power consumption and scan frequency:ScanSettings.SCAN_MODE_LOW_LATENCY.static final intScan mode with low power consumption and scan frequency:ScanSettings.SCAN_MODE_LOW_POWER.static final intScan wait duration wait duration between two discovery phases.Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Method Summary
Modifier and TypeMethodDescriptionintintGets the discovery profile.intGets the rssi threshold for the discovery.intGets the duration of one discovery phase.intGets the scan mode concerning power consumption and scan frequency.intGets the wait duration between two discovery phases.booleanGets the state if discovery should calculate the average RSSI of all scanned frames.booleanGets the state if discovery should list every frame in the result list.booleanGets the state if blukii monitoring is enabled.booleanGets the state if discovery should be continued after reboot of Android.booleanGets the state if discovery should scan for sensor data of blukii beacons.booleanGets the state if discovery should scan for basic blukii data like firmware, advertising interval etc.booleanGets the state if discovery should scan for device tracing packets.booleanGets the state if discovery should scan for Eddystone data.booleanGets the state if discovery should scan for iBeacon data.booleanGets the state if discovery should scan for non blukii BLE modules.voidsetCalculatingRssiAverage(boolean calculatingRssiAverage) Sets the state if discovery should calculate the average RSSI of all scanned frames.voidsetListEveryFrame(boolean listEveryFrame) Sets the state if discovery should list every frame in the result list or not.voidsetMonitoringEnabled(boolean enabled) Gets the state if blukii monitoring is enabled.voidsetPersisted(boolean persisted) Gets the state if discovery should be continued after reboot of Android.voidsetProfile(int profile) Sets the discovery profile.voidsetRssiThreshold(int rssiThreshold) Sets the rssi threshold for the discovery.voidsetScanBeaconSensorData(boolean scanBeaconSensorData) Sets the state if discovery should scan for sensor data of blukii beacons.voidsetScanBlukiiData(boolean scanBlukiiData) Sets the state if discovery should scan for sensor data of blukii beacons.voidsetScanDeviceTracingData(boolean scanDeviceTracingData) Sets the state if discovery should scan for device tracing packets.voidsetScanDuration(int scanDuration) Gets the duration of one discovery phase.voidsetScanEddystoneData(boolean scanEddystoneData) Sets the state if discovery should scan for Eddystone data.voidsetScanFilters(List<android.bluetooth.le.ScanFilter> filters) Sets a list of Bluetooth LE ScanFiltersvoidsetScanIBeaconData(boolean scanIBeaconData) Sets the state if discovery should scan for iBeacon data.voidsetScanMode(int scanMode) Sets the scan mode concerning power consumption and scan frequency.voidsetScanNonBlukiis(boolean scanNonBlukiis) Sets the state if discovery should also scan for non blukii BLE modules.voidsetScanWaitDuration(int scanWaitTime) Sets the wait duration between two discovery phases.voidwriteToParcel(android.os.Parcel parcel, int i)
-
Field Details
-
RSSI_MAX
public static final int RSSI_MAXMaximum value for rssi threshold: -20. -
RSSI_MIN
public static final int RSSI_MINMinimum value for rssi threshold: -120. -
RSSI_DEFAULT
public static final int RSSI_DEFAULTDefault value for rssi threshold: -85. -
SCANMODE_LOWPOWER
public static final int SCANMODE_LOWPOWERScan mode with low power consumption and scan frequency:ScanSettings.SCAN_MODE_LOW_POWER.- See Also:
-
getScanMode()setScanMode(int)ScanSettings- Constant Field Values
-
SCANMODE_BALANCED
public static final int SCANMODE_BALANCEDScan mode with balanced power consumption and scan frequency:ScanSettings.SCAN_MODE_BALANCED.- See Also:
-
getScanMode()setScanMode(int)ScanSettings- Constant Field Values
-
SCANMODE_LOWLATENCY
public static final int SCANMODE_LOWLATENCYScan mode with high power consumption and scan frequency:ScanSettings.SCAN_MODE_LOW_LATENCY.- See Also:
-
getScanMode()setScanMode(int)ScanSettings- Constant Field Values
-
SCANDURATION_DEFAULT
public static final int SCANDURATION_DEFAULTScan duration of one discovery phase: 5000 milliseconds. -
SCANWAITDURATION_DEFAULT
public static final int SCANWAITDURATION_DEFAULTScan wait duration wait duration between two discovery phases. -
CREATOR
-
-
Method Details
-
getRssiThreshold
public int getRssiThreshold()Gets the rssi threshold for the discovery.BLE modules with a higher rssi value will be discovered only.
- Returns:
- rssi threshold value, default is
RSSI_DEFAULT - See Also:
-
setRssiThreshold
public void setRssiThreshold(int rssiThreshold) 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_MINandRSSI_MAX.- Parameters:
rssiThreshold- rssi threshold value, default isRSSI_DEFAULT- See Also:
-
getScanMode
public int getScanMode()Gets the scan mode concerning power consumption and scan frequency.The values are integer values derived from the
ScanSettingsclass of the android.bluetooth.le library:- Returns:
- scan mode, default is
SCANMODE_BALANCED - See Also:
-
setScanMode
public void setScanMode(int scanMode) Sets the scan mode concerning power consumption and scan frequency.The values are integer values derived from the
ScanSettingsclass of the android.bluetooth.le library:- Parameters:
scanMode- scan mode, default isSCANMODE_BALANCED- See Also:
-
getScanDuration
public int getScanDuration()Gets the duration of one discovery phase.After the scan duration has finished all scanned BLE data is saved into a List of
DiscoveryDataand returned by callbackBlukiiClient.OnDiscoveryListener.onDiscoveryResult(List).See also
getScanWaitDuration()to optimize the discovery concerning power consumption.- Returns:
- scan duration in milliseconds, default is
SCANDURATION_DEFAULT. - See Also:
-
setScanDuration
public void setScanDuration(int scanDuration) Gets the duration of one discovery phase.After the scan duration has finished all scanned BLE data is saved into a List of
DiscoveryDataand returned by callbackBlukiiClient.OnDiscoveryListener.onDiscoveryResult(List).See also
getScanWaitDuration()to optimize the discovery concerning power consumption.- Parameters:
scanDuration- scan duration in milliseconds, default isSCANDURATION_DEFAULT.- See Also:
-
getScanWaitDuration
public int getScanWaitDuration()Gets the wait duration between two discovery phases.You can use this feature to minimize power consumption if you do not need an continuous scan.
This setting only takes affect for
DiscoveryProfile.ALTERNATE. Therefore seesetProfile(int).- Returns:
- scan wait duration in milliseconds, default is
SCANWAITDURATION_DEFAULT. - See Also:
-
setScanWaitDuration
public void setScanWaitDuration(int scanWaitTime) Sets the wait duration between two discovery phases.You can use this feature to minimize power consumption if you do not need an continuous scan.
This setting only takes affect for
DiscoveryProfile.ALTERNATE. Therefore seesetProfile(int).- Parameters:
scanWaitTime- scan wait duration in milliseconds, default isSCANWAITDURATION_DEFAULT.- See Also:
-
getProfile
public int getProfile()Gets the discovery profile.It defines whether BLE scan is running depending on the apps state (foreground, background, screen off).
Please see class
DiscoveryProfilefor more information.- Returns:
- discovery profile, default is
DiscoveryProfile.FOREGROUND - See Also:
-
setProfile
public void setProfile(int profile) Sets the discovery profile.It defines whether BLE scan is running depending on the apps state (foreground, background, screen off).
Please see class
DiscoveryProfilefor more information.- Parameters:
profile- discovery profile, default isDiscoveryProfile.FOREGROUND- See Also:
-
isPersisted
public boolean isPersisted()Gets the state if discovery should be continued after reboot of Android.Note: Activating this setting needs the RECEIVE_BOOT_COMPLETED permission in your app's manifest
- Returns:
- state if if discovery should be continued after reboot, default is false
-
setPersisted
@RequiresPermission("android.permission.RECEIVE_BOOT_COMPLETED") public void setPersisted(boolean persisted) Gets the state if discovery should be continued after reboot of Android.Note: Activating this setting needs the RECEIVE_BOOT_COMPLETED permission in your app's manifest
- Parameters:
persisted- state if if discovery should be continued after reboot, default is false
-
isScanNonBlukiis
public boolean isScanNonBlukiis()Gets the state if discovery should scan for non blukii BLE modules.Note: the majority of
DiscoveryDatadata is only supported for blukii modules:BeaconSensorData,InfoDataand some value ofDiscoveryData.EddystoneDataandIBeaconDatais also supported for non blukii modules.- Returns:
- state if non blukii BLE modules are scanned, default is false
- See Also:
-
setScanNonBlukiis
public void setScanNonBlukiis(boolean scanNonBlukiis) Sets the state if discovery should also scan for non blukii BLE modules.Note: the majority of
DiscoveryDatadata is only supported for blukii modules:BeaconSensorData,InfoDataand some value ofDiscoveryData.EddystoneDataandIBeaconDatais also supported for non blukii modules.- Parameters:
scanNonBlukiis- state if non blukii BLE modules are scanned, default is false
-
isScanBlukiiData
public boolean isScanBlukiiData()Gets the state if discovery should scan for basic blukii data like firmware, advertising interval etc.- Returns:
- state if basic blukii data is scanned, default is true
- See Also:
-
setScanBlukiiData
public void setScanBlukiiData(boolean scanBlukiiData) Sets the state if discovery should scan for sensor data of blukii beacons.If this flag is set
DiscoveryDatamay contain a validBeaconSensorDataobject.Note: This flag is only relevant for blukii beacons
- Parameters:
scanBlukiiData- state if basic blukii data is scanned, default is true- See Also:
-
isScanBeaconSensorData
public boolean isScanBeaconSensorData()Gets the state if discovery should scan for sensor data of blukii beacons.If this flag is set
DiscoveryDatamay contain a validBeaconSensorDataobject.Note: This flag is only relevant for blukii beacons
- Returns:
- state if blukii beacon sensor data is scanned, default is false
- See Also:
-
setScanBeaconSensorData
public void setScanBeaconSensorData(boolean scanBeaconSensorData) Sets the state if discovery should scan for sensor data of blukii beacons.If this flag is set
DiscoveryDatamay contain a validBeaconSensorDataobject.Note: This flag is only relevant for blukii beacons
- Parameters:
scanBeaconSensorData- state if blukii beacon sensor data is scanned, default is false- See Also:
-
isScanEddystoneData
public boolean isScanEddystoneData()Gets the state if discovery should scan for Eddystone data.If this flag is set
DiscoveryDatamay contain a validEddystoneDataobject.- Returns:
- state if Eddystone data is scanned, default is false
- See Also:
-
setScanEddystoneData
public void setScanEddystoneData(boolean scanEddystoneData) Sets the state if discovery should scan for Eddystone data.If this flag is set
DiscoveryDatamay contain a validEddystoneDataobject.- Parameters:
scanEddystoneData- state if Eddystone data is scanned, default is false- See Also:
-
isScanIBeaconData
public boolean isScanIBeaconData()Gets the state if discovery should scan for iBeacon data.If this flag is set
DiscoveryDatamay contain a validIBeaconDataobject.- Returns:
- state if iBeacon data is scanned, default is false
- See Also:
-
setScanIBeaconData
public void setScanIBeaconData(boolean scanIBeaconData) Sets the state if discovery should scan for iBeacon data.If this flag is set
DiscoveryDatamay contain a validIBeaconDataobject.- Parameters:
scanIBeaconData- state if iBeacon data is scanned, default is false- See Also:
-
isScanDeviceTracingData
public boolean isScanDeviceTracingData()Gets the state if discovery should scan for device tracing packets.If this flag is set
DiscoveryDatamay contain a validDeviceTracingobject.- Returns:
- state if DeviceTracing data is scanned, default is false
- See Also:
-
setScanDeviceTracingData
public void setScanDeviceTracingData(boolean scanDeviceTracingData) Sets the state if discovery should scan for device tracing packets.If this flag is set
DiscoveryDatamay contain a validTracedDeviceobject.- Parameters:
scanDeviceTracingData- state if DeviceTracing data is scanned, default is false- See Also:
-
isCalculatingRssiAverage
public boolean isCalculatingRssiAverage()Gets the state if discovery should calculate the average RSSI of all scanned frames.Otherwise the last found RSSI value is returned on
DiscoveryData.getRssi()- Returns:
- true if RSSI average is calculated
- See Also:
-
setCalculatingRssiAverage
public void setCalculatingRssiAverage(boolean calculatingRssiAverage) Sets the state if discovery should calculate the average RSSI of all scanned frames.Otherwise the last found RSSI value is returned on
DiscoveryData.getRssi()- Parameters:
calculatingRssiAverage- state if RSSI average is calculated, default is false- See Also:
-
isEveryFrameListed
public boolean isEveryFrameListed()Gets the state if discovery should list every frame in the result list.- Returns:
trueif every frame is listed
-
setListEveryFrame
public void setListEveryFrame(boolean listEveryFrame) Sets the state if discovery should list every frame in the result list or not.Values:
trueevery received frame is listed as separateDiscoveryDatadata object.falseall received frames of one scan duration are summarized (default), so there is only oneDiscoveryDatadata object of each device.
- Parameters:
listEveryFrame-trueif every frame should be listed, otherwisefalse
-
isMonitoringEnabled
public boolean isMonitoringEnabled()Gets the state if blukii monitoring is enabled. If enabled, data like Battery State of the blukii device is transferred to blukii Cloud.- Returns:
trueif Monitoring enabled
-
setMonitoringEnabled
@RequiresApi(api=23) public void setMonitoringEnabled(boolean enabled) Gets the state if blukii monitoring is enabled. If enabled, data like Battery State of the blukii device is transferred to blukii Cloud.- Parameters:
enabled-trueif blukii devices should be monitored, otherwisefalse
-
setScanFilters
Sets a list of Bluetooth LE ScanFilters
You can use a default filter list from
DiscoverySettings.ScanFilters- Parameters:
filters- List of Bluetooth LE ScanFilters
-
describeContents
public int describeContents()- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel parcel, int i) - Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-