- From: milesfrain via GitHub <sysbot+gh@w3.org>
- Date: Mon, 14 Dec 2020 05:45:21 +0000
- To: public-web-bluetooth-log@w3.org
milesfrain has just created a new issue for https://github.com/WebBluetoothCG/web-bluetooth: == Service and Characteric aliases not obvious (or missing) == _Let me know if https://crbug.com is a better place to post this issue._ When attempting to use a human-readable alias for a service or characteristic, it's not obvious what strings are acceptable. You can often guess the correct name, but not always. For example: - `0x180D` "Heart Rate" is aliased as `heart_rate` (as expected) - `0x180F` "Battery" is aliased as `battery_service` (it seems like this should just be `battery` instead to follow the convention of the other service aliases that all omit the `_service` suffix) - `0x183B` "Binary Sensor" has no alias (expecting `binary_sensor`) Error messages point to the spec (https://btprodspecificationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf) ``` TypeError: Failed to execute 'requestDevice' on 'Bluetooth': Invalid Service name: 'battery'. It must be a valid UUID alias (e.g. 0x1234), UUID (lowercase hex characters e.g. '00001234-0000-1000-8000-00805f9b34fb'), or recognized standard name from https://www.bluetooth.com/specifications/gatt/services e.g. 'alert_notification'. ``` but it would likely be more helpful for developers if the error also pointed to the actual alias mapping https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/bluetooth/bluetooth_uuid.cc Proposing the following changes: - Add any missing aliases for services and characteristics (e.g. `binary_sensor`, `electric_current`). - (note to self) - Also add to [tests](https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/gatt_aliases.py). - Add a redundant "Battery" service alias as `battery`. - Perhaps add a deprecation warning for the existing `battery_service` - Modify the [UUID error message](https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/bluetooth/bluetooth_uuid.cc;l=367;drc=7eae654e266637310685ce36ec714269ab8d16a8) to also point to the aliases defined in [bluetooth_uuid.cc](https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/bluetooth/bluetooth_uuid.cc). I'm happy to contribute these changes, but wanted to get the green light before diving into building Chromium locally. Please view or discuss this issue at https://github.com/WebBluetoothCG/web-bluetooth/issues/535 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 14 December 2020 05:45:23 UTC