public static enum ServerReconnectFilter.Status extends java.lang.Enum<ServerReconnectFilter.Status> implements UsesCustomNull
Enum Constant and Description |
---|
ALREADY_CONNECTING_OR_CONNECTED
A call was made to
BleServer.connect(String) or its overloads
but ServerReconnectFilter.ConnectFailEvent.server() is already
BleServerState.CONNECTING or BleServerState.CONNECTED for the given client. |
CANCELLED_FROM_BLE_TURNING_OFF
BleManager.reset() or BleManager.turnOff() (or
overloads) were called sometime during the connection process. |
CANCELLED_FROM_DISCONNECT
BleServer.disconnect() or overloads was called sometime during the connection process. |
NATIVE_CONNECTION_FAILED_EVENTUALLY
Couldn't connect through
BluetoothGattServer.connect(BluetoothDevice, boolean)
because we eventually got a bad status code through BluetoothGattServerCallback.onConnectionStateChange(BluetoothDevice, int, int) . |
NATIVE_CONNECTION_FAILED_IMMEDIATELY
Couldn't connect through
BluetoothGattServer.connect(BluetoothDevice, boolean)
because it returned false . |
NULL
Used in place of Java's built-in
null wherever needed. |
NULL_SERVER
BleServer.connect(String) (or various overloads) was called on BleServer.NULL . |
SERVER_OPENING_FAILED
The call to
BluetoothManager.openGattServer(Context, BluetoothGattServerCallback) returned
a null object instance, so we could not proceed. |
TIMED_OUT
Couldn't connect through
BluetoothGattServer.connect(BluetoothDevice, boolean)
because the operation took longer than the time dictated by BleNodeConfig.taskTimeoutRequestFilter . |
Modifier and Type | Method and Description |
---|---|
boolean |
allowsRetry()
Whether this reason honors a
ReconnectFilter.ConnectFailPlease.isRetry() . |
boolean |
isNull()
Returns
true if the object's state represents what would otherwise be Java's built-in null . |
boolean |
shouldBeReportedToUser()
Convenience method that returns whether this status is something that your app user would usually care about.
|
static ServerReconnectFilter.Status |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ServerReconnectFilter.Status[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
boolean |
wasCancelled()
Returns true for
CANCELLED_FROM_DISCONNECT or CANCELLED_FROM_BLE_TURNING_OFF . |
public static final ServerReconnectFilter.Status NULL
null
wherever needed. As of now, the ServerReconnectFilter.ConnectFailEvent.status()
given
to ReconnectFilter.onConnectFailed(ReconnectFilter.ConnectFailEvent)
will *never* be NULL
.public static final ServerReconnectFilter.Status ALREADY_CONNECTING_OR_CONNECTED
BleServer.connect(String)
or its overloads
but ServerReconnectFilter.ConnectFailEvent.server()
is already
BleServerState.CONNECTING
or BleServerState.CONNECTED
for the given client.public static final ServerReconnectFilter.Status NULL_SERVER
BleServer.connect(String)
(or various overloads) was called on BleServer.NULL
.public static final ServerReconnectFilter.Status SERVER_OPENING_FAILED
BluetoothManager.openGattServer(Context, BluetoothGattServerCallback)
returned
a null
object instance, so we could not proceed.public static final ServerReconnectFilter.Status NATIVE_CONNECTION_FAILED_IMMEDIATELY
BluetoothGattServer.connect(BluetoothDevice, boolean)
because it returned false
.public static final ServerReconnectFilter.Status NATIVE_CONNECTION_FAILED_EVENTUALLY
BluetoothGattServer.connect(BluetoothDevice, boolean)
because we eventually got a bad status code through BluetoothGattServerCallback.onConnectionStateChange(BluetoothDevice, int, int)
.public static final ServerReconnectFilter.Status TIMED_OUT
BluetoothGattServer.connect(BluetoothDevice, boolean)
because the operation took longer than the time dictated by BleNodeConfig.taskTimeoutRequestFilter
.public static final ServerReconnectFilter.Status CANCELLED_FROM_DISCONNECT
BleServer.disconnect()
or overloads was called sometime during the connection process.public static final ServerReconnectFilter.Status CANCELLED_FROM_BLE_TURNING_OFF
BleManager.reset()
or BleManager.turnOff()
(or
overloads) were called sometime during the connection process.
Basic testing reveals that this value will also be used when a
user turns off BLE by going through their OS settings, airplane
mode, etc., but it's not absolutely *certain* that this behavior
is consistent across phones. For example there might be a phone
that kills all connections *before* going through the ble turn-off
process, thus NATIVE_CONNECTION_FAILED_EVENTUALLY
would probably be seen.public static ServerReconnectFilter.Status[] values()
for (ServerReconnectFilter.Status c : ServerReconnectFilter.Status.values()) System.out.println(c);
public static ServerReconnectFilter.Status 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 final boolean wasCancelled()
CANCELLED_FROM_DISCONNECT
or CANCELLED_FROM_BLE_TURNING_OFF
.public final boolean allowsRetry()
ReconnectFilter.ConnectFailPlease.isRetry()
. Returns false
if wasCancelled()
or
this
is ALREADY_CONNECTING_OR_CONNECTED
.public final boolean isNull()
UsesCustomNull
true
if the object's state represents what would otherwise be Java's built-in null
.isNull
in interface UsesCustomNull
public final boolean shouldBeReportedToUser()
true
then perhaps you should pop up a Toast
or something of that nature.