Android.Bluetooth.BluetoothGattServer.Connect Method
Initiate a connection to a Bluetooth GATT capable device.

Syntax

[Android.Runtime.Register("connect", "(Landroid/bluetooth/BluetoothDevice;Z)Z", "")]
public bool Connect (BluetoothDevice device, bool autoConnect)

Parameters

device
Documentation for this section has not yet been entered.
autoConnect
Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true).

Returns

Documentation for this section has not yet been entered.

Remarks

Initiate a connection to a Bluetooth GATT capable device.

The connection may not be established right away, but will be completed when the remote device is available. A BluetoothGattServerCallback.OnConnectionStateChange(BluetoothDevice, Android.Bluetooth.ProfileState, Android.Bluetooth.ProfileState) callback will be invoked when the connection state changes as a result of this function.

The autoConnect paramter determines whether to actively connect to the remote device, or rather passively scan and finalize the connection when the remote device is in range/available. Generally, the first ever connection to a device should be direct (autoConnect set to false) and subsequent connections to known devices should be invoked with the autoConnect parameter set to true.

Requires NoType:android/Manifest$permission;Href=../../../reference/android/Manifest.permission.html#BLUETOOTH permission.

[Android Documentation]

Requirements

Namespace: Android.Bluetooth
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 18