Langue

BluetoothDevice.ConnectGatt Méthode

Définition

Surcharges

Nom Description
ConnectGatt(BluetoothGattConnectionSettings, IExecutor, BluetoothGattCallback)

Connectez-vous au serveur GATT hébergé par l’appareil donné.

ConnectGatt(Context, Boolean, BluetoothGattCallback)

Connectez-vous au serveur GATT hébergé par cet appareil.

ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports)

Connectez-vous au serveur GATT hébergé par cet appareil.

ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, BluetoothPhy)

Connectez-vous au serveur GATT hébergé par cet appareil.

ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, ScanSettingsPhy)
Obsolète.
ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, BluetoothPhy, Handler)

Connectez-vous au serveur GATT hébergé par cet appareil.

ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, ScanSettingsPhy, Handler)
Obsolète.

ConnectGatt(BluetoothGattConnectionSettings, IExecutor, BluetoothGattCallback)

Connectez-vous au serveur GATT hébergé par l’appareil donné.

[Android.Runtime.Register("connectGatt", "(Landroid/bluetooth/BluetoothGattConnectionSettings;Ljava/util/concurrent/Executor;Landroid/bluetooth/BluetoothGattCallback;)Landroid/bluetooth/BluetoothGatt;", "", ApiSince=37)]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public Android.Bluetooth.BluetoothGatt? ConnectGatt(Android.Bluetooth.BluetoothGattConnectionSettings gattConnectionSettings, Java.Util.Concurrent.IExecutor executor, Android.Bluetooth.BluetoothGattCallback callback);
[<Android.Runtime.Register("connectGatt", "(Landroid/bluetooth/BluetoothGattConnectionSettings;Ljava/util/concurrent/Executor;Landroid/bluetooth/BluetoothGattCallback;)Landroid/bluetooth/BluetoothGatt;", "", ApiSince=37)>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.ConnectGatt : Android.Bluetooth.BluetoothGattConnectionSettings * Java.Util.Concurrent.IExecutor * Android.Bluetooth.BluetoothGattCallback -> Android.Bluetooth.BluetoothGatt

Paramètres

gattConnectionSettings
BluetoothGattConnectionSettings

BluetoothGattConnectionSettings objets avec les paramètres gatt requis pour la connexion GATT

executor
IExecutor

Exécuteur à utiliser pour le rappel.

callback
BluetoothGattCallback

Gestionnaire de rappel GATT qui recevra des rappels asynchrones.

Retours

Instance BluetoothGatt. Vous pouvez utiliser BluetoothGatt pour effectuer des opérations clientes GATT.

Attributs

Remarques

Connectez-vous au serveur GATT hébergé par l’appareil donné. L’appelant agit en tant que client GATT. BluetoothGattCallback de BluetoothGattConnectionSettings fournira des résultats à l’appelant, tels que les mises à jour de connexion et les résultats de l’opération client GATT. La méthode retourne une instance BluetoothGatt. L’application peut utiliser BluetoothGatt pour effectuer des opérations clientes GATT. Pour les applications ciblant Build.VERSION_CODES. S ou version ultérieure nécessite l’autorisation Manifest.permission.BLUETOOTH_CONNECT qui peut être obtenue avec android.app.Activity.requestPermissions(String[],int). Nécessite Manifest.permission.BLUETOOTH_CONNECT

Référence Android pour android.bluetooth.BluetoothDevice.connectGatt.

Les parties de cette page sont des modifications basées sur le travail créé et partagé par Android Open Source et utilisées en fonction des termes décrits dans la Creative Commons 2.5 Attribution License.

S’applique à

ConnectGatt(Context, Boolean, BluetoothGattCallback)

Connectez-vous au serveur GATT hébergé par cet appareil.

[Android.Runtime.Register("connectGatt", "(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;)Landroid/bluetooth/BluetoothGatt;", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public Android.Bluetooth.BluetoothGatt? ConnectGatt(Android.Content.Context? context, bool autoConnect, Android.Bluetooth.BluetoothGattCallback? callback);
[<Android.Runtime.Register("connectGatt", "(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;)Landroid/bluetooth/BluetoothGatt;", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.ConnectGatt : Android.Content.Context * bool * Android.Bluetooth.BluetoothGattCallback -> Android.Bluetooth.BluetoothGatt

Paramètres

context
Context
autoConnect
Boolean

S’il faut se connecter directement à l’appareil distant (false) ou se connecter automatiquement dès que l’appareil distant devient disponible (true).

callback
BluetoothGattCallback

Gestionnaire de rappel GATT qui recevra des rappels asynchrones.

Retours

Attributs

Exceptions

si le rappel a la valeur Null

Remarques

Connectez-vous au serveur GATT hébergé par cet appareil. L’appelant agit comme client GATT. Le rappel est utilisé pour fournir des résultats à l’appelant, tels que l’état de connexion ainsi que toute autre opération client GATT. La méthode retourne une instance BluetoothGatt. Vous pouvez utiliser BluetoothGatt pour effectuer des opérations clientes GATT.

Java documentation pour android.bluetooth.BluetoothDevice.connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback).

Les parties de cette page sont des modifications basées sur le travail créé et partagé par Android Open Source et utilisées en fonction des termes décrits dans la Creative Commons 2.5 Attribution License.

S’applique à

ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports)

Connectez-vous au serveur GATT hébergé par cet appareil.

[Android.Runtime.Register("connectGatt", "(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;I)Landroid/bluetooth/BluetoothGatt;", "", ApiSince=23)]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public Android.Bluetooth.BluetoothGatt? ConnectGatt(Android.Content.Context? context, bool autoConnect, Android.Bluetooth.BluetoothGattCallback? callback, Android.Bluetooth.BluetoothTransports transport);
[<Android.Runtime.Register("connectGatt", "(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;I)Landroid/bluetooth/BluetoothGatt;", "", ApiSince=23)>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.ConnectGatt : Android.Content.Context * bool * Android.Bluetooth.BluetoothGattCallback * Android.Bluetooth.BluetoothTransports -> Android.Bluetooth.BluetoothGatt

Paramètres

context
Context
autoConnect
Boolean

S’il faut se connecter directement à l’appareil distant (false) ou se connecter automatiquement dès que l’appareil distant devient disponible (true).

callback
BluetoothGattCallback

Gestionnaire de rappel GATT qui recevra des rappels asynchrones.

transport
BluetoothTransports

transport préféré pour les connexions GATT aux appareils BluetoothDevice#TRANSPORT_AUTO à double mode distant ou BluetoothDevice#TRANSPORT_BREDRBluetoothDevice#TRANSPORT_LE

Retours

Attributs

Remarques

Connectez-vous au serveur GATT hébergé par cet appareil. L’appelant agit comme client GATT. Le rappel est utilisé pour fournir des résultats à l’appelant, tels que l’état de connexion ainsi que toute autre opération client GATT. La méthode retourne une instance BluetoothGatt. Vous pouvez utiliser BluetoothGatt pour effectuer des opérations clientes GATT.

Java documentation pour android.bluetooth.BluetoothDevice.connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int).

Les parties de cette page sont des modifications basées sur le travail créé et partagé par Android Open Source et utilisées en fonction des termes décrits dans la Creative Commons 2.5 Attribution License.

S’applique à

ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, BluetoothPhy)

Connectez-vous au serveur GATT hébergé par cet appareil.

[Android.Runtime.Register("connectGatt", "(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;II)Landroid/bluetooth/BluetoothGatt;", "", ApiSince=26)]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public Android.Bluetooth.BluetoothGatt? ConnectGatt(Android.Content.Context? context, bool autoConnect, Android.Bluetooth.BluetoothGattCallback? callback, Android.Bluetooth.BluetoothTransports transport, Android.Bluetooth.BluetoothPhy phy);
[<Android.Runtime.Register("connectGatt", "(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;II)Landroid/bluetooth/BluetoothGatt;", "", ApiSince=26)>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.ConnectGatt : Android.Content.Context * bool * Android.Bluetooth.BluetoothGattCallback * Android.Bluetooth.BluetoothTransports * Android.Bluetooth.BluetoothPhy -> Android.Bluetooth.BluetoothGatt

Paramètres

context
Context
autoConnect
Boolean

S’il faut se connecter directement à l’appareil distant (false) ou se connecter automatiquement dès que l’appareil distant devient disponible (true).

callback
BluetoothGattCallback

Gestionnaire de rappel GATT qui recevra des rappels asynchrones.

transport
BluetoothTransports

transport préféré pour les connexions GATT aux appareils BluetoothDevice#TRANSPORT_AUTO à double mode distant ou BluetoothDevice#TRANSPORT_BREDRBluetoothDevice#TRANSPORT_LE

phy
BluetoothPhy

preferred PHY for connections to remote LE device. OR au niveau du bit de l’un des BluetoothDevice#PHY_LE_1M_MASKfichiers , BluetoothDevice#PHY_LE_2M_MASKet BluetoothDevice#PHY_LE_CODED_MASK. Cette option ne prend pas effet si autoConnect elle a la valeur true.

Retours

Attributs

Remarques

Connectez-vous au serveur GATT hébergé par cet appareil. L’appelant agit comme client GATT. Le rappel est utilisé pour fournir des résultats à l’appelant, tels que l’état de connexion ainsi que toute autre opération client GATT. La méthode retourne une instance BluetoothGatt. Vous pouvez utiliser BluetoothGatt pour effectuer des opérations clientes GATT.

Java documentation pour android.bluetooth.BluetoothDevice.connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int, int).

Les parties de cette page sont des modifications basées sur le travail créé et partagé par Android Open Source et utilisées en fonction des termes décrits dans la Creative Commons 2.5 Attribution License.

S’applique à

ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, ScanSettingsPhy)

Attention

This method has the wrong enumeration. Use the version that takes an 'Android.Bluetooth.BluetoothPhy' instead.

[System.Obsolete("This method has the wrong enumeration. Use the version that takes an 'Android.Bluetooth.BluetoothPhy' instead.")]
public Android.Bluetooth.BluetoothGatt? ConnectGatt(Android.Content.Context? context, bool autoConnect, Android.Bluetooth.BluetoothGattCallback? callback, Android.Bluetooth.BluetoothTransports transport, Android.Bluetooth.LE.ScanSettingsPhy phy);
[<System.Obsolete("This method has the wrong enumeration. Use the version that takes an 'Android.Bluetooth.BluetoothPhy' instead.")>]
member this.ConnectGatt : Android.Content.Context * bool * Android.Bluetooth.BluetoothGattCallback * Android.Bluetooth.BluetoothTransports * Android.Bluetooth.LE.ScanSettingsPhy -> Android.Bluetooth.BluetoothGatt

Paramètres

context
Context
autoConnect
Boolean

Retours

Attributs

Remarques

Les parties de cette page sont des modifications basées sur le travail créé et partagé par Android Open Source et utilisées en fonction des termes décrits dans la Creative Commons 2.5 Attribution License.

S’applique à

ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, BluetoothPhy, Handler)

