daphtdazz / WebBLE

iOS WebBluetooth Polyfill
Other
113 stars 39 forks source link

characteristic.writeValue not working #50

Closed ankitnetsol closed 2 years ago

ankitnetsol commented 2 years ago

Hello,

We are using this browser to test BLE in IOS devices but when characteristic.writeValue comes into a role at that time it is stuck on this statement and does not work.

Anyone, Can you give me a solution.

Thanks.

daphtdazz commented 2 years ago

Hi, could you provide some example code and what you are expecting to happen and what does happen?

r03ert0 commented 2 years ago

I can provide an example:

I'm sending writeValue(2000), but the BLE device receives 208 (which is 2000 & 0xff). Using the same code in Chrome from a computer, or in Chrome from an android phone, the value received is 2000.

Here's the code:

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