# Package com.codename1.bluetooth

package com.codename1.bluetooth

Cross-platform Bluetooth API: adapter state, runtime permissions and capability queries.

`Bluetooth.getInstance()` returns the platform implementation and is the single entry point; from it, `getLE()` reaches the BLE central role (`com.codename1.bluetooth.le`), `getLE().openGattServer(...)` / `startAdvertising(...)` the peripheral role (`com.codename1.bluetooth.le.server`) and `getClassic()` classic RFCOMM (`com.codename1.bluetooth.classic`). Identity types (`BluetoothDevice`, `BluetoothUuid`) and the typed error model (`BluetoothError`, `BluetoothException`) live here.

Every callback of the API is delivered on the EDT; only the blocking RFCOMM/L2CAP streams are consumed off it.

- Related Packages
  Package
  Description
  com.codename1.bluetooth.classic
  Classic Bluetooth (BR/EDR): inquiry discovery (`ClassicDiscovery`), bonded-device listing and RFCOMM stream connections (`RfcommConnection`, `RfcommServer`).
  com.codename1.bluetooth.gatt
  The client-side GATT model discovered on a remote peripheral: `GattService`, `GattCharacteristic` (read/write/subscribe), `GattDescriptor`, notification listeners and ATT status codes.
  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
  AdapterState
  Lifecycle states of the local Bluetooth adapter, a union of the Android `BluetoothAdapter` states and the iOS `CBManagerState` values.
  AdapterStateListener
  Observes local adapter state changes registered via `Bluetooth.addAdapterStateListener(AdapterStateListener)`.
  Bluetooth
  Entry point for the Codename One Bluetooth API -- adapter state, runtime permissions and the capability queries that let cross-platform code branch cleanly.
  BluetoothDevice
  Identity of a remote Bluetooth device, shared by the LE and classic stacks.
  BluetoothError
  Typed error codes carried by every `BluetoothException` fired through the failure path of the asynchronous Bluetooth APIs.
  BluetoothException
  Thrown via the failure path of every `AsyncResource` returned by the Bluetooth APIs.
  BluetoothPermission
  The runtime permissions the Bluetooth API may need, abstracted across platforms.
  BluetoothUuid
  Immutable 128-bit Bluetooth UUID value type used throughout the `com.codename1.bluetooth` API for services, characteristics and descriptors.
  BondState
  Pairing state of a remote `BluetoothDevice`.
  DeviceType
  The transport family a remote `BluetoothDevice` supports, mirroring Android's device-type classification.