473,799 Members | 3,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Win32::SerialPo rt: 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::SerialPo rt qw( :STAT 0.19 );
$ob = new Win32::SerialPo rt ('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\nCurren t 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\U tility\COMS2.pl line
24
fail setting baud at C:\tools\Perl\U tility\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::SerialPo rt). 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 3331

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

Similar topics

5
6200
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 fOutxCtsFlow:1;
13
21713
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 data in the string being sent to the printer. However, if I prompt the user for data or if I insert data from a particular record/field in a form Access crashes/closes on its own. I have included the code below, if anyone has any suggestions,...
13
7824
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 component, using the System.Timers.Timer it works fine) tnx in advance Jean Paul
3
8274
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 SerialPort ("COM1"); if(serialPort.IsOpen)
4
8665
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 want to set the fRtsControl to RTS_CONTROL_TOGGLE so the RTS signal will be reset automatically when the TX buffer is empty. - Kristoffer -
2
4092
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.. But am in need how to read the values coming from it, and how to write the data, can any give some examples it will be usefull
0
2273
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 know about configuration file , how to use it ? it will be great if you give a clear explanation about it , thanks for your time
2
2626
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+) file out over the serial port with zero down time at speeds ranging from 9600 to 480600 baud. While using the SerialPort Control, I cannot come up with an implimentation that doesn't A) hog the CPU at 100% and B) is able to continually fill the...
10
18269
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 encountered is that a call to SerialPort.GetPortNames() returns an empty string. In other words, NO port names are returned. I'm not terribly knowledgable about ports but from the Hardware Manager I did notice that I don't have the Ports and...
0
9688
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10268
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10247
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10031
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9079
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.