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 TypeMethodDescriptionvoidcentralConnected(BleCentral central) A central connected to the local server.voidcentralDisconnected(BleCentral central) A central disconnected from the local server.voidcharacteristicReadRequest(GattReadRequest request) A central reads a characteristic without a static value; answer via [GattReadRequest#respond(byte[])] orGattReadRequest.reject(GattStatus).voidA central writes a characteristic; acknowledge viaGattWriteRequest.respond()when required.voiddescriptorReadRequest(GattReadRequest request) A central reads a descriptor without a static value.voiddescriptorWriteRequest(GattWriteRequest request) A central writes a descriptor.voidsubscriptionChanged(BleCentral central, GattLocalCharacteristic characteristic, boolean subscribed) A central subscribed to or unsubscribed from a characteristic's notifications.
-
Method Details
-
characteristicReadRequest
A central reads a characteristic without a static value; answer via [GattReadRequest#respond(byte[])] orGattReadRequest.reject(GattStatus). -
characteristicWriteRequest
A central writes a characteristic; acknowledge viaGattWriteRequest.respond()when required. -
descriptorReadRequest
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
A central writes a descriptor. Never fires on iOS -- seedescriptorReadRequest(GattReadRequest). -
subscriptionChanged
void subscriptionChanged(BleCentral central, GattLocalCharacteristic characteristic, boolean subscribed) A central subscribed to or unsubscribed from a characteristic's notifications. -
centralConnected
A central connected to the local server. -
centralDisconnected
A central disconnected from the local server.
-