public static class DeviceStateListener.StateEvent extends State.ChangeEvent<BleDeviceState>
Modifier and Type | Method and Description |
---|---|
BleDevice |
device()
The device undergoing the state change.
|
int |
gattStatus()
The change in gattStatus that may have precipitated the state change, or
BleStatuses.GATT_STATUS_NOT_APPLICABLE . |
boolean |
isSimple()
Returns
true if any of the simple states have changed. |
java.lang.String |
macAddress()
Convience to return the mac address of
device() . |
java.lang.String |
toString() |
didEnter, didEnterAll, didEnterAny, didExit, didExitAll, didExitAny, enterMask, exitMask, getIntent, intentMask, isFor, isForAll, isForAny, newStateBits, oldStateBits
public final BleDevice device()
public final java.lang.String macAddress()
device()
.public final int gattStatus()
BleStatuses.GATT_STATUS_NOT_APPLICABLE
.
For example if State.ChangeEvent.didEnter(State)
with BleDeviceState.BLE_DISCONNECTED
is true
and
State.ChangeEvent.didExit(State)
with BleDeviceState.BLE_CONNECTING
is also true
then gattStatus()
may be greater
than zero and give some further hint as to why the connection failed.
ReconnectFilter.ConnectFailEvent.gattStatus()
for more information.public final boolean isSimple()
true
if any of the simple states have changed. The simple states are really the only ones most apps should care about. So, on state changes, you
can just call this method to see if you should do anything or not (barring special circumstances).public final java.lang.String toString()
toString
in class java.lang.Object