473,325 Members | 2,774 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,325 software developers and data experts.

Win32::SerialPort: can not set baudrate

Hi
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:
$^E\n";

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
24
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
XON/XOFF: OFF
CTS handshaking: OFF
DSR handshaking: OFF
DSR sensitivity: OFF
DTR circuit: ON
RTS circuit: ON

Any idea??
Thanks
Carlo
Jul 19 '05 #1
0 3301

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

Similar topics

5
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...
13
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...
13
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...
3
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...
4
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...
2
saranjegan
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.. ...
0
saranjegan
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...
2
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+)...
10
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.