Skip to content

Commit 3d86075

Browse files
committed
Add WebDriver Bidi commands
Add the following WebDriver Bidi commands and events for Web Bluetooth automation. - bluetooth.SimulateService - bluetooth.SimulateCharacteristic - bluetooth.simulateCharacteristicResponse - bluetooth.SimulateDescriptor - bluetooth.simulateDescriptorResponse - bluetooth.CharacteristicEventGenerated - bluetooth.DescriptorEventGenerated The detail algorithm for each of the those will be completed in future PRs.
1 parent d940d56 commit 3d86075

1 file changed

Lines changed: 332 additions & 3 deletions

File tree

index.bs

Lines changed: 332 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5018,8 +5018,18 @@ referenced.
50185018
## Definitions ## {#bluetooth-bidi-definitions}
50195019

50205020
<pre class="cddl remote-cddl local-cddl">
5021-
bluetooth.BluetoothServiceUuid = text;
5021+
bluetooth.BluetoothUuid = text;
50225022
bluetooth.BluetoothManufacturerData = { key: uint, data: tstr };
5023+
bluetooth.CharacteristicProperties = {
5024+
? broadcast: bool,
5025+
? read: bool,
5026+
? writeWithoutResponse: bool,
5027+
? write: bool,
5028+
? notify: bool,
5029+
? indicate: bool,
5030+
? authenticatedSignedWrites: bool,
5031+
? extendedProperties: bool
5032+
}
50235033
</pre>
50245034

50255035
<dl>
@@ -5119,7 +5129,7 @@ To <dfn>serialize prompt devices</dfn> given [=device prompt=] |prompt|:
51195129

51205130
bluetooth.ScanRecord = {
51215131
? name: text,
5122-
? uuids: [ * bluetooth.BluetoothServiceUuid ],
5132+
? uuids: [ * bluetooth.BluetoothUuid ],
51235133
? appearance: number,
51245134
? manufacturerData: [ * bluetooth.BluetoothManufacturerData ],
51255135
}
@@ -5166,6 +5176,11 @@ BluetoothCommand = (
51665176
bluetooth.SimulateAdvertisement //
51675177
bluetooth.SimulateGattConnectionResponse //
51685178
bluetooth.SimulateGattDisconnection //
5179+
bluetooth.SimulateService //
5180+
bluetooth.SimulateCharacteristic //
5181+
bluetooth.simulateCharacteristicResponse //
5182+
bluetooth.SimulateDescriptor //
5183+
bluetooth.simulateDescriptorResponse //
51695184
)
51705185
</pre>
51715186

@@ -5344,7 +5359,7 @@ bluetooth.SimulatePreconnectedPeripheralParameters = {
53445359
address: text,
53455360
name: text,
53465361
manufacturerData: [ * bluetooth.BluetoothManufacturerData ],
5347-
knownServiceUuids: [ * bluetooth.BluetoothServiceUuid ]
5362+
knownServiceUuids: [ * bluetooth.BluetoothUuid ]
53485363
}
53495364
</pre>
53505365

@@ -5567,6 +5582,271 @@ A [=local end=] could simulate device GATT disconnection by sending the followin
55675582
</pre>
55685583
</div>
55695584

