Skip to content

Sending a buffer's value from node js side #17

Description

@WijdanMTak

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions