Skip to content

Commit 954b7a9

Browse files
authored
Merge branch 'main' into main
2 parents c5a27e1 + 4cc1268 commit 954b7a9

1 file changed

Lines changed: 282 additions & 8 deletions

File tree

index.bs

Lines changed: 282 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5025,8 +5025,18 @@ referenced.
50255025
## Definitions ## {#bluetooth-bidi-definitions}
50265026

50275027
<pre class="cddl remote-cddl local-cddl">
5028-
bluetooth.BluetoothServiceUuid = text;
5028+
bluetooth.BluetoothUuid = text;
50295029
bluetooth.BluetoothManufacturerData = { key: uint, data: tstr };
5030+
bluetooth.CharacteristicProperties = {
5031+
? broadcast: bool,
5032+
? read: bool,
5033+
? writeWithoutResponse: bool,
5034+
? write: bool,
5035+
? notify: bool,
5036+
? indicate: bool,
5037+
? authenticatedSignedWrites: bool,
5038+
? extendedProperties: bool
5039+
}
50305040
</pre>
50315041

50325042
<dl>
@@ -5126,7 +5136,7 @@ To <dfn>serialize prompt devices</dfn> given [=device prompt=] |prompt|:
51265136

51275137
bluetooth.ScanRecord = {
51285138
? name: text,
5129-
? uuids: [ * bluetooth.BluetoothServiceUuid ],
5139+
? uuids: [ * bluetooth.BluetoothUuid ],
51305140
? appearance: number,
51315141
? manufacturerData: [ * bluetooth.BluetoothManufacturerData ],
51325142
}
@@ -5174,6 +5184,10 @@ BluetoothCommand = (
51745184
bluetooth.SimulateGattConnectionResponse //
51755185
bluetooth.SimulateGattDisconnection //
51765186
bluetooth.SimulateService //
5187+
bluetooth.SimulateCharacteristic //
5188+
bluetooth.simulateCharacteristicResponse //
5189+
bluetooth.SimulateDescriptor //
5190+
bluetooth.simulateDescriptorResponse //
51775191
)
51785192
</pre>
51795193

@@ -5352,7 +5366,7 @@ bluetooth.SimulatePreconnectedPeripheralParameters = {
53525366
address: text,
53535367
name: text,
53545368
manufacturerData: [ * bluetooth.BluetoothManufacturerData ],
5355-
knownServiceUuids: [ * bluetooth.BluetoothServiceUuid ]
5369+
knownServiceUuids: [ * bluetooth.BluetoothUuid ]
53565370
}
53575371
</pre>
53585372

@@ -5580,16 +5594,15 @@ A [=local end=] could simulate device GATT disconnection by sending the followin
55805594
<pre highlight="cddl" class="cddl remote-cddl local-cddl">
55815595
bluetooth.SimulateService = (
55825596
method: "bluetooth.simulateService",
5583-
params: bluetooth.simulateServiceParameters,
5597+
params: bluetooth.SimulateServiceParameters,
55845598
)
55855599

5586-
bluetooth.simulateServiceParameters = {
5600+
bluetooth.SimulateServiceParameters = {
55875601
context: text,
55885602
address: text,
5589-
uuid: bluetooth.BluetoothServiceUuid,
5603+
uuid: bluetooth.BluetoothUuid,
55905604
type: "add" / "remove",
55915605
}
5592-
55935606
</pre>
55945607

55955608
<div algorithm="remote end steps for bluetooth.simulateService">
@@ -5652,13 +5665,225 @@ A [=local end=] could simulate removing a GATT service by sending the following
56525665
"params": {
56535666
"context": "cxt-d03fdd81",
56545667
"address": "09:09:09:09:09:09",
5655-
"uuid": "12345678-1234-5678-9abc-def123456789",
5668+
"uuid": "0000180d-0000-1000-8000-00805f9b34fb",
56565669
"type": "remove"
56575670
}
56585671
}
56595672
</pre>
56605673
</div>
56615674

