• On Android, why not just do something like:

    // not real code - just to give you an idea
    function onAdvertisingData(data) {
      if (data.address == known_device_address)
       doThingsWithData();
    }
    

    The code you have posted above will work, but maintaining a connection will drain the Puck's batteries at 10x the normal rate (you can use NRF.setLowPowerConnection() to fix that, but then it slows down the connection).

    In addition, Android phones can only maintain 7 active Bluetooth LE connections - if you're thinking of having multiple devices (and the user may have their own devices as well) you might find that you hit that limit

About

Avatar for Gordon @Gordon started