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

Conversation

alexnj
Copy link
Contributor

@alexnj alexnj commented Oct 7, 2024

This PR is changing BluetoothManufacturerData.data from being a bstr and defining it as a base64 encoded text representation as a tstr. Since BiDi is a protocol over JSON, this seems the correct way to represent bytes per RFC 8610.


Preview | Diff

@alexnj alexnj changed the title Change BlutoothManufacturerData.data to be tstr Change BlutoothManufacturerData.data to base64-encoded tstr Oct 7, 2024
@reillyeon
Copy link
Contributor

It seems weird to push how to encode binary data into individual specs. Can we get some guidance from WebDriver BiDi folks on the correct type for this type of argument?

@alexnj
Copy link
Contributor Author

alexnj commented Oct 7, 2024

BiDi spec has one example that encodes binary data, and that seems to refer to forgiving-base64 encode. Perhaps it makes sense for BiDi to (re-)export a definition that allows other specs to link to the correct way to encode binary data.

/cc @OrKoN

@OrKoN
Copy link
Contributor

OrKoN commented Oct 8, 2024

Yes, using base64 and a text string is currently recommended for binary data if the size is relatively small and can be inline in a protocol message.

@OrKoN
Copy link
Contributor

OrKoN commented Oct 8, 2024

To clarify, I think referencing the base64 algorithm in the infra spec is sufficient as we do not have a central place to handle binary data in the WebDriver BiDi spec. Also from the client and implementation perspective the format is command/event-specific and we do not expect to change/specify it centrally. If we have a better way in the future, we can re-visit but so far I know know of plans to have a better way to deal with large binary files but I do not think a solution for that would be applicable here since CDP also implements this data as base64-encoded strings.

index.bs Outdated Show resolved Hide resolved
@reillyeon reillyeon merged commit f3b3187 into WebBluetoothCG:main Oct 9, 2024
2 checks passed
github-actions bot added a commit that referenced this pull request Oct 9, 2024
SHA: f3b3187
Reason: push, by reillyeon

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Oct 9, 2024
SHA: f3b3187
Reason: push, by reillyeon

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Oct 9, 2024
SHA: f3b3187
Reason: push, by reillyeon

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Oct 9, 2024
SHA: f3b3187
Reason: push, by reillyeon

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants