disconnect

Gracefully disconnects from the Bluetooth device.

This triggers a disconnection that will result in a callback to handleConnectionStateChange with BluetoothProfile.STATE_DISCONNECTED. The state machine will transition to ConnectionState.Disconnected.

If autoReconnect is enabled, a reconnection will be scheduled after reconnectDelayMs milliseconds. Use close instead if you want to permanently disconnect without auto-reconnection.

This method is safe to call even if not currently connected.

See also

Throws

if Bluetooth permissions are not granted.