public static class OutgoingListener.OutgoingEvent extends ExchangeListener.ExchangeEvent implements UsesCustomNull
OutgoingListener.onEvent(OutgoingEvent)
that provides details of what was sent to the client and if it succeeded.NON_APPLICABLE_REQUEST_ID, NON_APPLICABLE_UUID
Modifier and Type | Method and Description |
---|---|
byte[] |
data_sent()
The data that was attempted to be sent back to the client if
ExchangeListener.ExchangeEvent.type() ExchangeListener.Type.isRead() is true . |
int |
gattStatus_received()
The gattStatus received from an attempted communication with the client.
|
int |
gattStatus_sent()
The gattStatus sent to the client, provided to static methods of
IncomingListener.Please
if ExchangeListener.ExchangeEvent.type() is ExchangeListener.Type.READ or ExchangeListener.Type.WRITE - otherwise this will equal BleStatuses.GATT_STATUS_NOT_APPLICABLE . |
boolean |
isNull()
Will return true in certain early-out cases when there is no issue and the response can continue.
|
boolean |
solicited()
This returns
true if this event was the result of an explicit call through SweetBlue, e.g. |
OutgoingListener.Status |
status()
Returns the result of the response, or
OutgoingListener.Status.NO_RESPONSE_ATTEMPTED if
for example IncomingListener.Please.doNotRespond(OutgoingListener) was used. |
java.lang.String |
toString() |
boolean |
wasSuccess()
Checks if
status() is OutgoingListener.Status.SUCCESS . |
charUuid, data_received, descUuid, isFor, isFor, macAddress, nativeDevice, offset, requestId, responseNeeded, server, serviceUuid, target, type
public final OutgoingListener.Status status()
OutgoingListener.Status.NO_RESPONSE_ATTEMPTED
if
for example IncomingListener.Please.doNotRespond(OutgoingListener)
was used.public final byte[] data_sent()
ExchangeListener.ExchangeEvent.type()
ExchangeListener.Type.isRead()
is true
.public final int gattStatus_sent()
IncomingListener.Please
if ExchangeListener.ExchangeEvent.type()
is ExchangeListener.Type.READ
or ExchangeListener.Type.WRITE
- otherwise this will equal BleStatuses.GATT_STATUS_NOT_APPLICABLE
.public final int gattStatus_received()
ExchangeListener.ExchangeEvent.type()
ExchangeListener.Type.isNotificationOrIndication()
is true
- otherwise this will equal BleStatuses.GATT_STATUS_NOT_APPLICABLE
.public final boolean solicited()
true
if this event was the result of an explicit call through SweetBlue, e.g. through
BleServer.sendNotification(String, UUID, UUID, FutureData, OutgoingListener)
. 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 OutgoingListener.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()
status()
is OutgoingListener.Status.SUCCESS
.public final boolean isNull()
BleServer.sendNotification(String, UUID, UUID, byte[], OutgoingListener)
for more information.isNull
in interface UsesCustomNull
public final java.lang.String toString()
toString
in class java.lang.Object