Class GattReadRequest
java.lang.Object
com.codename1.bluetooth.le.server.GattReadRequest
A read request from a connected central, delivered to
GattServerListener.characteristicReadRequest(GattReadRequest) or
GattServerListener.descriptorReadRequest(GattReadRequest). Answer
promptly with [#respond(byte[])] or reject(GattStatus) -- centrals
time out unanswered requests.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGattReadRequest(BleCentral central, GattLocalCharacteristic characteristic, GattLocalDescriptor descriptor, int offset) Constructed by ports; not application API. -
Method Summary
Modifier and TypeMethodDescriptionThe central issuing the request.The requested characteristic, ornullfor a descriptor read.The requested descriptor, ornullfor a characteristic read.intThe read offset for long reads;0for plain reads.abstract voidreject(GattStatus status) Rejects the request with the given ATT status.abstract voidrespond(byte[] value) Sends the value to the central.
-
Constructor Details
-
GattReadRequest
protected GattReadRequest(BleCentral central, GattLocalCharacteristic characteristic, GattLocalDescriptor descriptor, int offset) Constructed by ports; not application API.
-
-
Method Details
-
getCentral
The central issuing the request. -
getCharacteristic
The requested characteristic, ornullfor a descriptor read. -
getDescriptor
The requested descriptor, ornullfor a characteristic read. -
getOffset
public int getOffset()The read offset for long reads;0for plain reads. -
respond
public abstract void respond(byte[] value) Sends the value to the central. May be called from any thread; call exactly once per request. -
reject
Rejects the request with the given ATT status.
-