get Ble Connection State
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:
BleConnectionState.CONNECTED: Indicates an active connection to the device.
BleConnectionState.CONNECTING: Indicates an ongoing connection attempt.
BleConnectionState.DISCONNECTED: Indicates no active connection to the device.
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.