Connectez-vous au serveur GATT hébergé par cet appareil.

[Android.Runtime.Register("connectGatt", "(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;IILandroid/os/Handler;)Landroid/bluetooth/BluetoothGatt;", "", ApiSince=26)]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public Android.Bluetooth.BluetoothGatt? ConnectGatt(Android.Content.Context? context, bool autoConnect, Android.Bluetooth.BluetoothGattCallback? callback, Android.Bluetooth.BluetoothTransports transport, Android.Bluetooth.BluetoothPhy phy, Android.OS.Handler? handler);
[<Android.Runtime.Register("connectGatt", "(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;IILandroid/os/Handler;)Landroid/bluetooth/BluetoothGatt;", "", ApiSince=26)>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.ConnectGatt : Android.Content.Context * bool * Android.Bluetooth.BluetoothGattCallback * Android.Bluetooth.BluetoothTransports * Android.Bluetooth.BluetoothPhy * Android.OS.Handler -> Android.Bluetooth.BluetoothGatt

Paramètres

context
Context
autoConnect
Boolean

S’il faut se connecter directement à l’appareil distant (false) ou se connecter automatiquement dès que l’appareil distant devient disponible (true).

callback
BluetoothGattCallback

Gestionnaire de rappel GATT qui recevra des rappels asynchrones.

transport
BluetoothTransports

transport préféré pour les connexions GATT aux appareils BluetoothDevice#TRANSPORT_AUTO à double mode distant ou BluetoothDevice#TRANSPORT_BREDRBluetoothDevice#TRANSPORT_LE

phy
BluetoothPhy

preferred PHY for connections to remote LE device. OR au niveau du bit de l’un des BluetoothDevice#PHY_LE_1M_MASK, BluetoothDevice#PHY_LE_2M_MASKun dBluetoothDevice#PHY_LE_CODED_MASK. Cette option ne prend pas effet si autoConnect elle a la valeur true.

handler
Handler

Gestionnaire à utiliser pour le rappel. Si null, les rappels se produisent sur un thread d’arrière-plan non spécifié.

Retours

Attributs

Remarques

Connectez-vous au serveur GATT hébergé par cet appareil. L’appelant agit comme client GATT. Le rappel est utilisé pour fournir des résultats à l’appelant, tels que l’état de connexion ainsi que toute autre opération client GATT. La méthode retourne une instance BluetoothGatt. Vous pouvez utiliser BluetoothGatt pour effectuer des opérations clientes GATT.

Java documentation pour android.bluetooth.BluetoothDevice.connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int, int, android.os.Handler).

