public enum BleServerState extends java.lang.Enum<BleServerState> implements State
BleServer
can be in on a per-client (mac address) basis.
Note that unlike a BleDevice
, a BleServer
can only be in one state at a time for a given client
Use BleServer.setListener_State(ServerStateListener)
to be notified of state changes.ServerStateListener
State.ChangeEvent<T_State extends State>, State.ChangeIntent
Enum Constant and Description |
---|
CONNECTED
SweetBlue equivalent of
BluetoothProfile.STATE_CONNECTED . |
CONNECTING
SweetBlue equivalent of
BluetoothProfile.STATE_CONNECTING . |
DISCONNECTED
SweetBlue equivalent of
BluetoothProfile.STATE_DISCONNECTED . |
NULL
Dummy value returned from any method that would otherwise return Java's built-in
null . |
RETRYING_CONNECTION
This is a state which is a SweetBlue construct.
|
Modifier and Type | Field and Description |
---|---|
static int |
FULL_MASK
Full bitwise mask made by ORing all
BleServerState instances together. |
Modifier and Type | Method and Description |
---|---|
int |
bit() |
boolean |
didEnter(int oldStateBits,
int newStateBits)
Given an old and new state mask, for example from
DeviceStateListener.onEvent(com.idevicesinc.sweetblue.DeviceStateListener.StateEvent)
or ManagerStateListener.onEvent(com.idevicesinc.sweetblue.ManagerStateListener.StateEvent) , this method tells you whether the
the 'this' state was appended. |
boolean |
didExit(int oldStateBits,
int newStateBits)
Reverse of
State.didEnter(int, int) . |
boolean |
isNull()
Returns
true if this state is meant to stand in for Java's built-in null . |
int |
or(BitwiseEnum state) |
boolean |
overlaps(int mask) |
static int |
toBits(BleServerState... states) |
static BleServerState |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static BleServerState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BleServerState NULL
null
.
A normal BleDevice
will never be in this state, but this will be the sole state of BleServer.NULL
.public static final BleServerState DISCONNECTED
BluetoothProfile.STATE_DISCONNECTED
.public static final BleServerState CONNECTING
BluetoothProfile.STATE_CONNECTING
.public static final BleServerState CONNECTED
BluetoothProfile.STATE_CONNECTED
.public static final BleServerState RETRYING_CONNECTION
public static final int FULL_MASK
BleServerState
instances together.public static BleServerState[] values()
for (BleServerState c : BleServerState.values()) System.out.println(c);
public static BleServerState valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static int toBits(BleServerState... states)
public boolean overlaps(int mask)
public int bit()
public boolean didEnter(int oldStateBits, int newStateBits)
State
DeviceStateListener.onEvent(com.idevicesinc.sweetblue.DeviceStateListener.StateEvent)
or ManagerStateListener.onEvent(com.idevicesinc.sweetblue.ManagerStateListener.StateEvent)
, this method tells you whether the
the 'this' state was appended.didEnter
in interface State
State.didExit(int, int)
public boolean didExit(int oldStateBits, int newStateBits)
State
State.didEnter(int, int)
.didExit
in interface State
State.didEnter(int, int)
public int or(BitwiseEnum state)
public boolean isNull()
State
true
if this state is meant to stand in for Java's built-in null
.isNull
in interface State
isNull
in interface UsesCustomNull