# Interface GattServerListener

All Known Implementing Classes:
  `GattServerAdapter`

public interface GattServerListener
Receives the events of a local `GattServer`: requests from centrals, subscription changes and central connections. All methods are invoked on the EDT. Extend `GattServerAdapter` to override only the events you care about.

- ## 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.

- ## Method Details

  - ### characteristicReadRequest

    void characteristicReadRequest(GattReadRequest request)
    A central reads a characteristic without a static value; answer via [GattReadRequest#respond(byte[])] or `GattReadRequest.reject(GattStatus)`.

  - ### characteristicWriteRequest

    void characteristicWriteRequest(GattWriteRequest request)
    A central writes a characteristic; acknowledge via `GattWriteRequest.respond()` when required.

  - ### descriptorReadRequest

    void descriptorReadRequest(GattReadRequest request)
    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.

  - ### descriptorWriteRequest

    void descriptorWriteRequest(GattWriteRequest request)
    A central writes a descriptor. Never fires on iOS -- see `descriptorReadRequest(GattReadRequest)`.

  - ### subscriptionChanged

    void subscriptionChanged(BleCentral central, GattLocalCharacteristic characteristic, boolean subscribed)
    A central subscribed to or unsubscribed from a characteristic's notifications.

  - ### centralConnected

    void centralConnected(BleCentral central)
    A central connected to the local server.

  - ### centralDisconnected

    void centralDisconnected(BleCentral central)
    A central disconnected from the local server.