Les parties de cette page sont des modifications basées sur le travail créé et partagé par Android Open Source et utilisées en fonction des termes décrits dans la Creative Commons 2.5 Attribution License.

S’applique à

ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, ScanSettingsPhy, Handler)

Attention

This method has the wrong enumeration. Use the version that takes an 'Android.Bluetooth.BluetoothPhy' instead.

[System.Obsolete("This method has the wrong enumeration. Use the version that takes an 'Android.Bluetooth.BluetoothPhy' instead.")]
public Android.Bluetooth.BluetoothGatt? ConnectGatt(Android.Content.Context? context, bool autoConnect, Android.Bluetooth.BluetoothGattCallback? callback, Android.Bluetooth.BluetoothTransports transport, Android.Bluetooth.LE.ScanSettingsPhy phy, Android.OS.Handler? handler);
[<System.Obsolete("This method has the wrong enumeration. Use the version that takes an 'Android.Bluetooth.BluetoothPhy' instead.")>]
member this.ConnectGatt : Android.Content.Context * bool * Android.Bluetooth.BluetoothGattCallback * Android.Bluetooth.BluetoothTransports * Android.Bluetooth.LE.ScanSettingsPhy * Android.OS.Handler -> Android.Bluetooth.BluetoothGatt

Paramètres

context
Context
autoConnect
Boolean
handler
Handler

Retours

Attributs

Remarques

Les parties de cette page sont des modifications basées sur le travail créé et partagé par Android Open Source et utilisées en fonction des termes décrits dans la Creative Commons 2.5 Attribution License.

S’applique à