Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1135 (closed enhancement: fixed)

Opened 4 months ago

Last modified 1 month ago

SerialConduit: simple access to serial ports (aka COM-ports)

Reported by: elite01 Assigned to: kris
Priority: normal Milestone: 0.99.8
Component: IO Version:
Keywords: Cc: larsivi

Description

Enables applications to use a serial port (aka COM-port, ttyS). Usage is similar to that of FileConduit?:

auto serPort = new SerialPort("ttyS0");
serPort.speed = 38400;
serPort.write("Hello world!");
serPort.close();

Attachments

SerialPort.d (8.3 kB) - added by elite01 on 07/20/08 14:15:34.
SerialConduit.d (9.5 kB) - added by elite01 on 08/16/08 09:10:39.

Change History

06/08/08 23:51:21 changed by kris

  • status changed from new to assigned.
  • milestone set to 1.0.

07/16/08 13:28:27 changed by elite01

Fixed one or two bugs and added static char[][] ports to get a list of all ports, but that's a bit broken, I have to admit. Some testing on anything else than Linux (especially Windows) would be welcome, as well as a Windows implementation of ports.

07/20/08 14:15:34 changed by elite01

  • attachment SerialPort.d added.

07/20/08 14:20:08 changed by elite01

Ok, did some basic testing on WinXP, and stuff works fine. Including {{{char[][] ports}} - what a pain. But there isn't really a cleaner way on either platform.

08/03/08 18:23:37 changed by kris

  • cc set to larsivi.

nice work, elite01 ... not sure where to locate this, though. What do you think, larsivi?

08/11/08 01:52:46 changed by kris

  • milestone changed from 1.0 to 0.99.8.

added tango.io.device as a placeholder for this class and others ... now we just need to get the code adjusted a little, and commit it.

  • please change the module name to SerialConduit?
  • please convert all tabs to spaces
  • please remove the dependency on Regex (it's too heavyweight to be imported here)

That should do it, I think? What say you, larsivi?

08/11/08 03:35:10 changed by larsivi

I would like to see the implementation without Regex, but I don't think removing it should cause too much trouble.

Also, on line 69, there is some unnecessary allocation in a loop. Make p a buffer outside the loop, preferably on the stack if you know the max size, and dup the content for those cases where the string constitutes a valid handle. Please look into it, if there are other similar cases.

08/16/08 09:10:39 changed by elite01

  • attachment SerialConduit.d added.

08/16/08 09:11:30 changed by elite01

Ok, did all of that.

08/17/08 16:31:19 changed by elite01

  • summary changed from SerialPort: simple access to serial ports (aka COM-ports) to SerialConduit: simple access to serial ports (aka COM-ports).

08/24/08 23:29:47 changed by kris

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [3910]) fixes #1135 :: SerialConduit?: simple access to serial ports (aka COM-ports)

A big thank-you to elite01