This is a serial port emulator. This is done by creating pairs of ports on /dev where writing data on one port can be read on the pair and vice-versa.
- Install the dependencies. On your Debian-like Linux machine, run:
sudo apt install python3-serial linux-headers-`uname -r` gcc binutils make
- Inside the driver folder, run:
make clean all
sudo make modules_install
sudo make install
- Set read and write permissions on the pairs of devices to be used
Example: for the EmulatedPort 0 device:
sudo chmod 777 /dev/ttyEmulatedPort0
sudo chmod 777 /dev/ttyExogenous0
Inside the 'driver' folder, run:
sudo make uninstall
After the installation, by default, it will be instatiated on /dev many pairs of devices:
- /dev/ttyEmulatedPort0 <---> /dev/ttyExogenous0
- /dev/ttyEmulatedPort1 <---> /dev/ttyExogenous1 ...
And so on. Writing on one device will make its content to be read on the other pair, and vice-versa
You MUST at least execute a read operation on the Exogenous port to make the OS create the necessary structures
Example:
- Open a terminal window and run:
cat /dev/ttyExogenous0
The device will be put on waiting for incoming data
- Open another terminal window and run:
echo "XYZ" > /dev/ttyEmulatedPort0
Return to the first terminal Window. It should appear the 'XYZ' on it.