// config.setProperty("port", "/dev/ttyUSB10");
// config.setProperty("baudrate",String.valueOf(19200));
// config.setProperty("data-bits",String.valueOf(SerialPort.DATABITS_8));
// config.setProperty("parity", String.valueOf(SerialPort.PARITY_EVEN));
// config.setProperty("stop-bits", String.valueOf(SerialPort.STOPBITS_1));
ModbusMaster master = ModbusMasterGateway.getInstance();
try {
master.init();
NumericLocator bl = new NumericLocator(1, RegisterRange.HOLDING_REGISTER, 266, DataType.TWO_BYTE_INT_UNSIGNED);
System.out.println(master.getValue(bl));
} catch (ModbusTransportException ex) {
System.out.println(ex.toString());
} catch (ErrorResponseException ex) {
System.out.println(ex.toString());
} catch (ModbusInitException ex) {
System.out.println(ex.toString());
} finally {
master.destroy();
}
assertEquals(1, 1);
// sudo socat pty,link=/dev/ttyUSB10,waitslave,ignoreeof tcp:192.168.1.5:54321 &
// chown user /dev/ttyUSB10
// sudo socat tcp-l:54321,reuseaddr,fork file:/dev/ttyUSB0,nonblock,waitlock=/var/run/ttyUSB0.lock