public static final class BondRetryFilter.RetryEvent extends Event
Modifier and Type | Method and Description |
---|---|
BleDevice |
device()
Returns the
BleDevice that failed to bond. |
int |
failCode()
Returns the failure code the native stack returned as the reason that bonding failed.
|
boolean |
isDirect()
Returns whether this bond attempt was from a direct bond call, from calling
BleDevice.bond(BondListener) , or
BleDevice.bond() . |
boolean |
possibleRetry()
This is a best guess on our part.
|
int |
retryAttempts()
Returns how many times SweetBlue has retried bonding on the
device() . |
BondRetryFilter.Status |
status()
Returns the
BondRetryFilter.Status of the bond attempt. |
boolean |
wasUserPrompted()
Returns whether this bond request attempt prompted the user or not.
|
public final BondRetryFilter.Status status()
BondRetryFilter.Status
of the bond attempt. While BondRetryFilter.Status.SUCCESS
exists, if the BondRetryFilter
is invoked, it is implied that
the attempt was not successful. This is just an enum containing the bond failure codes contained in BleStatuses
to make the errors more
readable.public final int failCode()
public final int retryAttempts()
device()
.public final boolean isDirect()
BleDevice.bond(BondListener)
, or
BleDevice.bond()
.public final boolean wasUserPrompted()
BleDeviceConfig.forceBondDialog
, then there's a very high chance that the dialog was shown.public final boolean possibleRetry()
true
if wasUserPrompted()
returns false
, or the BondRetryFilter.Status
does not equal BondRetryFilter.Status.AUTH_FAILED
, BondRetryFilter.Status.AUTH_REJECTED
, BondRetryFilter.Status.REPEATED_ATTEMPTS
, or BondRetryFilter.Status.SUCCESS
(which should never
happen here, but it's left just in case).