onyx-serial ~master
Serial port library for D.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
onyx-serial
onyx-serial: Serial port library for D.
Key features:
- Open/close serial port.
- Write/read to/from serial port.
- Setup: speed - standard value from 50 to 4,000,000.
- Setup: parity - none, odd, even.
- Setup: read timeout in mS.
- Check: is port open.
- Platforms: posix OS (Linux, OSX, FreeBSD, Solaris).
Examples:
import onyx.serial;
/* Create ports */
auto port1 = OxSerialPort("dev/ttyS1", Speed.S9600, Parity.none, 1000);
auto port2 = OxSerialPort("dev/ttyS2", Speed.S9600, Parity.none, 1000);
port1.open;
port2.open;
ubyte[] data = [0x22, 0x33, 0xCC];
port1.write(data);
ubyte[] buf = port2.read(3);
assert (buf == data);
port1.close();
port2.close();
string[] s1 =
["[port]",
"name = /dev/ttyr06",
"speed = 57600",
"parity = none",
"time_out = 1500"];
auto bundle = new immutable Bundle(s1);
auto port3 = OxSerialPort(bundle);
auto bundle = new immutable Bundle("./config/port4.conf");
auto port4 = OxSerialPort(bundle);
- ~master released 3 years ago
- nykytenko/onyx-serial
- MIT
- Copyright © 2014-2021
- Authors:
- Dependencies:
- onyx-config
- Versions:
-
0.5.3 2021-Mar-09 0.5.2 2020-May-31 0.5.1 2018-Dec-25 0.5.0 2016-Jun-03 0.4.0 2016-May-12 - Download Stats:
-
-
0 downloads today
-
1 downloads this week
-
10 downloads this month
-
815 downloads total
-
- Score:
- 1.5
- Short URL:
- onyx-serial.dub.pm