I'm trying to read data from the USB serial port. It is a thermometer scanner. The connection was successful but I don't know how to read the result data. I'm getting the result like the image below. How do I decode the data?
Here is my code.
const reader = port.readable.getReader();
// Listen to data coming from the serial device.
while (true) {
const { value, done } = await reader.read();
if (done) {
// Allow the serial port to be closed later.
reader.releaseLock();
break;
}
// value is a Uint8Array.
console.log(value);
}