jasongin / noble-uwp

Noble (Node.js Bluetooth LE) with Windows 10 UWP bindings
MIT License
83 stars 45 forks source link

allowDuplicates parameter for startScanning() is not implemented #19

Closed hoffmannjan closed 7 years ago

hoffmannjan commented 7 years ago

Hi, as I see in source code the option about allowDuplicates isn't interpreted in any way. Is this because of lack of setting this in Windows 10 Bluetooth API (can't find anything about this in documentation) or I should configure this in other place?

I'm using this to detect disconnection of BT device, in noble this way works well but transfer to -uwp causes this kind of problems.

jasongin commented 7 years ago

Right, the Windows 10 Bluetooth API doesn't provide any way to ignore duplicate scan results. However, I think this could be implemented in noble-uwp, in the _onAdvertisementWatcherReceived() callback, by keeping track of what addresses have been scanned so far and using that list to avoid emitting duplicate "discover" events.

You're welcome to submit a PR! Otherwise I will try to get to this eventually.

jasongin commented 7 years ago

This is implemented now, in version 0.5.0. Can you confirm that it works how you expect?

hoffmannjan commented 7 years ago

Yes, can confirm! Thanks!