https://github.com/ncrashed/serial-port
Crossplatform library for operating with serial ports in D programming language.
https://github.com/ncrashed/serial-port
Last synced: 4 months ago
JSON representation
Crossplatform library for operating with serial ports in D programming language.
- Host: GitHub
- URL: https://github.com/ncrashed/serial-port
- Owner: NCrashed
- License: bsl-1.0
- Created: 2013-09-29T19:26:46.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-02-03T14:50:56.000Z (over 9 years ago)
- Last Synced: 2025-07-03T17:46:57.665Z (11 months ago)
- Language: D
- Size: 722 KB
- Stars: 20
- Watchers: 5
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
serial-port
===========
Crossplatform library for operating with serial ports in D programming language.
[Documentation](http://ncrashed.github.io/serial-port/index.html).
## Compilation
With [dub](http://code.dlang.org/download):
```
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](http://linux.die.net/man/1/socat) to create serial port pipe:
```
socat /dev/ttyS0,raw,echo=0,crnl /dev/ttyS1,raw,echo=0,crnl
```
## References
* [Termios man page](http://linux.die.net/man/3/termios)
* [librs232] (https://github.com/ynezz/librs232)
* [D termios header file](https://github.com/D-Programming-Language/druntime/blob/v2.065.0/src/core/sys/linux/termios.d)
* [Termbits header file](https://github.com/torvalds/linux/blob/9a3c4145af32125c5ee39c0272662b47307a8323/include/uapi/asm-generic/termbits.h)
* [Some useful socat commands](http://technostuff.blogspot.it/2008/10/some-useful-socat-commands.html)