Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change BlutoothManufacturerData.data to base64-encoded tstr #633

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4898,9 +4898,17 @@ referenced.

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

<dl>
<dt><code>key</code></dt>
<dd>is the Company Identifier Code.</dd>

<dt><code>data</code></dt>
<dd>is the manufacturer data [=byte sequence=], base64 encoded.</dd>
</dl>

## The bluetooth module ## {#bluetooth-module}

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

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


Expand Down Expand Up @@ -5160,7 +5168,7 @@ The [=remote end steps=] with command parameters |params| are:
1. Let |simulatedBluetoothDevice| be a new [=simulated Bluetooth device=].
1. Set |simulatedBluetoothDevice|'s name to |params|[`"name"`].
1. Set |simulatedBluetoothDevice|'s address to |params|[`"address"`].
1. Set |simulatedBluetoothDevice|'s <a>manufacturer specific data</a> to |params|[`"manufacturerData"`].
1. Set |simulatedBluetoothDevice|'s <a>manufacturer specific data</a> to the output of [=forgiving-base64 decode=] performed on |params|[`"manufacturerData"`].
1. Set |simulatedBluetoothDevice|'s <a>service UUIDs</a> to |params|[`"knownServiceUuids"`].
1. Set |deviceMapping|[|deviceAddress|] to |simulatedBluetoothDevice|.
1. Return [=success=] with data `null`.
Expand All @@ -5177,7 +5185,7 @@ A [=local end=] could simulate a preconnected peripheral by sending the followin
"context": "cxt-d03fdd81",
"address": "09:09:09:09:09:09",
"name": "Some Device",
"manufacturerData": [ { key: 17, data: [0, 255, 1, 1, 127] } ],
"manufacturerData": [ { key: 17, data: "AP8BAX8=" } ],
"knownServiceUuids": [
"12345678-1234-5678-9abc-def123456789",
],
Expand Down Expand Up @@ -5249,7 +5257,7 @@ A [=local end=] could simulate a device advertisement by sending the following m
"scanRecord": {
"name": "Heart Rate",
"uuids": ["0000180d-0000-1000-8000-00805f9b34fb"],
"manufacturerData": [ { key: 17, data: [0, 255, 1, 1, 127] } ],
"manufacturerData": [ { key: 17, data: "AP8BAX8=" } ],
"appearance": 1,
"txPower": 1
}
Expand Down
Loading