public static class BleDevice.BondListener.BondEvent extends Event implements UsesCustomNull
BleDevice.BondListener.onEvent(BondEvent)
to provide more information about a BleDevice.bond()
attempt.Modifier and Type | Method and Description |
---|---|
BleDevice |
device()
The
BleDevice that attempted to BleDevice.bond() . |
int |
failReason()
If
status() is BleDevice.BondListener.Status.FAILED_EVENTUALLY , this integer will
be one of the values enumerated in BluetoothDevice that start with UNBOND_REASON such as
BleStatuses.UNBOND_REASON_AUTH_FAILED . |
State.ChangeIntent |
intent()
Tells whether the bond was created through an explicit call through SweetBlue, or otherwise.
|
boolean |
isNull()
Returns
true if the object's state represents what would otherwise be Java's built-in null . |
String |
macAddress()
Convience to return the mac address of
device() . |
BleDevice.BondListener.Status |
status()
The
BleDevice.ConnectionFailListener.Status associated with this event. |
String |
toString() |
boolean |
wasCancelled()
|
boolean |
wasSuccess()
Shortcut for checking if
status() == BleDevice.BondListener.Status.SUCCESS . |
public BleDevice device()
BleDevice
that attempted to BleDevice.bond()
.public BleDevice.BondListener.Status status()
BleDevice.ConnectionFailListener.Status
associated with this event.public int failReason()
status()
is BleDevice.BondListener.Status.FAILED_EVENTUALLY
, this integer will
be one of the values enumerated in BluetoothDevice
that start with UNBOND_REASON
such as
BleStatuses.UNBOND_REASON_AUTH_FAILED
. Otherwise it will be equal to BleStatuses.BOND_FAIL_REASON_NOT_APPLICABLE
.
See also a publically accessible list in BleStatuses
.public State.ChangeIntent intent()
State.ChangeIntent.INTENTIONAL
, then BleDevice.bond()
(or overloads) were called. If State.ChangeIntent.UNINTENTIONAL
,
then the bond was created "spontaneously" as far as SweetBlue is concerned, whether through another app, the OS Bluetooth
settings, or maybe from a request by the remote BLE device itself.public boolean wasSuccess()
status()
== BleDevice.BondListener.Status.SUCCESS
.public boolean wasCancelled()
public boolean isNull()
UsesCustomNull
true
if the object's state represents what would otherwise be Java's built-in null
.isNull
in interface UsesCustomNull