# Class GattServerAdapter

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

All Implemented Interfaces:
  `GattServerListener`

public class GattServerAdapter extends Object implements GattServerListener
Convenience `GattServerListener` with empty implementations -- extend it and override only the events you handle. Unanswered read/write requests are rejected with `GattStatus.REQUEST_NOT_SUPPORTED` so centrals fail fast instead of timing out.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GattServerAdapter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `centralConnected(BleCentral central)`
  A central connected to the local server.
  `void`
  `centralDisconnected(BleCentral central)`
  A central disconnected from the local server.
  `void`
  `characteristicReadRequest(GattReadRequest request)`
  A central reads a characteristic without a static value; answer via [GattReadRequest#respond(byte[])] or `GattReadRequest.reject(GattStatus)`.
  `void`
  `characteristicWriteRequest(GattWriteRequest request)`
  A central writes a characteristic; acknowledge via `GattWriteRequest.respond()` when required.
  `void`
  `descriptorReadRequest(GattReadRequest request)`
  A central reads a descriptor without a static value.
  `void`
  `descriptorWriteRequest(GattWriteRequest request)`
  A central writes a descriptor.
  `void`
  `subscriptionChanged(BleCentral central, GattLocalCharacteristic characteristic, boolean subscribed)`
  A central subscribed to or unsubscribed from a characteristic's notifications.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### GattServerAdapter

    public GattServerAdapter()

- ## Method Details

  - ### characteristicReadRequest

    public void characteristicReadRequest(GattReadRequest request)
    Description copied from interface: `GattServerListener`
    A central reads a characteristic without a static value; answer via [GattReadRequest#respond(byte[])] or `GattReadRequest.reject(GattStatus)`.
    Specified by:
      `characteristicReadRequest` in interface `GattServerListener`

  - ### characteristicWriteRequest

    public void characteristicWriteRequest(GattWriteRequest request)
    Description copied from interface: `GattServerListener`
    A central writes a characteristic; acknowledge via `GattWriteRequest.respond()` when required.
    Specified by:
      `characteristicWriteRequest` in interface `GattServerListener`

  - ### descriptorReadRequest

    public void descriptorReadRequest(GattReadRequest request)
    Description copied from interface: `GattServerListener`
    A central reads a descriptor without a static value. Platform note: iOS serves descriptors from their static values only, so this never fires there -- always give local descriptors a static value for cross-platform behavior.
    Specified by:
      `descriptorReadRequest` in interface `GattServerListener`

  - ### descriptorWriteRequest

    public void descriptorWriteRequest(GattWriteRequest request)
    Description copied from interface: `GattServerListener`
    A central writes a descriptor. Never fires on iOS -- see `GattServerListener.descriptorReadRequest(GattReadRequest)`.
    Specified by:
      `descriptorWriteRequest` in interface `GattServerListener`

  - ### subscriptionChanged

    public void subscriptionChanged(BleCentral central, GattLocalCharacteristic characteristic, boolean subscribed)
    Description copied from interface: `GattServerListener`
    A central subscribed to or unsubscribed from a characteristic's notifications.
    Specified by:
      `subscriptionChanged` in interface `GattServerListener`

  - ### centralConnected

    public void centralConnected(BleCentral central)
    Description copied from interface: `GattServerListener`
    A central connected to the local server.
    Specified by:
      `centralConnected` in interface `GattServerListener`

  - ### centralDisconnected

    public void centralDisconnected(BleCentral central)
    Description copied from interface: `GattServerListener`
    A central disconnected from the local server.
    Specified by:
      `centralDisconnected` in interface `GattServerListener`