Skip to content

Commit f3b3187

Browse files
authored
Change BlutoothManufacturerData.data to base64-encoded tstr (#633)
* Change BlutoothManufacturerData.data to be tstr. * Update spec to refer to [=forgiving-base64 encode=]. * Update spec for review feedback.
1 parent 5fca8d9 commit f3b3187

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

index.bs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4898,9 +4898,17 @@ referenced.
48984898

48994899
<pre class="cddl remote-cddl local-cddl">
49004900
bluetooth.BluetoothServiceUuid = text;
4901-
bluetooth.BluetoothManufacturerData = { key: uint, data: bstr };
4901+
bluetooth.BluetoothManufacturerData = { key: uint, data: tstr };
49024902
</pre>
49034903

4904+
<dl>
4905+
<dt><code>key</code></dt>
4906+
<dd>is the Company Identifier Code.</dd>
4907+
4908+
<dt><code>data</code></dt>
4909+
<dd>is the manufacturer data [=byte sequence=], base64 encoded.</dd>
4910+
</dl>
4911+
49044912
## The bluetooth module ## {#bluetooth-module}
49054913

49064914
The bluetooth module contains commands for managing the remote end Bluetooth behavior.
@@ -5009,7 +5017,7 @@ A `bluetooth.ScanRecord` represents data of the advertisement packet sent by a [
50095017
<dd>is an <a>Appearance</a>, one of the values defined by the {{gap.appearance}} characteristic.</dd>
50105018

50115019
<dt><code>manufacturerData</code></dt>
5012-
<dd>list of <code>bluetooth.BluetoothManufacturerData</code> that maps {{unsigned short}} Company Identifier Codes to [=lists=] of {{octet}}s.</dd>
5020+
<dd>list of <code>BluetoothManufacturerData</code> that maps {{unsigned short}} Company Identifier Codes to base64 encoded manufacturer data [=byte sequences=].</dd>
50135021
</dl>
50145022

50155023

@@ -5160,7 +5168,7 @@ The [=remote end steps=] with command parameters |params| are:
51605168
1. Let |simulatedBluetoothDevice| be a new [=simulated Bluetooth device=].
51615169
1. Set |simulatedBluetoothDevice|'s name to |params|[`"name"`].
51625170
1. Set |simulatedBluetoothDevice|'s address to |params|[`"address"`].
5163-
1. Set |simulatedBluetoothDevice|'s <a>manufacturer specific data</a> to |params|[`"manufacturerData"`].
5171+
1. Set |simulatedBluetoothDevice|'s <a>manufacturer specific data</a> to the output of [=forgiving-base64 decode=] performed on |params|[`"manufacturerData"`].
51645172
1. Set |simulatedBluetoothDevice|'s <a>service UUIDs</a> to |params|[`"knownServiceUuids"`].
51655173
1. Set |deviceMapping|[|deviceAddress|] to |simulatedBluetoothDevice|.
51665174
1. Return [=success=] with data `null`.
@@ -5177,7 +5185,7 @@ A [=local end=] could simulate a preconnected peripheral by sending the followin
51775185
"context": "cxt-d03fdd81",
51785186
"address": "09:09:09:09:09:09",
51795187
"name": "Some Device",
5180-
"manufacturerData": [ { key: 17, data: [0, 255, 1, 1, 127] } ],
5188+
"manufacturerData": [ { key: 17, data: "AP8BAX8=" } ],
51815189
"knownServiceUuids": [
51825190
"12345678-1234-5678-9abc-def123456789",
51835191
],
@@ -5249,7 +5257,7 @@ A [=local end=] could simulate a device advertisement by sending the following m
52495257
"scanRecord": {
52505258
"name": "Heart Rate",
52515259
"uuids": ["0000180d-0000-1000-8000-00805f9b34fb"],
5252-
"manufacturerData": [ { key: 17, data: [0, 255, 1, 1, 127] } ],
5260+
"manufacturerData": [ { key: 17, data: "AP8BAX8=" } ],
52535261
"appearance": 1,
52545262
"txPower": 1
52555263
}

0 commit comments

Comments
 (0)