node-modbus-serial
node-modbus-serial copied to clipboard
Does We have any plan using Typescript to refactor this repo?
Hi I want check, does we have any plan using Typescript to refactor this repo?
There are indeed good people who help declare types, but in many cases they cannot be correctly recognized and quoted.
And especially one thing that is more difficult for me to understand is that We have ModbusRTU Slave function, but it cannot be easily referenced like TCP Server
in document
const ModbusRTU = require("modbus-serial");
but the example is mean ModbusTCP Server not ModbusRTU Slave
and module default export is ModbusTCP Server
if you want use modbusRTU Slave
const ModbusRTU = require("modbus-serial");
const vector = /* reference tcp server*/
const options = {
path: "/dev/ttyUSB0",
baudRate: 9600,
debug: false,
unitID: 1
}
const ModbusRTUSlave = new ModbusRTU.ServerSerial(vector, options);
I'm going to try to find some time to plan refactor this project using typescript Or does anyone want to do this?