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

- Related Packages
  Package
  Description
  com.codename1.bluetooth.le
  BLE central role: scanning (`BluetoothLE`, `ScanSettings`, `ScanFilter`, `ScanResult`, `BleScan`), connections and the GATT client (`BlePeripheral`, connection events) and L2CAP connection-oriented channels (`L2capChannel`, `L2capServer`).
- Class
  Description
  AdvertiseData
  The payload to advertise via `BluetoothLE.startAdvertising`.
  AdvertiseMode
  Advertising-interval trade-off, mirroring Android's advertise modes.
  AdvertiseSettings
  Options for `BluetoothLE.startAdvertising`.
  BleAdvertisement
  Live handle of a running advertisement returned by `BluetoothLE.startAdvertising`.
  BleCentral
  A remote central connected to the local `GattServer` -- the mirror image of `BlePeripheral` when this device acts as the peripheral.
  GattLocalCharacteristic
  A characteristic definition of a local `GattLocalService` served by this device's `GattServer`.
  GattLocalDescriptor
  A descriptor definition of a local `GattLocalCharacteristic` served by this device's `GattServer`.
  GattLocalService
  A service definition added to this device's `GattServer` via `GattServer.addService(GattLocalService)`.
  GattReadRequest
  A read request from a connected central, delivered to `GattServerListener.characteristicReadRequest(GattReadRequest)` or `GattServerListener.descriptorReadRequest(GattReadRequest)`.
  GattServer
  The local GATT server, opened via `BluetoothLE.openGattServer` when this device acts as a BLE peripheral.
  GattServerAdapter
  Convenience `GattServerListener` with empty implementations -- extend it and override only the events you handle.
  GattServerListener
  Receives the events of a local `GattServer`: requests from centrals, subscription changes and central connections.
  GattWriteRequest
  A write request from a connected central, delivered to `GattServerListener.characteristicWriteRequest(GattWriteRequest)` or `GattServerListener.descriptorWriteRequest(GattWriteRequest)`.
  TxPowerLevel
  Transmit power for advertising, trading range against battery.