Serial port driver for Erlang on Windows?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Serial port driver for Erlang on Windows?

Peter Andersson

Hi everyone,

Johan Bevemyr has written a serial port driver for Erlang on UNIX (contributed
to erlang.org). Has anyone done something similar for Windows? If not, I would
still be grateful for any info or pointers that you could provide me with on
this subject. I want to be able to run an Erlang application (using the UNIX
serial port driver) on Windows as well, but I don't have any experience of
low-level Windows programming. (Is Johan's ANSI C driver easily ported? How
would e.g. opening and connecting to a /dev/ttya,b,... device in Unix be
accomplished in Windows using the Com1,2,... abstractions?).

Regards

  /Peter


Reply | Threaded
Open this post in threaded view
|

Serial port driver for Erlang on Windows?

Claes Wikström
On Fri, Jan 05, 2001 at 03:44:43PM +0000, Peter Andersson wrote:

> Johan Bevemyr has written a serial port driver for Erlang on UNIX (contributed
> to erlang.org). Has anyone done something similar for Windows? If not, I would
> still be grateful for any info or pointers that you could provide me with on
> this subject. I want to be able to run an Erlang application (using the UNIX
> serial port driver) on Windows as well, but I don't have any experience of
> low-level Windows programming. (Is Johan's ANSI C driver easily ported? How
> would e.g. opening and connecting to a /dev/ttya,b,... device in Unix be
> accomplished in Windows using the Com1,2,... abstractions?).
>

I actually once started to do this, It requires a lof of
overlapped IO shit and stuff with the win32 API. I never
got it work properly and then other stuff came in the way
and I dropped it.
However, a platform independand library to the serial
ports would indeed be nice to have.


/klacke




--
Claes Wikstrom                        -- Caps lock is nowhere and
Alteon WebSystems                     -- everything is under control          
http://www.bluetail.com/~klacke       --



Reply | Threaded
Open this post in threaded view
|

Serial port driver for Erlang on Windows?

Tomas Pihl
In reply to this post by Peter Andersson
On Fri, 5 Jan 2001, Peter Andersson wrote:

>
> Hi everyone,
>
> Johan Bevemyr has written a serial port driver for Erlang on UNIX (contributed
> to erlang.org). Has anyone done something similar for Windows? If not, I would
> still be grateful for any info or pointers that you could provide me with on
> this subject. I want to be able to run an Erlang application (using the UNIX
> serial port driver) on Windows as well, but I don't have any experience of
> low-level Windows programming. (Is Johan's ANSI C driver easily ported? How
> would e.g. opening and connecting to a /dev/ttya,b,... device in Unix be
> accomplished in Windows using the Com1,2,... abstractions?).

You could try cygwin (http://sources.redhat.com/cygwin). I've used it
for "porting" a *BSD application to Windows with good results. This
particular application of mine included serialport access and all I did
was to replace the /dev/tty? with /dev/com? in order to have it working
on Windows. I was actually quite impressed with it beeing so easy.

One thing I noticed though was I couldn't get the opening of the same
port twice to work, ie. when you want to have one filedescriptor for
reading and another one for writing using the same port. Don't know if
this is a Windows restriction or a cygwin problem.

--
Tomas Pihl
tomas.pihl