Flipper/Applications/Custom (UL, RM, XFW)/RogueMaster/Scripts/uart_echo.js

11 lines
285 B
JavaScript
Raw Normal View History

2024-02-28 05:53:59 +00:00
let serial = require("serial");
serial.setup("usart", 230400);
while (1) {
let rx_data = serial.readBytes(1, 0);
if (rx_data !== undefined) {
serial.write(rx_data);
let data_view = Uint8Array(rx_data);
print("0x" + to_hex_string(data_view[0]));
}
}