connect Device
fun connectDevice(lifecycleOwner: LifecycleOwner, device: BleDevice?, duration: Long = 5000, connectCallback: ConnectStateCallback)
Connects to a Bluetooth device
Parameters
lifecycle Owner
The LifecycleOwner used to manage the connection lifecycle
device
The Bluetooth device to connect to
duration
The connection timeout in milliseconds (default is 5000 milliseconds)
connect Callback
The callback for handling connection state changes