This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using Perl to access serial ports

Jason Pearce schrieb:
There was some recent discussion about serial ports and Perl.

But I did not see any resolution.
Did anyone end up porting either Win32::SerialPort or Win32API::CommPort as Reini suggested?

I need to talk to a thermometer via a serial link. The protocol is not very complex.
Could I just use a system call to stty to set the baudrate and then pipe the thermometer comand to /dev/ttyS0 and read the response from /dev/ttyS0 using file handles?

Reini - you suggested adding cygwin support for Device::SerialPort would be the easiest route. Do you still recommend this?


I am not very familiar with Windows API library, but could I just use Win32::API to call some already existing entry points in Windows?

Uaing .xs is usually easier than using an FFI i.e. Win32::API.
And Win32::API doesn't compile out of the box on cygwin.
I have a stripped version without callback support at my site, but using xs is better.
If you really want an FFI I recommend FFI over Win32::API by far.

Reini Urban

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]