5675+
#### The bluetooth.simulateCharacteristic Command #### {#bluetooth-simulatecharacteristic-command}
5676+
5677+
<pre highlight="cddl" class="cddl remote-cddl local-cddl">
5678+
bluetooth.SimulateCharacteristic = (
5679+
method: "bluetooth.simulateCharacteristic",
5680+
params: bluetooth.SimulateCharacteristicParameters,
5681+
)
5682+
5683+
bluetooth.SimulateCharacteristicParameters = {
5684+
context: text,
5685+
address: text,
5686+
serviceUuid: bluetooth.BluetoothUuid,
5687+
characteristicUuid: bluetooth.BluetoothUuid,
5688+
? characteristicProperties: bluetooth.CharacteristicProperties,
5689+
type: "add" / "remove"
5690+
}
5691+
</pre>
5692+
5693+
<div algorithm="remote end steps for bluetooth.simulateCharacteristic">
5694+
5695+
Issue: TODO: Finish the algorithm of bluetooth.simulateCharacteristic.
5696+
5697+
</div>
5698+
5699+
<div class="example">
5700+
A [=local end=] could simulate adding a GATT characteristic with read, write, and notify properties
5701+
by sending the following message:
5702+
5703+
<pre highlight="json">
5704+
{
5705+
"method": "bluetooth.simulateCharacteristic",
5706+
"params": {
5707+
"context": "cxt-d03fdd81",
5708+
"address": "09:09:09:09:09:09",
5709+
"serviceUuid": "0000180d-0000-1000-8000-00805f9b34fb",
5710+
"characteristicUuid": "00002a21-0000-1000-8000-00805f9b34fb",
5711+
"characteristicProperties": {
5712+
"read": true,
5713+
"write": true,
5714+
"notify": true
5715+
},
5716+
"type": "add"
5717+
}
5718+
}
5719+
</pre>
5720+
</div>
5721+
5722+
<div class="example">
5723+
A [=local end=] could simulate removing a GATT characteristic by sending the following message:
5724+
5725+
<pre highlight="json">
5726+
{
5727+
"method": "bluetooth.simulateCharacteristic",
5728+
"params": {
5729+
"context": "cxt-d03fdd81",
5730+
"address": "09:09:09:09:09:09",
5731+
"serviceUuid": "0000180d-0000-1000-8000-00805f9b34fb",
5732+
"characteristicUuid": "00002a21-0000-1000-8000-00805f9b34fb",
5733+
"type": "remove"
5734+
}
5735+
}
5736+
</pre>
5737+
</div>
5738+
5739+
#### The bluetooth.simulateCharacteristicResponse Command #### {#bluetooth-simulatecharacteristicresponse-command}
5740+
5741+
<pre highlight="cddl" class="cddl remote-cddl local-cddl">
5742+
bluetooth.SimulateCharacteristicResponse = (
5743+
method: "bluetooth.simulateCharacteristicResponse",
5744+
params: bluetooth.SimulateCharacteristicResponseParameters,
5745+
)
5746+
5747+
bluetooth.SimulateCharacteristicResponseParameters = {
5748+
context: text,
5749+
address: text,
5750+
serviceUuid: bluetooth.BluetoothUuid,
5751+
characteristicUuid: bluetooth.BluetoothUuid,
5752+
type: "read" / "write" / "subscribe-to-notifications" / "unsubscribe-from-notifications",
5753+
code: uint
5754+
}
5755+
</pre>
5756+
5757+
<div algorithm="remote end steps for bluetooth.simulateCharacteristicResponse">
5758+
5759+
Issue: TODO: Finish the algorithm of bluetooth.simulateCharacteristicResponse.
5760+
5761+
</div>
5762+
5763+
<div class="example">
5764+
A [=local end=] could simulate a response of success (error code `0x00` according to <a>Error Response</a>)
5765+
for a characteristic read operation by sending the following message:
5766+
5767+
<pre highlight="json">
5768+
{
5769+
"method": "bluetooth.simulateCharacteristicResponse",
5770+
"params": {
5771+
"context": "cxt-d03fdd81",
5772+
"address": "09:09:09:09:09:09",
5773+
"serviceUuid": "0000180d-0000-1000-8000-00805f9b34fb",
5774+
"characteristicUuid": "00002a21-0000-1000-8000-00805f9b34fb",
5775+
"type": "read",
5776+
"code": 0
5777+
}
5778+
}
5779+
</pre>
5780+
</div>
5781+
5782+
#### The bluetooth.simulateDescriptor Command #### {#bluetooth-simulatedescriptor-command}
5783+
5784+
<pre highlight="cddl" class="cddl remote-cddl local-cddl">
5785+
bluetooth.SimulateDescriptor = (
5786+
method: "bluetooth.simulateDescriptor",
5787+
params: bluetooth.SimulateDescriptorParameters,
5788+
)
5789+
5790+
bluetooth.SimulateDescriptorParameters = {
5791+
context: text,
5792+
address: text,
5793+
serviceUuid: bluetooth.BluetoothUuid,
5794+
characteristicUuid: bluetooth.BluetoothUuid,
5795+
descriptorUuid: bluetooth.BluetoothUuid,
5796+
type: "add" / "remove"
5797+
}
5798+
</pre>
5799+
5800+
<div algorithm="remote end steps for bluetooth.simulateDescriptor">
5801+
5802+
Issue: TODO: Finish the algorithm of bluetooth.simulateDescriptor.
5803+
5804+
</div>
5805+
5806+
<div class="example">
5807+
A [=local end=] could simulate adding a GATT descriptor by sending the following message:
5808+
5809+
<pre highlight="json">
5810+
{
5811+
"method": "bluetooth.simulateDescriptor",
5812+
"params": {
5813+
"context": "cxt-d03fdd81",
5814+
"address": "09:09:09:09:09:09",
5815+
"serviceUuid": "0000180d-0000-1000-8000-00805f9b34fb",
5816+
"characteristicUuid": "00002a21-0000-1000-8000-00805f9b34fb",
5817+
"descriptorUuid": "00002901-0000-1000-8000-00805f9b34fb",
5818+
"type": "add"
5819+
}
5820+
}
5821+
</pre>
5822+
</div>
5823+
5824+
<div class="example">
5825+
A [=local end=] could simulate removing a GATT descriptor by sending the following message:
5826+
5827+
<pre highlight="json">
5828+
{
5829+
"method": "bluetooth.simulateDescriptor",
5830+
"params": {
5831+
"context": "cxt-d03fdd81",
5832+
"address": "09:09:09:09:09:09",
5833+
"serviceUuid": "0000180d-0000-1000-8000-00805f9b34fb",
5834+
"characteristicUuid": "00002a21-0000-1000-8000-00805f9b34fb",
5835+
"descriptorUuid": "00002901-0000-1000-8000-00805f9b34fb",
5836+
"type": "remove"
5837+
}
5838+
}
5839+
</pre>
5840+
</div>
5841+
5842+
#### The bluetooth.simulateDescriptorResponse Command #### {#bluetooth-simulatedescriptorresponse-command}
5843+
5844+
<pre highlight="cddl" class="cddl remote-cddl local-cddl">
5845+
bluetooth.SimulateDescriptorResponse = (
5846+
method: "bluetooth.simulateDescriptorResponse",
5847+
params: bluetooth.SimulateDescriptorResponseParameters,
5848+
)
5849+
5850+
bluetooth.SimulateDescriptorResponseParameters = {
5851+
context: text,
5852+
address: text,
5853+
serviceUuid: bluetooth.BluetoothUuid,
5854+
characteristicUuid: bluetooth.BluetoothUuid,
5855+
descriptorUuid: bluetooth.BluetoothUuid,
5856+
type: "read" / "write",
5857+
code: uint
5858+
}
5859+
</pre>
5860+
5861+
<div algorithm="remote end steps for bluetooth.simulateDescriptorResponse">
5862+
5863+
Issue: TODO: Finish the algorithm of bluetooth.simulateDescriptorResponse.
5864+
5865+
</div>
5866+
5867+
<div class="example">
5868+
A [=local end=] could simulate a response of success (error code `0x00` according to <a>Error Response</a>)
5869+
for a descriptor read operation by sending the following message:
5870+
5871+
<pre highlight="json">
5872+
{
5873+
"method": "bluetooth.simulateDescriptorResponse",
5874+
"params": {
5875+
"context": "cxt-d03fdd81",
5876+
"address": "09:09:09:09:09:09",
5877+
"serviceUuid": "0000180d-0000-1000-8000-00805f9b34fb",
5878+
"characteristicUuid": "00002a21-0000-1000-8000-00805f9b34fb",
5879+
"descriptorUuid": "00002901-0000-1000-8000-00805f9b34fb",
5880+
"type": "read",
5881+
"code": 0
5882+
}
5883+
}
5884+
</pre>
5885+
</div>
5886+
56625887
### Events ### {#bidi-events}
56635888

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

