Package fi.bitwards.service
Class BitwardsService.BluetoothProximityAccess
java.lang.Object
fi.bitwards.service.BitwardsService.BluetoothProximityAccess
- All Implemented Interfaces:
BitwardsService.BLEResourceCallback,BitwardsService.NFCResourceCallback
- Enclosing class:
BitwardsService
public abstract static class BitwardsService.BluetoothProximityAccess
extends Object
implements BitwardsService.BLEResourceCallback
BluetoothProximityAccess class is used to handle Bluetooth proximity access functionality.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongThis method returns a delay between subsequent opening attempts, i.e., how long the implementation waits before attempting to access a resource again.longThis method returns a delay applied right after a successful opening/identification, i.e., how long the app waits after a successful opening/indentification before starting the next attempt.intThis method returns the RSSI threshold which must be exceeded to trigger the proximity access.intThe background scan mode for discovering resources.intabstract booleanonAccessingResource(BitwardsResource resource) This method is called when proximity opening for a resource has been triggered.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface fi.bitwards.service.BitwardsService.BLEResourceCallback
onResourceNotFound, onSelectResourceMethods inherited from interface fi.bitwards.service.BitwardsService.NFCResourceCallback
onAccessDenied, onAccessGranted, onError
-
Field Details
-
mNextAttemptTime
public long mNextAttemptTime
-
-
Constructor Details
-
BluetoothProximityAccess
public BluetoothProximityAccess()
-
-
Method Details
-
getRssiThreshold
public int getRssiThreshold()This method returns the RSSI threshold which must be exceeded to trigger the proximity access.- Returns:
- the RSSI value threshold for triggering ; original value was -42.
-
getThresholdLifetime
public int getThresholdLifetime() -
getAccessDelay
public long getAccessDelay()This method returns a delay between subsequent opening attempts, i.e., how long the implementation waits before attempting to access a resource again. Note that the delay starts from the start of attempted opening.- Returns:
- the delay between two proximity access events in milliseconds; default is 7000ms.
-
getDelayAfterAccess
public long getDelayAfterAccess()This method returns a delay applied right after a successful opening/identification, i.e., how long the app waits after a successful opening/indentification before starting the next attempt.- Returns:
- the delay after a successful proximity opening/indentification is in milliseconds; default is 10000ms.
-
getScanMode
public int getScanMode()The background scan mode for discovering resources.- Returns:
- the background scan mode; default is
BitwardsService.RESOURCE_SCAN_MODE_FULL.
-
onAccessingResource
This method is called when proximity opening for a resource has been triggered.- Parameters:
resource- the resource for which the proximity opening has been triggered.- Returns:
- true if opening the resource should proceed, false if opening should be cancelled
-