You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • We've just been granted a BLE Manufacturer ID of 0x0590 by the Bluetooth SIG!

    1v94 of Espruino doesn't support encoding/decoding of manufacturer data, but I have added it to the latest builds.

    You can do:

    NRF.setAdvertising({},{
      manufacturer: 0x0590,
      manufacturerData: [ array of your data ]
    });
    

    and if you do NRF.findDevices(print) you'll get something like this for any Puck.js devices advertising manufacturer data:

    BluetoothDevice {
      "id": "aa:bb:cc:dd:ee:ff", // address
      "rssi": -89,               // signal strength
      "data": new Uint8Array([ ... ]).buffer, // ArrayBuffer of returned data
      "manufacturer" : 0x0590,
      "manufacturerData" : [ array of your data ],
      "name": "DeviceName"       // the advertised device name
     }
    

    While this isn't too different to services, it is a totally legitimate way of advertising custom data - since for 16 bit services you're supposed to only use the ones that are approved by the Bluetooth SIG. As long as you use 0590 for the Manufacturer ID you can now broadcast whatever you want :)

About

Avatar for Gordon @Gordon started