57215946
</div>
57225947

5948+
#### The bluetooth.characteristicEventGenerated Event #### {#bluetooth-characteristiceventgenerated-event}
5949+
5950+
<pre highlight="cddl" class="cddl local-cddl">
5951+
bluetooth.CharacteristicEventGenerated = (
5952+
method: "bluetooth.characteristicEventGenerated",
5953+
params: bluetooth.CharacteristicEventGeneratedParameters
5954+
)
5955+
5956+
bluetooth.CharacteristicEventGeneratedParameters = {
5957+
context: text,
5958+
address: text,
5959+
serviceUuid: bluetooth.BluetoothUuid,
5960+
characteristicUuid: bluetooth.BluetoothUuid,
5961+
type: "read" / "write-with-response" / "write-without-response" / "subscribe-to-notifications" / "unsubscribe-from-notifications",
5962+
? data: [ * uint ]
5963+
}
5964+
</pre>
5965+
5966+
<div algorithm="remote end event trigger for bluetooth.characteristicEventGenerated">
5967+
5968+
Issue: TODO: Finish the algorithm of bluetooth.characteristicEventGenerated.
5969+
5970+
</div>
5971+
5972+
#### The bluetooth.descriptorEventGenerated Event #### {#bluetooth-descriptoreventgenerated-event}
5973+
5974+
<pre highlight="cddl" class="cddl local-cddl">
5975+
bluetooth.DescriptorEventGenerated = (
5976+
method: "bluetooth.descriptorEventGenerated",
5977+
params: bluetooth.DescriptorEventGeneratedParameters
5978+
)
5979+
5980+
bluetooth.DescriptorEventGeneratedParameters = {
5981+
context: text,
5982+
address: text,
5983+
serviceUuid: bluetooth.BluetoothUuid,
5984+
characteristicUuid: bluetooth.BluetoothUuid,
5985+
descriptorUuid: bluetooth.BluetoothUuid,
5986+
type: "read" / "write",
5987+
? data: [ * uint ]
5988+
}
5989+
</pre>
5990+
5991+
<div algorithm="remote end event trigger for bluetooth.descriptorEventGenerated">
5992+
5993+
Issue: TODO: Finish the algorithm of bluetooth.descriptorEventGenerated.
5994+
5995+
</div>
5996+
57235997
# Terminology and Conventions # {#terminology}
57245998

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

0 commit comments

Comments
 (0)