語言

BluetoothManager.OpenGattServer(Context, BluetoothGattServerCallback) 方法

定義

開啟 GATT 伺服器 回撥用於將結果傳送給呼叫者,例如連線狀態以及其他 GATT 伺服器操作的結果。

[Android.Runtime.Register("openGattServer", "(Landroid/content/Context;Landroid/bluetooth/BluetoothGattServerCallback;)Landroid/bluetooth/BluetoothGattServer;", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public Android.Bluetooth.BluetoothGattServer? OpenGattServer(Android.Content.Context? context, Android.Bluetooth.BluetoothGattServerCallback? callback);
[<Android.Runtime.Register("openGattServer", "(Landroid/content/Context;Landroid/bluetooth/BluetoothGattServerCallback;)Landroid/bluetooth/BluetoothGattServer;", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.OpenGattServer : Android.Content.Context * Android.Bluetooth.BluetoothGattServerCallback -> Android.Bluetooth.BluetoothGattServer

參數

context
Context

應用程式內容

callback
BluetoothGattServerCallback

GATT 伺服器回撥處理器,將接收非同步回撥。

傳回

BluetoothGattServer 實例

屬性

備註

開啟 GATT 伺服器 回撥用於將結果傳送給呼叫者,例如連線狀態以及其他 GATT 伺服器操作的結果。 此方法會回傳一個 BluetoothGattServer 實例。 你可以使用 BluetoothGattServer 來執行 GATT 伺服器操作。

Java 文件 android.bluetooth.BluetoothManager.openGattServer(android.content.Context, android.bluetooth.BluetoothGattServerCallback)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於