共用方式為


BluetoothGattServer.AddService(BluetoothGattService) 方法

定義

將服務新增至要裝載的服務清單。

[Android.Runtime.Register("addService", "(Landroid/bluetooth/BluetoothGattService;)Z", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public bool AddService (Android.Bluetooth.BluetoothGattService? service);
[<Android.Runtime.Register("addService", "(Landroid/bluetooth/BluetoothGattService;)Z", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.AddService : Android.Bluetooth.BluetoothGattService -> bool

參數

service
BluetoothGattService

要新增至此裝置所提供服務清單的服務。

傳回

如果已起始新增服務的要求,則為 true

屬性

備註

android.bluetooth.BluetoothGattServer.addService(android.bluetooth.BluetoothGattService)Java 檔。

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於