I'm receiving a value in a buffer(2) and I used the readInt16BE() to read It as integer.
for example:
console.log(buf); //Buffer<00 02>
console.log(buf.readInt16BE()); // 2
but when I'm trying to send it to react-native side the received value will be:
alert("from node:"+msg);// from node:0
I've tried many convert ways, Like: "toString(),ParseInt(),and also Number()", but it doesn't work.
is the problem from the way to convert the buffer or the technique in sending it?