Package com.codename1.bluetooth.le.server
package com.codename1.bluetooth.le.server
BLE peripheral role: the local GATT server (GattServer,
GattLocalService, GattLocalCharacteristic, request envelopes) and
advertising (AdvertiseSettings, AdvertiseData,
BleAdvertisement).
Obtain via Bluetooth.getInstance().getLE().openGattServer(...) and
startAdvertising(...); branch on
Bluetooth.getInstance().isPeripheralModeSupported() first.
Referencing this package is what triggers the automatic injection of
advertise permissions (Android BLUETOOTH_ADVERTISE) at build time --
central-only apps that never touch it are not burdened with them.
-
ClassDescriptionThe payload to advertise via
BluetoothLE.startAdvertising.Advertising-interval trade-off, mirroring Android's advertise modes.Options forBluetoothLE.startAdvertising.Live handle of a running advertisement returned byBluetoothLE.startAdvertising.A remote central connected to the localGattServer-- the mirror image ofBlePeripheralwhen this device acts as the peripheral.A characteristic definition of a localGattLocalServiceserved by this device'sGattServer.A descriptor definition of a localGattLocalCharacteristicserved by this device'sGattServer.A service definition added to this device'sGattServerviaGattServer.addService(GattLocalService).A read request from a connected central, delivered toGattServerListener.characteristicReadRequest(GattReadRequest)orGattServerListener.descriptorReadRequest(GattReadRequest).The local GATT server, opened viaBluetoothLE.openGattServerwhen this device acts as a BLE peripheral.ConvenienceGattServerListenerwith empty implementations -- extend it and override only the events you handle.Receives the events of a localGattServer: requests from centrals, subscription changes and central connections.A write request from a connected central, delivered toGattServerListener.characteristicWriteRequest(GattWriteRequest)orGattServerListener.descriptorWriteRequest(GattWriteRequest).Transmit power for advertising, trading range against battery.