googlearchive / platinum-bluetooth

A set of Polymer elements to discover and communicate with nearby Bluetooth devices
https://elements.polymer-project.org/elements/platinum-bluetooth
Apache License 2.0
22 stars 13 forks source link

add more filter options #10

Closed rbellens closed 8 years ago

rbellens commented 8 years ago
beaufortfrancois commented 8 years ago

I was waiting for this to land in Chrome OS Dev Channel but I'm glad you did it first. Will review this shortly if that's ok with you!

Thank you!

rbellens commented 8 years ago

Ok, thanks.

I am using the chrome app polyfill with mobile chrome apps (see also WebBluetoothCG/chrome-app-polyfill#6).

beaufortfrancois commented 8 years ago

May I ask why mobile chrome apps instead of a regular mobile wen app?

rbellens commented 8 years ago

because we need bluetooth and possibly other native features in the future, which we can access through cordova plugins

beaufortfrancois commented 8 years ago

Oh it does make sense then ;)

beaufortfrancois commented 8 years ago

@rbellens I've added some minor comments to your PR. Thank you!

rbellens commented 8 years ago

@beaufortfrancois I made the changes according to your comments

beaufortfrancois commented 8 years ago

Thank you @rbellens and sorry for the late reply ;)

After giving it more thoughts, I think we may want to remove the options parameters and simply use the new name-filter and name-prefix-filter attributes you've already added when requesting a device.

It would make the code simpler and avoid two ways of requesting a device. What do you think?

rbellens commented 8 years ago

The options parameter gives more flexibility. For example to add an optionalServices parameter or possible other RequestDeviceOptions that might be added to the standard. For my project, I wanted to be able to connect to a device without the user prompt, for which I added a silent parameter (see appsup/chrome-app-polyfill@4e922699b28ba8090e716e9333d7f30be1de5366). I would understand however, if you prefer sticking to the standard and keeping it simple.

beaufortfrancois commented 8 years ago

I've eventually decided to keep it simple for the next version of <platinum-bluetooth> elements: https://github.com/PolymerElements/platinum-bluetooth/commit/6be9e7aab3bf55b4199e0772c84ea5b5a4ca096b