5585+
#### The bluetooth.simulateService Command #### {#bluetooth-simulateservice-command}
5586+
5587+
<pre highlight="cddl" class="cddl remote-cddl local-cddl">
5588+
bluetooth.SimulateService = (
5589+
method: "bluetooth.simulateService",
5590+
params: bluetooth.SimulateServiceParameters,
5591+
)
5592+
5593+
bluetooth.simulateServiceParameters = {
5594+
context: text,
5595+
address: text,
5596+
uuid: bluetooth.BluetoothUuid,
5597+
type: "add" / "remove",
5598+
}
5599+
</pre>
5600+
5601+
<div algorithm="remote end steps for bluetooth.simulateService">
5602+
5603+
Issue: TODO: Finish the algorithm of bluetooth.simulateService.
5604+
5605+
</div>
5606+
5607+
<div class="example">
5608+
A [=local end=] could simulate adding a GATT service by sending the following message:
5609+
5610+
<pre highlight="json">
5611+
{
5612+
"method": "bluetooth.simulateService",
5613+
"params": {
5614+
"context": "cxt-d03fdd81",
5615+
"address": "09:09:09:09:09:09",
5616+
"uuid": "0000180d-0000-1000-8000-00805f9b34fb",
5617+
"type": "add"
5618+
}
5619+
}
5620+
</pre>
5621+
</div>
5622+
5623+
<div class="example">
5624+
A [=local end=] could simulate removing a GATT service by sending the following message:
5625+
5626+
<pre highlight="json">
5627+
{
5628+
"method": "bluetooth.simulateService",
5629+
"params": {
5630+
"context": "cxt-d03fdd81",
5631+
"address": "09:09:09:09:09:09",
5632+
"uuid": "0000180d-0000-1000-8000-00805f9b34fb",
5633+
"type": "remove"
5634+
}
5635+
}
5636+
</pre>
5637+
</div>
5638+
5639+
#### The bluetooth.SimulateCharacteristic Command #### {#bluetooth-simulatecharacteristic-command}
5640+
5641+
<pre highlight="cddl" class="cddl remote-cddl local-cddl">
5642+
bluetooth.SimulateCharacteristic = (
5643+
method: "bluetooth.simulateCharacteristic",
5644+
params: bluetooth.SimulateCharacteristicParameters,
5645+
)
5646+
5647+
bluetooth.SimulateCharacteristicParameters = {
5648+
context: text,
5649+
address: text,
5650+
serviceUuid: bluetooth.BluetoothUuid,
5651+
characteristicUuid: bluetooth.BluetoothUuid,
5652+
? characteristicProperties: bluetooth.CharacteristicProperties,
5653+
type: "add" / "remove"
5654+
}
5655+
</pre>
5656+
5657+
<div algorithm="remote end steps for bluetooth.simulateCharacteristic">
5658+
5659+
Issue: TODO: Finish the algorithm of bluetooth.simulateCharacteristic.
5660+
5661+
</div>
5662+
5663+
<div class="example">
5664+
A [=local end=] could simulate adding a GATT characteristic with read, write, and notify properties
5665+
by sending the following message:
5666+
5667+
<pre highlight="json">
5668+
{
5669+
"method": "bluetooth.simulateCharacteristic",
5670+
"params": {
5671+
"context": "cxt-d03fdd81",
5672+
"address": "09:09:09:09:09:09",
5673+
"serviceUuid": "0000180d-0000-1000-8000-00805f9b34fb",
5674+
"characteristicUuid": "00002a21-0000-1000-8000-00805f9b34fb",
5675+
"characteristicProperties": {
5676+
"read": true,
5677+
"write": true,
5678+
"notify": true},
5679+
"type": "add"
5680+
}
5681+
}
5682+
</pre>
5683+
</div>
5684+
5685+
<div class="example">
5686+
A [=local end=] could simulate removing a GATT characteristic by sending the following message:
5687+
5688+
<pre highlight="json">
5689+
{
5690+
"method": "bluetooth.simulateCharacteristic",
5691+
"params": {
5692+
"context": "cxt-d03fdd81",
5693+
"address": "09:09:09:09:09:09",
5694+
"serviceUuid": "0000180d-0000-1000-8000-00805f9b34fb",
5695+
"characteristicUuid": "00002a21-0000-1000-8000-00805f9b34fb",
5696+
"type": "remove"
5697+
}
5698+
}
5699+
</pre>
5700+
</div>
5701+
5702+
#### The bluetooth.simulateCharacteristicResponse Command #### {#bluetooth-simulatecharacteristicresponse-command}
5703+
5704+
<pre highlight="cddl" class="cddl remote-cddl local-cddl">
5705+
bluetooth.SimulateCharacteristicResponse = (
5706+
method: "bluetooth.simulateCharacteristicResponse",
5707+
params: bluetooth.SimulateCharacteristicResponseParameters,
5708+
)
5709+
5710+
bluetooth.SimulateCharacteristicResponseParameters = {
5711+
context: text,
5712+
address: text,
5713+
serviceUuid: bluetooth.BluetoothUuid,
5714+
characteristicUuid: bluetooth.BluetoothUuid,
5715+
type: "read" / "write" / "subscribe-to-notifications" / "unsubscribe-from-notifications",
5716+
code: uint
5717+
}
5718+
</pre>
5719+
5720+
<div algorithm="remote end steps for bluetooth.simulateCharacteristicResponse">
5721+
5722+
Issue: TODO: Finish the algorithm of bluetooth.simulateCharacteristicResponse.
5723+
5724+
</div>
5725+
5726+
<div class="example">
5727+
A [=local end=] could simulate a response of success (error code `0x00` according to <a>Error Response</a>)
5728+
for a characteristic read operation by sending the following message:
5729+
5730+
<pre highlight="json">
5731+
{
5732+
"method": "bluetooth.simulateCharacteristicResponse",
5733+
"params": {
5734+
"context": "cxt-d03fdd81",
5735+
"address": "09:09:09:09:09:09",
5736+
"serviceUuid": "0000180d-0000-1000-8000-00805f9b34fb",
5737+
"characteristicUuid": "00002a21-0000-1000-8000-00805f9b34fb",
5738+
"type": "read",
5739+
"code": 0
5740+
}
5741+
}
5742+
</pre>
5743+
</div>
5744+
5745+
#### The bluetooth.SimulateDescriptor Command #### {#bluetooth-simulatedescriptor-command}
5746+
5747+
<pre highlight="cddl" class="cddl remote-cddl local-cddl">
5748+
bluetooth.SimulateDescriptor = (
5749+
method: "bluetooth.simulateDescriptor",
5750+
params: bluetooth.SimulateDescriptorParameters,
5751+
)
5752+
5753+
bluetooth.SimulateDescriptorParameters = {
5754+
context: text,
5755+
address: text,
5756+
serviceUuid: bluetooth.BluetoothUuid,
5757+
characteristicUuid: bluetooth.BluetoothUuid,
5758+
descriptorUuid: bluetooth.BluetoothUuid,
5759+
type: "add" / "remove"
5760+
}
5761+
</pre>
5762+
5763+
<div algorithm="remote end steps for bluetooth.simulateDescriptor">
5764+
5765+
Issue: TODO: Finish the algorithm of bluetooth.simulateDescriptor.
5766+
5767+
</div>
5768+
5769+
<div class="example">
5770+
A [=local end=] could simulate adding a GATT descriptor by sending the following message:
5771+
5772+
<pre highlight="json">
5773+
{
5774+
"method": "bluetooth.simulateDescriptor",
5775+
"params": {
5776+
"context": "cxt-d03fdd81",
5777+
"address": "09:09:09:09:09:09",
5778+
"serviceUuid": "0000180d-0000-1000-8000-00805f9b34fb",
5779+
"characteristicUuid": "00002a21-0000-1000-8000-00805f9b34fb",
5780+
"descriptorUuid": "00002901-0000-1000-8000-00805f9b34fb",
5781+
"type": "add"
5782+
}
5783+
}
5784+
</pre>
5785+
</div>
5786+
5787+
<div class="example">
5788+
A [=local end=] could simulate removing a GATT descriptor by sending the following message:
5789+
5790+
<pre highlight="json">
5791+
{
5792+
"method": "bluetooth.simulateDescriptor",
5793+
"params": {
5794+
"context": "cxt-d03fdd81",
5795+
"address": "09:09:09:09:09:09",
5796+
"serviceUuid": "0000180d-0000-1000-8000-00805f9b34fb",
5797+
"characteristicUuid": "00002a21-0000-1000-8000-00805f9b34fb",
5798+
"descriptorUuid": "00002901-0000-1000-8000-00805f9b34fb",
5799+
"type": "remove"
5800+
}
5801+
}
5802+
</pre>
5803+
</div>
5804+
5805+
#### The bluetooth.simulateDescriptorResponse Command #### {#bluetooth-simulatedescriptorresponse-command}
5806+
5807+
<pre highlight="cddl" class="cddl remote-cddl local-cddl">
5808+
bluetooth.SimulateDescriptorResponse = (
5809+
method: "bluetooth.simulateDescriptorResponse",
5810+
params: bluetooth.SimulateDescriptorResponseParameters,
5811+
)
5812+
5813+
bluetooth.SimulateDescriptorResponseParameters = {
5814+
context: text,
5815+
address: text,
5816+
serviceUuid: bluetooth.BluetoothUuid,
5817+
characteristicUuid: bluetooth.BluetoothUuid,
5818+
descriptorUuid: bluetooth.BluetoothUuid,
5819+
type: "read" / "write",
5820+
code: uint
5821+
}
5822+
</pre>
5823+
5824+
<div algorithm="remote end steps for bluetooth.simulateDescriptorResponse">
5825+
5826+
Issue: TODO: Finish the algorithm of bluetooth.simulateDescriptorResponse.
5827+
5828+
</div>
5829+
5830+
<div class="example">
5831+
A [=local end=] could simulate a response of success (error code `0x00` according to <a>Error Response</a>)
5832+
for a descriptor read operation by sending the following message:
5833+
5834+
<pre highlight="json">
5835+
{
5836+
"method": "bluetooth.simulateDescriptorResponse",
5837+
"params": {
5838+
"context": "cxt-d03fdd81",
5839+
"address": "09:09:09:09:09:09",
5840+
"serviceUuid": "0000180d-0000-1000-8000-00805f9b34fb",
5841+
"characteristicUuid": "00002a21-0000-1000-8000-00805f9b34fb",
5842+
"descriptorUuid": "00002901-0000-1000-8000-00805f9b34fb",
5843+
"type": "read",
5844+
"code": 0
5845+
}
5846+
}
5847+
</pre>
5848+
</div>
5849+
55705850
### Events ### {#bidi-events}
55715851

