Skip to content

Commit 645e94e

Browse files
committed
~ update examples in README.md
1 parent 975f3a4 commit 645e94e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ A modern, performant, easy to use client and server implementation of Modbus, su
1111
#### Modbus TCP Client
1212
```java
1313
var transport = NettyTcpClientTransport.create(cfg -> {
14-
cfg.hostname = "172.17.0.2";
15-
cfg.port = 502;
14+
cfg.setHostname("172.17.0.2");
15+
cfg.setPort(502);
1616
});
1717

1818
var client = ModbusTcpClient.create(transport);
@@ -29,11 +29,11 @@ System.out.println("Response: " + response);
2929
#### Modbus RTU on Serial Client
3030
```java
3131
var transport = SerialPortClientTransport.create(cfg -> {
32-
cfg.serialPort = "/dev/ttyUSB0";
33-
cfg.baudRate = 115200;
34-
cfg.dataBits = 8;
35-
cfg.parity = SerialPort.NO_PARITY;
36-
cfg.stopBits = SerialPort.ONE_STOP_BIT;
32+
cfg.setSerialPort("/dev/ttyUSB0");
33+
cfg.setBaudRate(115200);
34+
cfg.setDataBits(8);
35+
cfg.setParity(SerialPort.NO_PARITY);
36+
cfg.setStopBits(SerialPort.TWO_STOP_BITS);
3737
});
3838

3939
var client = ModbusRtuClient.create(transport);

0 commit comments

Comments
 (0)