Crossplatform library for operating with serial ports in D programming language. Documentation.
With dub:
dub build
with make
make
Or, put in your dub.json dependencies:
"dependencies": {
"serial-port": "~>1.2"
},
To compile tests with dub:
dub build --build=unittest --config=unittest
./serial-port
with make
make test
./serial-port
You should have two serial ports linked to each other (com0com on Windows, socat in linux). For instance, writing to 'COM1' and reading from 'COM2'. On posix you can use socat to create serial port pipe:
socat /dev/ttyS0,raw,echo=0,crnl /dev/ttyS1,raw,echo=0,crnl