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.

Types

enum AdapterStateLifecycle states of the local Bluetooth adapter, a union of the Android BluetoothAdapter states and the iOS CBManagerState values.
interface AdapterStateListenerObserves local adapter state changes registered via Bluetooth.addAdapterStateListener(AdapterStateListener).
class BluetoothEntry point for the Codename One Bluetooth API – adapter state, runtime permissions and the capability queries that let cross-platform code branch cleanly.
class BluetoothDeviceIdentity of a remote Bluetooth device, shared by the LE and classic stacks.
enum BluetoothErrorTyped error codes carried by every BluetoothException fired through the failure path of the asynchronous Bluetooth APIs.
class BluetoothExceptionThrown via the failure path of every AsyncResource returned by the Bluetooth APIs.
enum BluetoothPermissionThe runtime permissions the Bluetooth API may need, abstracted across platforms.
class BluetoothUuidImmutable 128-bit Bluetooth UUID value type used throughout the com.codename1.bluetooth API for services, characteristics and descriptors.
enum BondStatePairing state of a remote BluetoothDevice.
enum DeviceTypeThe transport family a remote BluetoothDevice supports, mirroring Android’s device-type classification.