You are reading a single comment by @dave_irvine and its replies. Click here to read the full conversation.
  • Simplified version is:

    var devices = {};
    
    NRF.setScan(function(device) {
        if (device.name && device.name.indexOf(‘Puck.js’) >= 0) {
          const data = device.data.toString().substr(-1);
    
          if (!devices[device.name]) {
            devices[device.name] = {
              name: device.name,
              rssi: device.rssi,
              data: data,
            };
          }
          
          const oldDevice = devices[device.name];
          
          if (device.rssi !== oldDevice.rssi) {
            devices[device.name].rssi = device.rssi;
            
            Bluetooth.println(JSON.stringify(device)­);
          }
        }
      });
    

    Is that receiving advertising packets from a single Puck or having many advertising at the same time?

About

Avatar for dave_irvine @dave_irvine started