Enum AdapterState
- All Implemented Interfaces:
Comparable<AdapterState>
Lifecycle states of the local Bluetooth adapter, a union of the Android
BluetoothAdapter states and the iOS CBManagerState values. Query via
Bluetooth.getAdapterState() and observe changes with
Bluetooth.addAdapterStateListener(AdapterStateListener).-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe adapter is off.The adapter is on and ready for scanning, connections and advertising.The adapter is transitioning toPOWERED_OFF(Android only).The adapter is transitioning toPOWERED_ON(Android only; iOS reports the transition as a direct state change).The app is not authorized to use Bluetooth (iOS privacy authorization denied / restricted, or missing runtime permissions on Android).The state has not been determined yet -- e.g.The device has no Bluetooth hardware, or the port does not implement Bluetooth at all. -
Method Summary
Modifier and TypeMethodDescriptionstatic AdapterStateReturns the enum constant of this type with the specified name.static AdapterState[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
UNKNOWN
The state has not been determined yet -- e.g. iOS before the first CoreBluetooth manager callback fired. -
UNSUPPORTED
The device has no Bluetooth hardware, or the port does not implement Bluetooth at all. The fallback baseBluetoothclass always reports this state. -
UNAUTHORIZED
The app is not authorized to use Bluetooth (iOS privacy authorization denied / restricted, or missing runtime permissions on Android). -
POWERED_OFF
The adapter is off. Ask the user to enable it, optionally viaBluetooth.requestEnable(). -
TURNING_ON
The adapter is transitioning toPOWERED_ON(Android only; iOS reports the transition as a direct state change). -
POWERED_ON
The adapter is on and ready for scanning, connections and advertising. -
TURNING_OFF
The adapter is transitioning toPOWERED_OFF(Android only).
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-