39
edits
(→addIncludedService(BluetoothGattService service): Refine the description that the one would be rejected is the promise instead of the function itself.) |
|||
| (10 intermediate revisions by 3 users not shown) | |||
| Line 3: | Line 3: | ||
== Interfaces == | == Interfaces == | ||
[[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#BluetoothGattService|BluetoothGattService]] | * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#BluetoothGattService|BluetoothGattService]] | ||
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#BluetoothGattServiceInit|BluetoothGattServiceInit]] | |||
=== BluetoothGattService === | === BluetoothGattService === | ||
[CheckPermissions="bluetooth"] | [CheckPermissions="bluetooth", | ||
Constructor(BluetoothGattServiceInit init)] | |||
interface BluetoothGattService | interface BluetoothGattService | ||
{ | { | ||
| Line 16: | Line 18: | ||
readonly attribute unsigned short [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#instanceId|instanceId]]; | readonly attribute unsigned short [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#instanceId|instanceId]]; | ||
[NewObject | [NewObject] Promise<[[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattCharacteristic#BluetoothGattCharacteristic|BluetoothGattCharacteristic]]> [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#addCharacteristic.28DOMString_uuid.2C_GattPermissions_permissions.2C_GattCharacteristicProperties_properties.2C_ArrayBuffer_value.29|addCharacteristic(DOMString uuid, GattPermissions permissions, GattCharacteristicProperties properties, ArrayBuffer value)]]; | ||
[NewObject | [NewObject] Promise<void> [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#addIncludedService.28BluetoothGattService_service.29|addIncludedService(BluetoothGattService service)]]; | ||
}; | |||
=== BluetoothGattServiceInit === | |||
dictionary BluetoothGattServiceInit | |||
{ | |||
boolean isPrimary = false; | |||
DOMString uuid = ""; | |||
}; | }; | ||
| Line 83: | Line 92: | ||
== Methods == | == Methods == | ||
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#addCharacteristic.28DOMString_uuid. | * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#addCharacteristic.28DOMString_uuid.2C_GattPermissions_permissions.2C_GattCharacteristicProperties_properties.29|BluetoothGattService.addCharacteristic(DOMString uuid, GattPermissions permissions, GattCharacteristicProperties properties, ArrayBuffer value)]] | ||
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#addIncludedService.28BluetoothGattService_service.29|BluetoothGattService.addIncludedService(BluetoothGattService service)]] | * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#addIncludedService.28BluetoothGattService_service.29|BluetoothGattService.addIncludedService(BluetoothGattService service)]] | ||
=== addCharacteristic(DOMString uuid, | === addCharacteristic(DOMString uuid, GattPermissions permissions, GattCharacteristicProperties properties, ArrayBuffer value) === | ||
; Description | ; Description | ||
| Line 95: | Line 104: | ||
:: UUID of the characteristic to add. | :: UUID of the characteristic to add. | ||
: ''permissions'' | : ''permissions'' | ||
:: [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattCharacteristic# | :: [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattCharacteristic#GattPermissions|GattPermissions]] of the characteristic to add. | ||
: ''properties'' | : ''properties'' | ||
:: [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattCharacteristic# | :: [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattCharacteristic#GattCharacteristicProperties|GattCharacteristicProperties]] of the characteristic to add | ||
: ''value'' | |||
:: The initial value of this characteristic. | |||
; Return | ; Return | ||
| Line 105: | Line 116: | ||
; Description | ; Description | ||
: The method adds an included service to this service. | : The method adds an included service to this service. The included service to be added should be an existing service of the same GATT server, otherwise the promise will be rejected. | ||
; Parameter | ; Parameter | ||
edits