Closed peitschie closed 1 year ago
Looks like you're cutting off the 'scan' function, which will force all consumers of that to switch. Do you normally want a deprecation period to ease people over? I.e., change 'scan' to internally call 'startScanWithOptions'.
Also, will this be available in the 'slim' variant?
BTW, here is my code to replace the 'scan' call. I believe I am seeing the same scan performance with it as before the API change you indicated!
let options = { scanMode: 'lowLatency', duration: timeout }; ble.startScanWithOptions(services, options, success, failure);
where timeout is a number in seconds.
Bothscan
and startScan
remain fully supported. If you pay close attention to ble.js, you'll see that I've routed these to the equivalent scanWithOptions
call instead, as all the native paths trace through the same code.
Both
scan
andstartScan
remain fully supported. If you pay close attention to ble.js, you'll see that I've routed these to the equivalentscanWithOptions
call instead, as all the native paths trace through the same code.
Ah, that's what I was expecting! Sorry. But is the @slim variant included in this PR? I'm hoping so!
Slim runs on a different branch. I'll publish both at the same time once I merge this 🙂
This allows different scan modes to be easily selected while still allowing the scan to be time-limited