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 AdapterState | Lifecycle states of the local Bluetooth adapter, a union of the Android BluetoothAdapter states and the iOS CBManagerState values. |
interface AdapterStateListener | Observes local adapter state changes registered via Bluetooth.addAdapterStateListener(AdapterStateListener). |
class Bluetooth | Entry point for the Codename One Bluetooth API – adapter state, runtime permissions and the capability queries that let cross-platform code branch cleanly. |
class BluetoothDevice | Identity of a remote Bluetooth device, shared by the LE and classic stacks. |
enum BluetoothError | Typed error codes carried by every BluetoothException fired through the failure path of the asynchronous Bluetooth APIs. |
class BluetoothException | Thrown via the failure path of every AsyncResource returned by the Bluetooth APIs. |
enum BluetoothPermission | The runtime permissions the Bluetooth API may need, abstracted across platforms. |
class BluetoothUuid | Immutable 128-bit Bluetooth UUID value type used throughout the com.codename1.bluetooth API for services, characteristics and descriptors. |
enum BondState | Pairing state of a remote BluetoothDevice. |
enum DeviceType | The transport family a remote BluetoothDevice supports, mirroring Android’s device-type classification. |