Class GattReadRequest

java.lang.Object
com.codename1.bluetooth.le.server.GattReadRequest

public abstract class GattReadRequest extends Object
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 Details

  • Method Details

    • getCentral

      public BleCentral getCentral()
      The central issuing the request.
    • getCharacteristic

      public GattLocalCharacteristic getCharacteristic()
      The requested characteristic, or null for a descriptor read.
    • getDescriptor

      public GattLocalDescriptor getDescriptor()
      The requested descriptor, or null for a characteristic read.
    • getOffset

      public int getOffset()
      The read offset for long reads; 0 for 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

      public abstract void reject(GattStatus status)
      Rejects the request with the given ATT status.