Lingua

BluetoothDevice.ConnectGatt Metodo

Definizione

Overload

Nome Descrizione
ConnectGatt(BluetoothGattConnectionSettings, IExecutor, BluetoothGattCallback)

Connettersi al server GATT ospitato dal dispositivo specificato.

ConnectGatt(Context, Boolean, BluetoothGattCallback)

Connettersi al server GATT ospitato da questo dispositivo.

ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports)

Connettersi al server GATT ospitato da questo dispositivo.

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

Connettersi al server GATT ospitato da questo dispositivo.

ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, ScanSettingsPhy)
Obsoleti.
ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, BluetoothPhy, Handler)

Connettersi al server GATT ospitato da questo dispositivo.

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

ConnectGatt(BluetoothGattConnectionSettings, IExecutor, BluetoothGattCallback)

Connettersi al server GATT ospitato dal dispositivo specificato.

[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

Parametri

gattConnectionSettings
BluetoothGattConnectionSettings

BluetoothGattConnectionSettings oggetti con impostazioni gatt necessarie per la connessione GATT

executor
IExecutor

Executor da usare per il callback.

callback
BluetoothGattCallback

Gestore di callback GATT che riceverà callback asincroni.

Valori restituiti

Istanza di BluetoothGatt. È possibile usare BluetoothGatt per eseguire operazioni client GATT.

Attributi

Commenti

Connettersi al server GATT ospitato dal dispositivo specificato. Il chiamante funge da client GATT. BluetoothGattCallback di BluetoothGattConnectionSettings fornirà risultati al chiamante, ad esempio gli aggiornamenti della connessione e i risultati dell'operazione del client GATT. Il metodo restituisce un'istanza BluetoothGatt. L'applicazione può usare BluetoothGatt per eseguire operazioni client GATT. Per le app destinate a Build.VERSION_CODES. S o versione successiva richiede l'autorizzazione Manifest.permission.BLUETOOTH_CONNECT che può essere ottenuta con android.app.Activity.requestPermissions(String[],int). Richiede Manifest.permission.BLUETOOTH_CONNECT

Informazioni di riferimento su Android per android.bluetooth.BluetoothDevice.connectGatt.

Le parti di questa pagina sono modifiche basate sul lavoro creato e condiviso dalla e usati in base ai termini descritti in Creative License 2.5 Attribution License.

Si applica a

ConnectGatt(Context, Boolean, BluetoothGattCallback)

Connettersi al server GATT ospitato da questo dispositivo.

[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

Parametri

context
Context
autoConnect
Boolean

Se connettersi direttamente al dispositivo remoto (false) o connettersi automaticamente non appena il dispositivo remoto diventa disponibile (true).

callback
BluetoothGattCallback

Gestore di callback GATT che riceverà callback asincroni.

Valori restituiti

Attributi

Eccezioni

se il callback è Null

Commenti

Connettersi al server GATT ospitato da questo dispositivo. Il chiamante funge da client GATT. Il callback viene utilizzato per recapitare i risultati al chiamante, ad esempio lo stato della connessione e qualsiasi altra operazione del client GATT. Il metodo restituisce un'istanza BluetoothGatt. È possibile usare BluetoothGatt per eseguire operazioni client GATT.

per android.bluetooth.BluetoothDevice.connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback).

Le parti di questa pagina sono modifiche basate sul lavoro creato e condiviso dalla e usati in base ai termini descritti in Creative License 2.5 Attribution License.

Si applica a

ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports)

Connettersi al server GATT ospitato da questo dispositivo.

[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

Parametri

context
Context
autoConnect
Boolean

Se connettersi direttamente al dispositivo remoto (false) o connettersi automaticamente non appena il dispositivo remoto diventa disponibile (true).

callback
BluetoothGattCallback

Gestore di callback GATT che riceverà callback asincroni.

transport
BluetoothTransports

trasporto preferito per le connessioni GATT a dispositivi BluetoothDevice#TRANSPORT_AUTO a doppia modalità remota o o BluetoothDevice#TRANSPORT_BREDRBluetoothDevice#TRANSPORT_LE

Valori restituiti

Attributi

Commenti

Connettersi al server GATT ospitato da questo dispositivo. Il chiamante funge da client GATT. Il callback viene utilizzato per recapitare i risultati al chiamante, ad esempio lo stato della connessione e qualsiasi altra operazione del client GATT. Il metodo restituisce un'istanza BluetoothGatt. È possibile usare BluetoothGatt per eseguire operazioni client GATT.

per android.bluetooth.BluetoothDevice.connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int).

