public static class AddServiceListener.ServiceAddEvent extends Event
AddServiceListener.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 AddServiceListener.Status.FAILED_EVENTUALLY . |
BleServer |
server()
The server to which the service is being added.
|
android.bluetooth.BluetoothGattService |
service()
The service being added to
server() . |
java.util.UUID |
serviceUuid()
Convenience to return the
UUID of service() . |
boolean |
solicited()
This returns
true if this event was the result of an explicit call through SweetBlue, e.g. |
AddServiceListener.Status |
status()
Indicates the success or reason for failure for adding the service.
|
java.lang.String |
toString() |
boolean |
wasSuccess()
Convenience forwarding of
AddServiceListener.Status.wasSuccess() . |
public final BleServer server()
public final android.bluetooth.BluetoothGattService service()
server()
.public final java.util.UUID serviceUuid()
UUID
of service()
.public final int gattStatus()
status()
is AddServiceListener.Status.FAILED_EVENTUALLY
.public final AddServiceListener.Status status()
public final boolean solicited()
true
if this event was the result of an explicit call through SweetBlue, e.g. through
BleServer.addService(BleService, AddServiceListener)
. It will return false
otherwise,
which can happen if for example you use BleServer.getNativeLayer()
to bypass SweetBlue for whatever reason.
Another theoretical case is if you make an explicit call through SweetBlue, then you get AddServiceListener.Status.TIMED_OUT
,
but then the native stack eventually *does* come back with something - this has never been observed, but it is possible.public final boolean wasSuccess()
AddServiceListener.Status.wasSuccess()
.public final java.lang.String toString()
toString
in class java.lang.Object