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

BluetoothLEScanFilter's manufacturerData and serviceData are not arrays #636

Open
jeroen1602 opened this issue Nov 15, 2024 · 2 comments
Open

Comments

@jeroen1602
Copy link

The BluetoothLEScanFilters dictionary is created from an BluetoothLEScanFilterInit but its manufacturerData and serviceData fields aren't an array.

web-bluetooth/scanning.bs

Lines 374 to 382 in f3b3187

[Exposed=Window, SecureContext]
interface BluetoothLEScanFilter {
constructor(optional BluetoothLEScanFilterInit init = {});
readonly attribute DOMString? name;
readonly attribute DOMString? namePrefix;
readonly attribute FrozenArray<UUID> services;
readonly attribute BluetoothManufacturerDataFilter manufacturerData;
readonly attribute BluetoothServiceDataFilter serviceData;
};

In the BluetoothLEScanFilterInit dictionary that is used in the constructor they are referenced as being a sequence so when converting to an BluetoothLEScanFilters what needs to happen to the extra items in the array?

web-bluetooth/index.bs

Lines 529 to 535 in f3b3187

dictionary BluetoothLEScanFilterInit {
sequence<BluetoothServiceUUID> services;
DOMString name;
DOMString namePrefix;
sequence<BluetoothManufacturerDataFilterInit> manufacturerData;
sequence<BluetoothServiceDataFilterInit> serviceData;
};

The docs seem to assume that the fields are singular and not an array.

web-bluetooth/scanning.bs

Lines 419 to 426 in f3b3187

<li>
Initialize <code>this.{{BluetoothLEScanFilter/manufacturerData}}</code> as
<code>new BluetoothManufacturerDataFilter(|init|.{{BluetoothLEScanFilterInit/manufacturerData}})</code>.
</li>
<li>
Initialize <code>this.{{BluetoothLEScanFilter/serviceData}}</code> as
<code>new BluetoothServiceDataFilter(|init|.{{BluetoothLEScanFilterInit/serviceData}})</code>.
</li>

@chengweih001
Copy link
Contributor

Thanks for reporting this. like what you pointed out in the Chromium implementation,I suspect web-bluetooth/scanning.bs should just use BluetoothLEScanFilterInit from web-bluetooth/index.bs. We will look into this and update this when we are actively working on shipping Web Bluetooth Scanning.

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

No branches or pull requests

2 participants