You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • @billsalt thanks! Actually I think if you use one of the 'cutting edge' builds from http://www.espruino.com/binaries/travis/­master/ you'll find there'll be a servicedata field that you can check with device.servicedata["feaa"]. Sorry, I'd assumed it was in 1v94 but it seems it wasn't.

    However even as-is, something like this should work to check the device's UID:

    NRF.findDevices(function(devices) {
      devices.forEach(function(device) {
        var uid = (new Uint8Array(device.buffer)).slice(23,30).­map(x=>
    ((256+x).toString(16)).substr(-2)).join(­"");
        if (uid=="123456123456") ...
      });
    });
    

    @Frida thanks! As above, I think with new builds you might find the data is exposed a little more cleanly (so you don't have to go diving as deep into the data field). When you say 'Manufacturer Specific Data' do you mean the 0xFF AD type from https://www.bluetooth.com/specifications­/assigned-numbers/generic-access-profile­ ?

    If so, I should ensure Espruino parses that out (and can easily specify it) as well. Any thoughts as to how to specify it? Maybe just:

    NRF.setAdvertising({
      "" : [12,34,56]
    });
    

    or

    NRF.setAdvertising({
      "manufacturer" : [12,34,56]
    });
    
About

Avatar for Gordon @Gordon started