BluetoothGattServer.AddService(BluetoothGattService) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Add a service to the list of services to be hosted.
[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
Parameters
- service
- BluetoothGattService
Service to be added to the list of services provided by this device.
Returns
true, if the request to add service has been initiated
- Attributes
Remarks
Add a service to the list of services to be hosted.
Once a service has been added to the list, the service and its included characteristics will be provided by the local device.
If the local device has already exposed services when this function is called, a service update notification will be sent to all clients.
The BluetoothGattServerCallback#onServiceAdded
callback will indicate whether this service has been added successfully. Do not add another service before this callback.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.