Register a subscription to be canceled when the device is disconnected.
This function simplifies cleanup, so you can prevent creating duplicate stream subscriptions.
Establishes a connection to the Bluetooth Device.
timeout if timeout occurs, cancel the connection request and throw exception
mtu Android only. Request a larger mtu right after connection, if set.
autoConnect reconnect whenever the device is found
- if true, this function always returns immediately.
- you must listen to connectionState to know when connection occurs.
- auto connect is turned off by calling disconnect
- auto connect results in a slower connection process compared to a direct connection
because it relies on the internal scheduling of background scans.