• @fanoush requestDevice works with the exact same filter. It's basically doing exactly what you do with setScan, but inside Espruino - so if anything it should be marginally faster.

  • so if anything it should be marginally faster.

    the total time may be faster but with setScan you get the packet data sooner? As I understand it the requestDevice sets up a callback to collect data, starts it, collects data, stops it and resolve promise and call your code. setScan first calls your code with the data as the packet arrives and then you do the rest. And with setScan you can get more packets in one scan to do some average on the timestamps and stop when you are happy with the result.

    Of course it doesn't matter with precision to seconds but @malaire tried to do more

  • ... requestDevice vs setScan ...
    Of course it doesn't matter with precision to seconds but @malaire tried to do more

    I don't think that matters as there is even worse inaccuracy. I've now realized other 0-20 ms inaccuracy in BLE advertisements I overlooked before: Each advertisement is send on 3 channels with up to 10 ms between, and receiver doesn't know which one they received.

    I've been testing to make Bangle.js 2 determine its clock drift and accuracy from advertisements just doesn't seem to be enough to do that (quickly enough).

    So next I'm going to test connecting watch to current time device and sending current time via that connection with 1 ms accuracy (custom format).

About

Avatar for fanoush @fanoush started