WebBLE icon indicating copy to clipboard operation
WebBLE copied to clipboard

writeValue(data) takes only the least significant byte of the data

Open r03ert0 opened this issue 3 years ago • 2 comments

In WebBLE when sending, for example, writeValue(2000), the received value is 208 (which is 2000&0xff). This is not the case with Chrome from a desktop computer, nor from Chrome from an android phone, using exactly the same code.

const data = new Int32Array([2000]);
myCharacteristic.writeValue(data);

r03ert0 avatar Jul 23 '22 16:07 r03ert0

@r03ert0 do you know if the integer bytes are sent in big-endian or little-endian order over the radio? Otherwise I will just assume big-endian since that is standard for networks.

daphtdazz avatar Sep 26 '23 10:09 daphtdazz