• Hi,

    I wonder if it is possible to cut the timeout short (right now it seems that the code scans for the full timeout before handing back scan results) and return a matching device immediately?

    If you try a 'cutting edge' build then that's something I've fixed (and will be in Espruino 1v100) - it'll be significantly faster.

    However...

    is it preferable to cache the sensor's address and do a direct connect to that later on?

    Nothing stops you from caching the result of NRF.requestDevice and then calling device.gatt.connect() when you want to connect. As you say, you could then just add a .catch handler to the connect promise, and if it fails you run NRF.requestDevice again.

About

Avatar for Gordon @Gordon started