Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Accessing Serial port on windows and Linux

by xiaoyafeng (Chaplain)
on May 27, 2008 at 15:14 UTC ( #688674=note: print w/ replies, xml ) Need Help??

in reply to Accessing Serial port on windows and Linux

I haven't used whatever::serialport modules for long long time. You just simply type below:

open( PORT, "+>/dev/S01/" or die "Can't open S01: $!"; #linux mode open( PORT, "+>COM1" ) or die "Can't open COM1: $!"; #Windows mode
Please note you should install active perl first for the second method.

I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Comment on Re: Accessing Serial port on windows and Linux
Download Code
Replies are listed 'Best First'.
Re^2: Accessing Serial port on windows and Linux
by Anonymous Monk on Jan 13, 2010 at 08:19 UTC
    How do you specify speed, parity and xon/off?

      By using ioctl, at least on Linux. The various serial port modules take care of that when you use them. I think Windows has something similar, RTFM. In the worst case, you get the OS defaults for the port.

      Note that /dev/S01 is usually not your first serial port. That would be named /dev/ttyS0, and the second one /dev/ttyS1. USB converters usually appear as /dev/ttyUSB0, /dev/ttyUSB1, and so on. (/dev/S01 seems to be a typo or a system-specific device.)


      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://688674]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2015-11-27 06:36 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (719 votes), past polls