public static enum OutgoingListener.Status extends java.lang.Enum<OutgoingListener.Status> implements UsesCustomNull
Enum Constant and Description |
---|
CANCELLED_FROM_BLE_TURNING_OFF
The operation was cancelled because
BleManager went BleManagerState.TURNING_OFF and/or
BleManagerState.OFF . |
CANCELLED_FROM_DISCONNECT
The operation was cancelled by the client/server becoming
BleServerState.DISCONNECTED . |
FAILED_TO_SEND_OUT
The underlying call to
BluetoothGattServer.sendResponse(BluetoothDevice, int, int, int, byte[])
or BluetoothGattServer.notifyCharacteristicChanged(BluetoothDevice, BluetoothGattCharacteristic, boolean)
failed for reasons unknown. |
FAILED_TO_SET_VALUE_ON_TARGET
For now only relevant if
ExchangeListener.ExchangeEvent.type() is ExchangeListener.Type.NOTIFICATION -
BluetoothGattCharacteristic.setValue(byte[]) (or one of its overloads) returned false . |
NO_MATCHING_TARGET
Couldn't find a matching
ExchangeListener.ExchangeEvent.target() for ExchangeListener.ExchangeEvent.charUuid() . |
NO_REQUEST_LISTENER_SET
The server does not have a
IncomingListener set so no valid response
could be sent. |
NO_RESPONSE_ATTEMPTED
IncomingListener.Please.doNotRespond(OutgoingListener) (or overloads)
were called or ExchangeListener.ExchangeEvent.responseNeeded() was false . |
NOT_CONNECTED
Could not communicate with the client device because the server is not currently
BleServerState.CONNECTED . |
NULL
Fulfills the soft contract of
UsesCustomNull . |
NULL_SERVER
BleServer.sendNotification(String, UUID, UUID, FutureData, OutgoingListener) or
BleServer.sendIndication(String, UUID, byte[]) (or various overloads) was called
on BleServer.NULL . |
REMOTE_GATT_FAILURE
The operation failed in a "normal" fashion, at least relative to all the other strange ways an operation can fail.
|
SUCCESS
The outgoing message to the client was successfully sent.
|
TIMED_OUT
Couldn't send out the data because the operation took longer than the time dictated by
BleNodeConfig.taskTimeoutRequestFilter
so we had to cut her loose. |
Modifier and Type | Method and Description |
---|---|
boolean |
isNull()
Returns true if
this== NULL . |
static OutgoingListener.Status |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static OutgoingListener.Status[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final OutgoingListener.Status NULL
UsesCustomNull
.public static final OutgoingListener.Status SUCCESS
public static final OutgoingListener.Status NULL_SERVER
BleServer.sendNotification(String, UUID, UUID, FutureData, OutgoingListener)
or
BleServer.sendIndication(String, UUID, byte[])
(or various overloads) was called
on BleServer.NULL
.public static final OutgoingListener.Status NO_RESPONSE_ATTEMPTED
IncomingListener.Please.doNotRespond(OutgoingListener)
(or overloads)
were called or ExchangeListener.ExchangeEvent.responseNeeded()
was false
.public static final OutgoingListener.Status NO_REQUEST_LISTENER_SET
IncomingListener
set so no valid response
could be sent. Please set a listener through BleServer.setListener_Incoming(IncomingListener)
.public static final OutgoingListener.Status NO_MATCHING_TARGET
ExchangeListener.ExchangeEvent.target()
for ExchangeListener.ExchangeEvent.charUuid()
.public static final OutgoingListener.Status FAILED_TO_SET_VALUE_ON_TARGET
ExchangeListener.ExchangeEvent.type()
is ExchangeListener.Type.NOTIFICATION
-
BluetoothGattCharacteristic.setValue(byte[])
(or one of its overloads) returned false
.public static final OutgoingListener.Status FAILED_TO_SEND_OUT
BluetoothGattServer.sendResponse(BluetoothDevice, int, int, int, byte[])
or BluetoothGattServer.notifyCharacteristicChanged(BluetoothDevice, BluetoothGattCharacteristic, boolean)
failed for reasons unknown.public static final OutgoingListener.Status REMOTE_GATT_FAILURE
BluetoothGattServer.notifyCharacteristicChanged(BluetoothDevice, BluetoothGattCharacteristic, boolean)
returned a status code through BluetoothGattServerCallback.onNotificationSent(BluetoothDevice, int)
that was not zero.
This could mean the device went out of range, was turned off, signal was disrupted, whatever. Often this means that the
client is about to become BleServerState.DISCONNECTED
.public static final OutgoingListener.Status CANCELLED_FROM_DISCONNECT
BleServerState.DISCONNECTED
.public static final OutgoingListener.Status CANCELLED_FROM_BLE_TURNING_OFF
BleManager
went BleManagerState.TURNING_OFF
and/or
BleManagerState.OFF
. Note that if the user turns off BLE from their OS settings (airplane mode, etc.) then
OutgoingListener.OutgoingEvent.status()
could potentially be CANCELLED_FROM_DISCONNECT
because SweetBlue might get
the disconnect callback before the turning off callback. Basic testing has revealed that this is *not* the case, but you never know.
public static final OutgoingListener.Status TIMED_OUT
BleNodeConfig.taskTimeoutRequestFilter
so we had to cut her loose.public static final OutgoingListener.Status NOT_CONNECTED
BleServerState.CONNECTED
.public static OutgoingListener.Status[] values()
for (OutgoingListener.Status c : OutgoingListener.Status.values()) System.out.println(c);
public static OutgoingListener.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 isNull()
this==
NULL
.isNull
in interface UsesCustomNull