Compartilhar via


BluetoothGattServer.Connect(BluetoothDevice, Boolean) Method

Definition

Initiate a connection to a Bluetooth GATT capable device.

[Android.Runtime.Register("connect", "(Landroid/bluetooth/BluetoothDevice;Z)Z", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public bool Connect (Android.Bluetooth.BluetoothDevice? device, bool autoConnect);
[<Android.Runtime.Register("connect", "(Landroid/bluetooth/BluetoothDevice;Z)Z", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.Connect : Android.Bluetooth.BluetoothDevice * bool -> bool

Parameters

autoConnect
Boolean

Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true).

Returns

true, if the connection attempt was initiated successfully

Attributes

Remarks

Java documentation for android.bluetooth.BluetoothGattServer.connect(android.bluetooth.BluetoothDevice, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to