onyx-serial 0.3.4

Serial port interface by D


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

onyx-serial

onyx-serial: the simple serial port library by D.

Key features:

  • Open/close serial port.
  • Write/read to/from serial port.
  • Setup speed - standard value from 50 to 4,000,000.
  • parity - none, odd, even.
  • Setup read timeout in mS.
  • Check is port open.
  • Work on posix OS (Linux, OSX, FreeBSD).

Examples:

	import onyx.serial;

	/* Create ports */
	auto port1 = OxSerialPort("/dev/ttyS1", 9600, "none", 10);
	auto port2 = OxSerialPort("/dev/ttyS2", 9600, "none", 10);


	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);

Authors:
Oleg Nykytenko
Dependencies:
onyx-config
Versions:
0.5.0 2016-Jun-03
0.4.0 2016-May-12
0.3.6 2016-May-10
0.3.5 2016-Feb-16
0.3.4 2015-Nov-20
Show all 25 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 2 downloads this month

  • 340 downloads total