getBleConnectionState

Retrieves the Bluetooth Low Energy (BLE) connection state of the device.

This function indicates whether the Android device is currently connected, connecting, or disconnected from the specified BLE device.

Possible values are:

This function should be called before initiating a BLE connection or disconnection to ensure the desired operation is performed in the correct state.

Return

The current BLE connection state as a BleConnectionState enum.

See also

Parameters

device

The Bluetooth device to check the connection state for.