← Back to BluetoothEmulation domain

BluetoothEmulation.addService

Adds a service with |serviceUuid| to the peripheral with |address|.

Domain: BluetoothEmulation experimental

Parameters

NameTypeDescription
addressstring
serviceUuidstring

Returns

NameTypeDescription
serviceIdstringAn identifier that uniquely represents this service.

Example Request

{
  "id": 1,
  "method": "BluetoothEmulation.addService",
  "params": {
    "address": "address-value",
    "serviceUuid": "serviceUuid-value"
  }
}

Example Response

{
  "id": 1,
  "result": {
    "serviceId": "serviceId-value"
  }
}

Usage in Node.js

const result = await send('BluetoothEmulation.addService', {"address": "address-value", "serviceUuid": "serviceUuid-value"});
console.log(result);
// {"serviceId": "serviceId-value"}