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.
Types
class AdvertiseData | The payload to advertise via BluetoothLE.startAdvertising. |
enum AdvertiseMode | Advertising-interval trade-off, mirroring Android’s advertise modes. |
class AdvertiseSettings | Options for BluetoothLE.startAdvertising. |
class BleAdvertisement | Live handle of a running advertisement returned by BluetoothLE.startAdvertising. |
class BleCentral | A remote central connected to the local GattServer – the mirror image of BlePeripheral when this device acts as the peripheral. |
class GattLocalCharacteristic | A characteristic definition of a local GattLocalService served by this device’s GattServer. |
class GattLocalDescriptor | A descriptor definition of a local GattLocalCharacteristic served by this device’s GattServer. |
class GattLocalService | A service definition added to this device’s GattServer via GattServer.addService(GattLocalService). |
class GattReadRequest | A read request from a connected central, delivered to GattServerListener.characteristicReadRequest(GattReadRequest) or GattServerListener.descriptorReadRequest(GattReadRequest). |
class GattServer | The local GATT server, opened via BluetoothLE.openGattServer when this device acts as a BLE peripheral. |
class GattServerAdapter | Convenience GattServerListener with empty implementations – extend it and override only the events you handle. |
interface GattServerListener | Receives the events of a local GattServer: requests from centrals, subscription changes and central connections. |
class GattWriteRequest | A write request from a connected central, delivered to GattServerListener.characteristicWriteRequest(GattWriteRequest) or GattServerListener.descriptorWriteRequest(GattWriteRequest). |
enum TxPowerLevel | Transmit power for advertising, trading range against battery. |