public static enum AddServiceListener.Status extends java.lang.Enum<AddServiceListener.Status> implements UsesCustomNull
OutgoingListener.OutgoingEvent.status()
.Enum Constant and Description |
---|
BLE_NOT_ON
BleManager is not BleManagerState.ON so we can't add a service. |
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 because
BleServer.disconnect() was called before the operation completed. |
CANCELLED_FROM_REMOVAL
BleServer.removeService(UUID) or BleServer.removeAllServices() was called before the service could be fully added. |
DUPLICATE_SERVICE
Tried to add the same service reference twice.
|
FAILED_EVENTUALLY
BluetoothGattServerCallback.onServiceAdded(int, BluetoothGattService) reported a bad gatt status
for the service addition, which is provided through OutgoingListener.OutgoingEvent.gattStatus_received() . |
FAILED_IMMEDIATELY
The call to
BluetoothGattServer.addService(BluetoothGattService) returned false . |
NULL
Fulfills the soft contract of
UsesCustomNull . |
NULL_SERVER
Tried to add a service to
BleServer.NULL . |
SERVER_OPENING_FAILED
Adding this service required that a native
BluetoothGattServer to be created,
but it could not be created for some reason. |
SUCCESS
Service was added successfully.
|
TIMED_OUT
Couldn't add the service because the operation took longer than the time dictated by
BleNodeConfig.taskTimeoutRequestFilter . |
Modifier and Type | Method and Description |
---|---|
boolean |
isNull()
Returns
true if the object's state represents what would otherwise be Java's built-in null . |
static AddServiceListener.Status |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static AddServiceListener.Status[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
boolean |
wasSuccess()
Returns true if
this equals SUCCESS . |
public static final AddServiceListener.Status NULL
UsesCustomNull
.public static final AddServiceListener.Status SUCCESS
public static final AddServiceListener.Status NULL_SERVER
BleServer.NULL
.public static final AddServiceListener.Status DUPLICATE_SERVICE
public static final AddServiceListener.Status SERVER_OPENING_FAILED
BluetoothGattServer
to be created,
but it could not be created for some reason.public static final AddServiceListener.Status FAILED_IMMEDIATELY
BluetoothGattServer.addService(BluetoothGattService)
returned false
.public static final AddServiceListener.Status FAILED_EVENTUALLY
BluetoothGattServerCallback.onServiceAdded(int, BluetoothGattService)
reported a bad gatt status
for the service addition, which is provided through OutgoingListener.OutgoingEvent.gattStatus_received()
.public static final AddServiceListener.Status TIMED_OUT
BleNodeConfig.taskTimeoutRequestFilter
.public static final AddServiceListener.Status CANCELLED_FROM_REMOVAL
BleServer.removeService(UUID)
or BleServer.removeAllServices()
was called before the service could be fully added.public static final AddServiceListener.Status CANCELLED_FROM_DISCONNECT
BleServer.disconnect()
was called before the operation completed.public static final AddServiceListener.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
AddServiceListener.ServiceAddEvent.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 AddServiceListener.Status BLE_NOT_ON
BleManager
is not BleManagerState.ON
so we can't add a service.public static AddServiceListener.Status[] values()
for (AddServiceListener.Status c : AddServiceListener.Status.values()) System.out.println(c);
public static AddServiceListener.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 wasSuccess()
this
equals SUCCESS
.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