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 实例

属性

注解

适用于 . 的 android.bluetooth.BluetoothManager.openGattServer(android.content.Context, android.bluetooth.BluetoothGattServerCallback)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于