BluetoothDevice.ConnectGatt メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
オーバーロード
| 名前 | 説明 |
|---|---|
| ConnectGatt(BluetoothGattConnectionSettings, IExecutor, BluetoothGattCallback) |
指定されたデバイスによってホストされている GATT サーバーに接続します。 |
| ConnectGatt(Context, Boolean, BluetoothGattCallback) |
このデバイスでホストされている GATT サーバーに接続します。 |
| ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports) |
このデバイスでホストされている GATT サーバーに接続します。 |
| ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, BluetoothPhy) |
このデバイスでホストされている GATT サーバーに接続します。 |
| ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, ScanSettingsPhy) |
古い.
|
| ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, BluetoothPhy, Handler) |
このデバイスでホストされている GATT サーバーに接続します。 |
| ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, ScanSettingsPhy, Handler) |
古い.
|
ConnectGatt(BluetoothGattConnectionSettings, IExecutor, BluetoothGattCallback)
指定されたデバイスによってホストされている GATT サーバーに接続します。
[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
パラメーター
- gattConnectionSettings
- BluetoothGattConnectionSettings
BluetoothGattConnectionSettings GATT 接続に必要な gatt 設定を持つオブジェクト
- executor
- IExecutor
コールバックに使用する Executor。
- callback
- BluetoothGattCallback
非同期コールバックを受け取る GATT コールバック ハンドラー。
返品
BluetoothGatt インスタンス。 BluetoothGatt を使用して GATT クライアント操作を実行できます。
- 属性
注釈
指定されたデバイスによってホストされている GATT サーバーに接続します。 呼び出し元は GATT クライアントとして機能します。 BluetoothGattConnectionSettings の BluetoothGattCallback は、接続の更新や GATT クライアント操作の結果などの結果を呼び出し元に配信します。 このメソッドは BluetoothGatt インスタンスを返します。 アプリケーションは BluetoothGatt を使用して GATT クライアント操作を実行できます。 Build.VERSION_CODESを対象とするアプリの場合。S 以降では、android.app.Activity.requestPermissions(String[],int) で取得できるManifest.permission.BLUETOOTH_CONNECTアクセス許可が必要です。 Manifest.permission.BLUETOOTH_CONNECTが必要
android.bluetooth.BluetoothDevice.connectGattの Android リファレンス。
このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。
適用対象
ConnectGatt(Context, Boolean, BluetoothGattCallback)
このデバイスでホストされている GATT サーバーに接続します。
[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
パラメーター
- context
- Context
- autoConnect
- Boolean
リモート デバイスに直接接続するか (false) にするか、リモート デバイスが使用可能になったらすぐに自動的に接続するか (true)。
- callback
- BluetoothGattCallback
非同期コールバックを受け取る GATT コールバック ハンドラー。
返品
- 属性
例外
コールバックが null の場合
注釈
このデバイスでホストされている GATT サーバーに接続します。 呼び出し元は GATT クライアントとして機能します。 コールバックは、接続の状態や GATT クライアント操作などの結果を呼び出し元に配信するために使用されます。 このメソッドは BluetoothGatt インスタンスを返します。 BluetoothGatt を使用して GATT クライアント操作を実行できます。
このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。
適用対象
ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports)
このデバイスでホストされている GATT サーバーに接続します。
[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
パラメーター
- context
- Context
- autoConnect
- Boolean
リモート デバイスに直接接続するか (false) にするか、リモート デバイスが使用可能になったらすぐに自動的に接続するか (true)。
- callback
- BluetoothGattCallback
非同期コールバックを受け取る GATT コールバック ハンドラー。
- transport
- BluetoothTransports
BluetoothDevice#TRANSPORT_AUTOまたはBluetoothDevice#TRANSPORT_BREDRまたはリモート デュアルモード デバイスへの GATT 接続の優先トランスポートBluetoothDevice#TRANSPORT_LE
返品
- 属性
注釈
このデバイスでホストされている GATT サーバーに接続します。 呼び出し元は GATT クライアントとして機能します。 コールバックは、接続の状態や GATT クライアント操作などの結果を呼び出し元に配信するために使用されます。 このメソッドは BluetoothGatt インスタンスを返します。 BluetoothGatt を使用して GATT クライアント操作を実行できます。
このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。
適用対象
ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, BluetoothPhy)
このデバイスでホストされている GATT サーバーに接続します。
[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
パラメーター
- context
- Context
- autoConnect
- Boolean
リモート デバイスに直接接続するか (false) にするか、リモート デバイスが使用可能になったらすぐに自動的に接続するか (true)。
- callback
- BluetoothGattCallback
非同期コールバックを受け取る GATT コールバック ハンドラー。
- transport
- BluetoothTransports
BluetoothDevice#TRANSPORT_AUTOまたはBluetoothDevice#TRANSPORT_BREDRまたはリモート デュアルモード デバイスへの GATT 接続の優先トランスポートBluetoothDevice#TRANSPORT_LE
- phy
- BluetoothPhy
リモート LE デバイスへの接続に推奨される PHY。
BluetoothDevice#PHY_LE_1M_MASK、BluetoothDevice#PHY_LE_2M_MASK、BluetoothDevice#PHY_LE_CODED_MASKのいずれかのビットごとの OR。
autoConnectが true に設定されている場合、このオプションは有効になりません。
返品
- 属性
注釈
このデバイスでホストされている GATT サーバーに接続します。 呼び出し元は GATT クライアントとして機能します。 コールバックは、接続の状態や GATT クライアント操作などの結果を呼び出し元に配信するために使用されます。 このメソッドは BluetoothGatt インスタンスを返します。 BluetoothGatt を使用して GATT クライアント操作を実行できます。
このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。
適用対象
ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, ScanSettingsPhy)
注意事項
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
パラメーター
- context
- Context
- autoConnect
- Boolean
- callback
- BluetoothGattCallback
- transport
- BluetoothTransports
- phy
- ScanSettingsPhy
返品
- 属性
注釈
このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。
適用対象
ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, BluetoothPhy, Handler)
このデバイスでホストされている GATT サーバーに接続します。
[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
パラメーター
- context
- Context
- autoConnect
- Boolean
リモート デバイスに直接接続するか (false) にするか、リモート デバイスが使用可能になったらすぐに自動的に接続するか (true)。
- callback
- BluetoothGattCallback
非同期コールバックを受け取る GATT コールバック ハンドラー。
- transport
- BluetoothTransports
BluetoothDevice#TRANSPORT_AUTOまたはBluetoothDevice#TRANSPORT_BREDRまたはリモート デュアルモード デバイスへの GATT 接続の優先トランスポートBluetoothDevice#TRANSPORT_LE
- phy
- BluetoothPhy
リモート LE デバイスへの接続に推奨される PHY。
BluetoothDevice#PHY_LE_1M_MASK、BluetoothDevice#PHY_LE_2M_MASK、dBluetoothDevice#PHY_LE_CODED_MASKのいずれかのビットごとの OR。
autoConnectが true に設定されている場合、このオプションは有効になりません。
- handler
- Handler
コールバックに使用するハンドラー。
null場合、コールバックは指定されていないバックグラウンド スレッドで発生します。
返品
- 属性
注釈
このデバイスでホストされている GATT サーバーに接続します。 呼び出し元は GATT クライアントとして機能します。 コールバックは、接続の状態や GATT クライアント操作などの結果を呼び出し元に配信するために使用されます。 このメソッドは BluetoothGatt インスタンスを返します。 BluetoothGatt を使用して GATT クライアント操作を実行できます。
このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。
適用対象
ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports, ScanSettingsPhy, Handler)
注意事項
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
パラメーター
- context
- Context
- autoConnect
- Boolean
- callback
- BluetoothGattCallback
- transport
- BluetoothTransports
- phy
- ScanSettingsPhy
- handler
- Handler
返品
- 属性
注釈
このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。