BluetoothDevice.ConnectGatt Metode

Definisi

Overload

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

Sambungkan ke GATT Server yang dihosting oleh perangkat ini.

[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

Parameter

context
Context
autoConnect
Boolean

Apakah akan langsung terhubung ke perangkat jarak jauh (false) atau secara otomatis terhubung segera setelah perangkat jarak jauh tersedia (benar).

callback
BluetoothGattCallback

Handler panggilan balik GATT yang akan menerima panggilan balik asinkron.

transport
BluetoothTransports

transportasi pilihan untuk koneksi GATT ke perangkat BluetoothDevice#TRANSPORT_AUTO mode ganda jarak jauh atau BluetoothDevice#TRANSPORT_BREDR atau BluetoothDevice#TRANSPORT_LE

phy
BluetoothPhy

PHY pilihan untuk koneksi ke perangkat LE jarak jauh. Bitwise ATAU dari salah BluetoothDevice#PHY_LE_1M_MASKsatu , BluetoothDevice#PHY_LE_2M_MASK, an dBluetoothDevice#PHY_LE_CODED_MASK. Opsi ini tidak berlaku jika autoConnect diatur ke true.

handler
Handler

Handler yang digunakan untuk panggilan balik. Jika null, panggilan balik akan terjadi pada utas latar belakang yang tidak ditentukan.

Mengembalikan

Atribut

Keterangan

Sambungkan ke GATT Server yang dihosting oleh perangkat ini. Penelepon bertindak sebagai klien GATT. Panggilan balik digunakan untuk memberikan hasil kepada Pemanggil, seperti status koneksi serta operasi klien GATT lebih lanjut. Metode mengembalikan instans BluetoothGatt. Anda dapat menggunakan BluetoothGatt untuk melakukan operasi klien GATT.

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

Bagian dari halaman ini adalah modifikasi berdasarkan pekerjaan yang dibuat dan dibagikan oleh Android Open Source Project dan digunakan sesuai dengan istilah yang dijelaskan dalam Lisensi Creative Commons 2.5 Lisensi Atribusi.

Berlaku untuk

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

Perhatian

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

Parameter

context
Context
autoConnect
Boolean

Mengembalikan

Atribut

Keterangan

Bagian dari halaman ini adalah modifikasi berdasarkan pekerjaan yang dibuat dan dibagikan oleh Android Open Source Project dan digunakan sesuai dengan istilah yang dijelaskan dalam Lisensi Creative Commons 2.5 Lisensi Atribusi.

Berlaku untuk

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

Perhatian

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

Parameter

context
Context
autoConnect
Boolean
handler
Handler

Mengembalikan

Atribut

Keterangan

Bagian dari halaman ini adalah modifikasi berdasarkan pekerjaan yang dibuat dan dibagikan oleh Android Open Source Project dan digunakan sesuai dengan istilah yang dijelaskan dalam Lisensi Creative Commons 2.5 Lisensi Atribusi.

Berlaku untuk

ConnectGatt(Context, Boolean, BluetoothGattCallback, BluetoothTransports)

Sambungkan ke GATT Server yang dihosting oleh perangkat ini.

[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

Parameter

context
Context
autoConnect
Boolean

Apakah akan langsung terhubung ke perangkat jarak jauh (false) atau secara otomatis terhubung segera setelah perangkat jarak jauh tersedia (benar).

callback
BluetoothGattCallback

Handler panggilan balik GATT yang akan menerima panggilan balik asinkron.

transport
BluetoothTransports

transportasi pilihan untuk koneksi GATT ke perangkat BluetoothDevice#TRANSPORT_AUTO mode ganda jarak jauh atau BluetoothDevice#TRANSPORT_BREDR atau BluetoothDevice#TRANSPORT_LE

Mengembalikan

Atribut

Keterangan

Sambungkan ke GATT Server yang dihosting oleh perangkat ini. Penelepon bertindak sebagai klien GATT. Panggilan balik digunakan untuk memberikan hasil kepada Pemanggil, seperti status koneksi serta operasi klien GATT lebih lanjut. Metode mengembalikan instans BluetoothGatt. Anda dapat menggunakan BluetoothGatt untuk melakukan operasi klien GATT.

Java dokumentasi untuk android.bluetooth.BluetoothDevice.connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int).

Bagian dari halaman ini adalah modifikasi berdasarkan pekerjaan yang dibuat dan dibagikan oleh Android Open Source Project dan digunakan sesuai dengan istilah yang dijelaskan dalam Lisensi Creative Commons 2.5 Lisensi Atribusi.

Berlaku untuk

ConnectGatt(Context, Boolean, BluetoothGattCallback)

Sambungkan ke GATT Server yang dihosting oleh perangkat ini.

[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

Parameter

context
Context
autoConnect
Boolean

Apakah akan langsung terhubung ke perangkat jarak jauh (false) atau secara otomatis terhubung segera setelah perangkat jarak jauh tersedia (benar).

callback
BluetoothGattCallback

Handler panggilan balik GATT yang akan menerima panggilan balik asinkron.

Mengembalikan

Atribut

Pengecualian

jika panggilan balik null

Keterangan

Sambungkan ke GATT Server yang dihosting oleh perangkat ini. Penelepon bertindak sebagai klien GATT. Panggilan balik digunakan untuk memberikan hasil kepada Pemanggil, seperti status koneksi serta operasi klien GATT lebih lanjut. Metode mengembalikan instans BluetoothGatt. Anda dapat menggunakan BluetoothGatt untuk melakukan operasi klien GATT.

Java dokumentasi untuk android.bluetooth.BluetoothDevice.connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback).

Bagian dari halaman ini adalah modifikasi berdasarkan pekerjaan yang dibuat dan dibagikan oleh Android Open Source Project dan digunakan sesuai dengan istilah yang dijelaskan dalam Lisensi Creative Commons 2.5 Lisensi Atribusi.

Berlaku untuk

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

Sambungkan ke GATT Server yang dihosting oleh perangkat ini.

[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

Parameter

context
Context
autoConnect
Boolean

Apakah akan langsung terhubung ke perangkat jarak jauh (false) atau secara otomatis terhubung segera setelah perangkat jarak jauh tersedia (benar).

callback
BluetoothGattCallback

Handler panggilan balik GATT yang akan menerima panggilan balik asinkron.

transport
BluetoothTransports

transportasi pilihan untuk koneksi GATT ke perangkat BluetoothDevice#TRANSPORT_AUTO mode ganda jarak jauh atau BluetoothDevice#TRANSPORT_BREDR atau BluetoothDevice#TRANSPORT_LE

phy
BluetoothPhy

PHY pilihan untuk koneksi ke perangkat LE jarak jauh. Bitwise ATAU dari salah BluetoothDevice#PHY_LE_1M_MASKsatu , BluetoothDevice#PHY_LE_2M_MASK, dan BluetoothDevice#PHY_LE_CODED_MASK. Opsi ini tidak berlaku jika autoConnect diatur ke true.

Mengembalikan

Atribut

Keterangan

Sambungkan ke GATT Server yang dihosting oleh perangkat ini. Penelepon bertindak sebagai klien GATT. Panggilan balik digunakan untuk memberikan hasil kepada Pemanggil, seperti status koneksi serta operasi klien GATT lebih lanjut. Metode mengembalikan instans BluetoothGatt. Anda dapat menggunakan BluetoothGatt untuk melakukan operasi klien GATT.

Java dokumentasi untuk android.bluetooth.BluetoothDevice.connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int, int).

Bagian dari halaman ini adalah modifikasi berdasarkan pekerjaan yang dibuat dan dibagikan oleh Android Open Source Project dan digunakan sesuai dengan istilah yang dijelaskan dalam Lisensi Creative Commons 2.5 Lisensi Atribusi.

Berlaku untuk