public static class BleServer.ServiceAddListener.ServiceAddEvent extends Event
BleServer.ServiceAddListener.onEvent(ServiceAddEvent)
to give you information about the success
of a service addition or the reason(s) for its failure.Modifier and Type | Method and Description |
---|---|
int |
gattStatus()
Should only be relevant if
status() is BleServer.ServiceAddListener.Status.FAILED_EVENTUALLY . |
BleServer |
server()
The server to which the service is being added.
|
BluetoothGattService |
service()
The service being added to
server() . |
UUID |
serviceUuid()
|
boolean |
solicited()
This returns
true if this event was the result of an explicit call through SweetBlue, e.g. |
BleServer.ServiceAddListener.Status |
status()
Indicates the success or reason for failure for adding the service.
|
String |
toString() |
boolean |
wasSuccess()
Convenience forwarding of
BleServer.ServiceAddListener.Status.wasSuccess() . |
public BleServer server()
public BluetoothGattService service()
server()
.public UUID serviceUuid()
public int gattStatus()
status()
is BleServer.ServiceAddListener.Status.FAILED_EVENTUALLY
.public BleServer.ServiceAddListener.Status status()
public boolean solicited()
true
if this event was the result of an explicit call through SweetBlue, e.g. through
BleServer.addService(BleService, ServiceAddListener)
. It will return false
otherwise,
which can happen if for example you use BleServer.getNative()
to bypass SweetBlue for whatever reason.
Another theoretical case is if you make an explicit call through SweetBlue, then you get BleServer.ServiceAddListener.Status.TIMED_OUT
,
but then the native stack eventually *does* come back with something - this has never been observed, but it is possible.public boolean wasSuccess()
BleServer.ServiceAddListener.Status.wasSuccess()
.