Android.Bluetooth.BluetoothDevice.ConnectGatt Method
Connect to GATT Server hosted by this device.

Syntax

[Android.Runtime.Register("connectGatt", "(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;)Landroid/bluetooth/BluetoothGatt;", "")]
public BluetoothGatt ConnectGatt (Android.Content.Context context, bool autoConnect, BluetoothGattCallback callback)

Parameters

context
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).
callback
GATT callback handler that will receive asynchronous callbacks.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif callback is null

Remarks

Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations.

[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