sp-react-native-mqtt icon indicating copy to clipboard operation
sp-react-native-mqtt copied to clipboard

How to send message is byte array

Open nguyenvanquan7826 opened this issue 4 years ago • 2 comments

Hi, I want to send message, which is a byte array. Please help me.

nguyenvanquan7826 avatar Feb 19 '21 10:02 nguyenvanquan7826

The easiest way is using text-encoding library to encode the byte array const string = new TextDecoder(encoding).decode(uint8array);

The other way is modify this library to accept byte array as payload

cscovino avatar Aug 19 '21 23:08 cscovino

What about receiving byte array? Currently a null string is not received. Making impossible to work with buffers

EduardoArtioli avatar Oct 25 '22 22:10 EduardoArtioli