• If you send binary data to Bangle.js over the UART connection, you can just read that out with Bluetooth.on('data', function(d) { too.

    The event returns a string, but it's easy enough to use E.toUint8Array: http://www.espruino.com/Reference#l_E_to­Uint8Array

    Bluetooth.on('data', function(d) { 
      const view = new DataView(E.toUint8Array(d).buffer);
      ... view.getInt16(0)
    });
    
About

Avatar for Gordon @Gordon started