473,387 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 3302

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Rafael Pivato | last post by:
I need help declaring this structure in VB. Particularly the bit flags, like fOutxCtsFlow. typedef struct _DCB { DWORD DCBlength; DWORD BaudRate; DWORD fBinary:1; DWORD fParity:1; DWORD...
by: Susan Beebe | last post by:
I have downloaded the code described in Microsoft article Q154078. I am trying to send raw ZPL (zebra barcode printer) code from Microsoft access. It works just fine if I hard code the actual...
by: Jean Paul Mertens | last post by:
Hello, Someone can tell me why I dont get serial port events in a Service, I created a separate Thread to open the port but no events are coming up (the same happens when I use the timer...
by: ricolee99 | last post by:
Hi Everyone, I'm using the System.IO.Ports.SerialPort component to attempt to kill an existing component opened by another application. I use the following code: SerialPort serialPort = new...
by: =?Utf-8?B?S3Jpc3RvZmZlciBQZXJzc29u?= | last post by:
Does anyone know if it's possible to get the Win32 handle to the serial port used under the hood in System.IO.SerialPort? The reason I want it is so I'd be able to make changes the DCB struct. I...
by: saranjegan | last post by:
Hello, am using win32::serial port module to access my serial port , i have opened the port $serial_port = Win32::SerialPort->new ($port,1); i made some settings such as baud rate, parity etc.. ...
by: saranjegan | last post by:
Hello, Am using win32::serial port module to communicate with my serial port, from CPAN i found that communication is done through file handle by tie with configuration file, i need to...
by: Kevin | last post by:
Does anyone out there happen to have experience using VC# (or any .NET really) to control the serial port for demanding use? My ultimate goal would be to stream an arbitrarily large size (MB+)...
by: sklett | last post by:
I'm trying to send some printer commands (ZPLII) to an attached USB printer using the SerialPort component. I didn't get very far at all. In fact I haven't gotten anywhere. The first problem I...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.