Name Date Size #Lines LOC

..--

Readme.mdH A D22-Oct-20251.1 KiB2418

meson.buildH A D22-Oct-2025285 109

mock_modbus_server.cppH A D22-Oct-20254.4 KiB157128

start_mock_server.shH A D22-Oct-20252 KiB6745

Readme.md

1# Mock Modbus Test Device
2
3## mock-modbus-device
4
5The `mock-modbus-device` daemon launches a simulated Modbus server on a
6specified PTY port ID. This server listens for Modbus requests and returns
7static data. At present, it only supports the ReadHoldingRegisters command, with
8plans to add more command support in the future.
9
10## start_mock_server.sh
11
12The `start_mock_server.sh` script acts as a wrapper for `mock-modbus-device`. It
13accepts a count parameter and starts a separate mocked Modbus server for each
14PTY port. The script also configures the necessary environment variables to
15enable client communication with the mocked servers. It utilizes socat to create
16pseudo-terminals (PTYs) and initiates a `mock-modbus-device` instance for each
17PTY.
18
19This approach enables clients to interact with simulated Modbus devices,
20facilitating testing across different scenarios without requiring physical
21hardware. It is particularly suited for Qemu-based testing. To use this setup,
22users must manually copy the required artifacts to the Qemu VM and execute the
23script to start the mocked Modbus servers.
24