Environment for Controllers Simulation (ECS) is set of utilities to simulate data exchange with any devices through Serial and Ethernet connections.
You need the CMake build system, C++ compiler, libserial and system
, asio
, program_options
components of the Boost library to build this software.
This is link to libserial library:
https://github.com/ellysh/libserial
There are steps to build serial-utils:
-
Generate makefiles with CMake build system.
Type one of these commands to build debug or release versions of the ECS:$ cmake -D CMAKE_BUILD_TYPE=Debug CMakeLists.txt
$ cmake -D CMAKE_BUILD_TYPE=Release CMakeLists.txt
-
Build binaries with C++ compiler:
$ make
-
Build debian package if you use Debian-based Linux distribution:
$ make deb
You can find debian packages in the bin/deb
directory.
Debian-based Linux distribution users can install debian packages from
bin/deb
directory.
Another way is installing with Makefile default mechanism:
$ make install
This is example to simulate data exchange through the serial connection.
-
Create the virtual serial port with
socat
utility:$ socat PTY,link=/tmp/ttyS0,raw,echo=0 PTY,link=/tmp/ttyS1,raw,echo=0
-
Run the virtual controller utility:
$ virt-controller --dev /tmp/ttyS0 --baud 57600 --scenario a20-test.vc --type serial
-
Send data to the
/tmp/ttyS1
port for virtual controller:$ write-data -f /tmp/ttyS1 -b 57600 -d 3147
Serial Utils project have been used at the third point of the instruction above:
https://github.com/ellysh/serial-utils
Free use of this software is granted under the terms of the GNU General
Public License (GPL). For details see the file LICENSE
included with the serial-utils distribution.