471,873 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 software developers and data experts.

Win32::SerialPort: can not set baudrate

I am trying to control my mobile from my WinXP machine. The
mobile is connected through USB which is mapped on COM 5. With
Hyperterminal everything looks good.
But when I try:
use Win32::SerialPort qw( :STAT 0.19 );
$ob = new Win32::SerialPort ('COM5') || die "Can't open COM5:

my $baud = $ob->baudrate;
my $parity = $ob->parity;
my $data = $ob->databits;
my $stop = $ob->stopbits;
my $hshake = $ob->handshake;

print "\n\nCurrent Settings: ";
print "B = $baud, D = $data, S = $stop, P = $parity, H = $hshake\n";
$ob->baudrate($baud) || die "fail setting baud";
I get:

Current Settings: B = 115200, D = 8, S = , P = , H = none
Could not set baudrate on COM5 at C:\tools\Perl\Utility\COMS2.pl line
fail setting baud at C:\tools\Perl\Utility\COMS2.pl line 24, <DATA>
line 164.

So I can not read the stop and parity and I can not set the baudrate
(which is required by Win32::SerialPort). A "mode COM5" from the
console give me:

Status for device COM5:
Baud: 115200
Parity: None
Data Bits: 8
Stop Bits: 1
Timeout: OFF
CTS handshaking: OFF
DSR handshaking: OFF
DSR sensitivity: OFF
DTR circuit: ON
RTS circuit: ON

Any idea??
Jul 19 '05 #1
0 3237

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Rafael Pivato | last post: by
13 posts views Thread by Jean Paul Mertens | last post: by
4 posts views Thread by =?Utf-8?B?S3Jpc3RvZmZlciBQZXJzc29u?= | last post: by
reply views Thread by saranjegan | last post: by
2 posts views Thread by Kevin | last post: by
10 posts views Thread by sklett | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.