Class GattWriteRequest
java.lang.Object
com.codename1.bluetooth.le.server.GattWriteRequest
A write request from a connected central, delivered to
GattServerListener.characteristicWriteRequest(GattWriteRequest) or
GattServerListener.descriptorWriteRequest(GattWriteRequest). When
isResponseRequired() answer promptly with respond() or
reject(GattStatus).-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGattWriteRequest(BleCentral central, GattLocalCharacteristic characteristic, GattLocalDescriptor descriptor, byte[] value, int offset, boolean responseRequired) Constructed by ports; not application API. -
Method Summary
Modifier and TypeMethodDescriptionThe central issuing the request.The written characteristic, ornullfor a descriptor write.The written descriptor, ornullfor a characteristic write.intThe write offset for long writes;0for plain writes.byte[]getValue()The written bytes.booleantruewhen the central expects an acknowledgement (respond()orreject(GattStatus));falsefor write-without-response.abstract voidreject(GattStatus status) Rejects the write with the given ATT status.abstract voidrespond()Acknowledges the write.
-
Constructor Details
-
GattWriteRequest
protected GattWriteRequest(BleCentral central, GattLocalCharacteristic characteristic, GattLocalDescriptor descriptor, byte[] value, int offset, boolean responseRequired) Constructed by ports; not application API.
-
-
Method Details
-
getCentral
The central issuing the request. -
getCharacteristic
The written characteristic, ornullfor a descriptor write. -
getDescriptor
The written descriptor, ornullfor a characteristic write. -
getValue
public byte[] getValue()The written bytes. -
getOffset
public int getOffset()The write offset for long writes;0for plain writes. -
isResponseRequired
public boolean isResponseRequired()truewhen the central expects an acknowledgement (respond()orreject(GattStatus));falsefor write-without-response. -
respond
public abstract void respond()Acknowledges the write. May be called from any thread; call exactly once whenisResponseRequired(). -
reject
Rejects the write with the given ATT status.
-