语言

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)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于