Le parti di questa pagina sono modifiche basate sul lavoro creato e condiviso dalla e usati in base ai termini descritti in Creative License 2.5 Attribution License.

Si applica a

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

Connettersi al server GATT ospitato da questo dispositivo.

[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

Parametri

context
Context
autoConnect
Boolean

Se connettersi direttamente al dispositivo remoto (false) o connettersi automaticamente non appena il dispositivo remoto diventa disponibile (true).

callback
BluetoothGattCallback

Gestore di callback GATT che riceverà callback asincroni.

transport
BluetoothTransports

trasporto preferito per le connessioni GATT a dispositivi BluetoothDevice#TRANSPORT_AUTO a doppia modalità remota o o BluetoothDevice#TRANSPORT_BREDRBluetoothDevice#TRANSPORT_LE

phy
BluetoothPhy

PHY preferito per le connessioni al dispositivo LE remoto. OR bit per bit di uno qualsiasi di BluetoothDevice#PHY_LE_1M_MASK, BluetoothDevice#PHY_LE_2M_MASKe BluetoothDevice#PHY_LE_CODED_MASK. Questa opzione non ha effetto se autoConnect è impostata su true.

Valori restituiti

Attributi

Commenti

Connettersi al server GATT ospitato da questo dispositivo. Il chiamante funge da client GATT. Il callback viene utilizzato per recapitare i risultati al chiamante, ad esempio lo stato della connessione e qualsiasi altra operazione del client GATT. Il metodo restituisce un'istanza BluetoothGatt. È possibile usare BluetoothGatt per eseguire operazioni client GATT.

per android.bluetooth.BluetoothDevice.connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int, int).

Le parti di questa pagina sono modifiche basate sul lavoro creato e condiviso dalla e usati in base ai termini descritti in Creative License 2.5 Attribution License.

Si applica a

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

Attenzione

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

Parametri

context
Context
autoConnect
Boolean

Valori restituiti

Attributi

Commenti

Le parti di questa pagina sono modifiche basate sul lavoro creato e condiviso dalla e usati in base ai termini descritti in Creative License 2.5 Attribution License.

Si applica a

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

Connettersi al server GATT ospitato da questo dispositivo.

[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

Parametri

context
Context
autoConnect
Boolean

Se connettersi direttamente al dispositivo remoto (false) o connettersi automaticamente non appena il dispositivo remoto diventa disponibile (true).

callback
BluetoothGattCallback

Gestore di callback GATT che riceverà callback asincroni.

transport
BluetoothTransports

trasporto preferito per le connessioni GATT a dispositivi BluetoothDevice#TRANSPORT_AUTO a doppia modalità remota o o BluetoothDevice#TRANSPORT_BREDRBluetoothDevice#TRANSPORT_LE

phy
BluetoothPhy

PHY preferito per le connessioni al dispositivo LE remoto. OR bit per bit di uno qualsiasi di BluetoothDevice#PHY_LE_1M_MASK, BluetoothDevice#PHY_LE_2M_MASK, un dBluetoothDevice#PHY_LE_CODED_MASK. Questa opzione non ha effetto se autoConnect è impostata su true.

handler
Handler

Gestore da utilizzare per il callback. Se null, i callback verranno eseguiti in un thread in background non specificato.

Valori restituiti

Attributi

Commenti

Connettersi al server GATT ospitato da questo dispositivo. Il chiamante funge da client GATT. Il callback viene utilizzato per recapitare i risultati al chiamante, ad esempio lo stato della connessione e qualsiasi altra operazione del client GATT. Il metodo restituisce un'istanza BluetoothGatt. È possibile usare BluetoothGatt per eseguire operazioni client GATT.

per android.bluetooth.BluetoothDevice.connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int, int, android.os.Handler).

Le parti di questa pagina sono modifiche basate sul lavoro creato e condiviso dalla e usati in base ai termini descritti in Creative License 2.5 Attribution License.

Si applica a

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

Attenzione

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

Parametri

context
Context
autoConnect
Boolean
handler
Handler

Valori restituiti

Attributi

Commenti

Le parti di questa pagina sono modifiche basate sul lavoro creato e condiviso dalla e usati in base ai termini descritti in Creative License 2.5 Attribution License.

Si applica a