55725852
#### The bluetooth.requestDevicePromptUpdated Event #### {#bluetooth-requestdevicepromptupdated-event}
@@ -5628,6 +5908,55 @@ To <dfn>trigger a gatt connection attempted event</dfn> given a [=navigable=] |n
56285908

56295909
</div>
56305910

5911+
#### The bluetooth.characteristicEventGenerated Event #### {#bluetooth-characteristicEventGenerated-event}
5912+
5913+
<pre highlight="cddl" class="cddl local-cddl">
5914+
bluetooth.CharacteristicEventGenerated = (
5915+
method: "bluetooth.characteristicEventGenerated",
5916+
params: bluetooth.CharacteristicEventGeneratedParameters
5917+
)
5918+
5919+
bluetooth.CharacteristicEventGeneratedParameters = {
5920+
context: text,
5921+
address: text,
5922+
serviceUuid: bluetooth.BluetoothUuid,
5923+
characteristicUuid: bluetooth.BluetoothUuid,
5924+
type: "read" / "write-with-response" / "write-without-response" / "subscribe-to-notifications" / "unsubscribe-from-notifications",
5925+
? data: [ * uint ]
5926+
}
5927+
</pre>
5928+
5929+
<div algorithm="remote end event trigger for bluetooth.characteristicEventGenerated">
5930+
5931+
Issue: TODO: Finish the algorithm of bluetooth.characteristicEventGenerated.
5932+
5933+
</div>
5934+
5935+
#### The bluetooth.descriptorEventGenerated Event #### {#bluetooth-descriptoreventgenerated-event}
5936+
5937+
<pre highlight="cddl" class="cddl local-cddl">
5938+
bluetooth.DescriptorEventGenerated = (
5939+
method: "bluetooth.descriptorEventGenerated",
5940+
params: bluetooth.DescriptorEventGeneratedParameters
5941+
)
5942+
5943+
bluetooth.DescriptorEventGeneratedParameters = {
5944+
context: text,
5945+
address: text,
5946+
serviceUuid: bluetooth.BluetoothUuid,
5947+
characteristicUuid: bluetooth.BluetoothUuid,
5948+
descriptorUuid: bluetooth.BluetoothUuid,
5949+
type: "read" / "write",
5950+
? data: [ * uint ]
5951+
}
5952+
</pre>
5953+
5954+
<div algorithm="remote end event trigger for bluetooth.descriptorEventGenerated">
5955+
5956+
Issue: TODO: Finish the algorithm of bluetooth.descriptorEventGenerated.
5957+
5958+
</div>
5959+
56315960
# Terminology and Conventions # {#terminology}
56325961

56335962
This specification uses a few conventions and several terms from other

0 commit comments

Comments
 (0)