Enum AdapterState

java.lang.Object
java.lang.Enum<AdapterState>
com.codename1.bluetooth.AdapterState
All Implemented Interfaces:
Comparable<AdapterState>

public enum AdapterState extends Enum<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 Details

    • UNKNOWN

      public static final AdapterState UNKNOWN
      The state has not been determined yet -- e.g. iOS before the first CoreBluetooth manager callback fired.
    • UNSUPPORTED

      public static final AdapterState UNSUPPORTED
      The device has no Bluetooth hardware, or the port does not implement Bluetooth at all. The fallback base Bluetooth class always reports this state.
    • UNAUTHORIZED

      public static final AdapterState UNAUTHORIZED
      The app is not authorized to use Bluetooth (iOS privacy authorization denied / restricted, or missing runtime permissions on Android).
    • POWERED_OFF

      public static final AdapterState POWERED_OFF
      The adapter is off. Ask the user to enable it, optionally via Bluetooth.requestEnable().
    • TURNING_ON

      public static final AdapterState TURNING_ON
      The adapter is transitioning to POWERED_ON (Android only; iOS reports the transition as a direct state change).
    • POWERED_ON

      public static final AdapterState POWERED_ON
      The adapter is on and ready for scanning, connections and advertising.
    • TURNING_OFF

      public static final AdapterState TURNING_OFF
      The adapter is transitioning to POWERED_OFF (Android only).
  • Method Details

    • values

      public static AdapterState[] 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

      public static AdapterState valueOf(String name)
      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 name
      NullPointerException - if the argument is null