Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Win32::SerialPort Query Current Values

by spickles (Scribe)
on Sep 21, 2009 at 21:03 UTC ( [id://796616]=note: print w/replies, xml ) Need Help??


in reply to Re: Win32::SerialPort Query Current Values
in thread Win32::SerialPort Query Current Values

So if I wanted to determine the settings on a serial connection, I'd have to call the program several times with settings that I guess and save the output to a file. When I get readable output back, I know I have the right settings. Is that about right?
  • Comment on Re^2: Win32::SerialPort Query Current Values

Replies are listed 'Best First'.
Re^3: Win32::SerialPort Query Current Values
by GrandFather (Saint) on Sep 21, 2009 at 21:44 UTC

    Tell us more about what you are trying to achieve and we may be able to help more. Running a program several times doesn't sound like a sensible use of a computer to me. I'd be writing the code to make the guesses and test the outcomes - run one program once and let the computer do the hard work.


    True laziness is hard work
      GrandFather -

      Here is what I'd like to do:
      We have a Cisco box that doesn't output anything on the Console line other than jibberish. This is often due to just to a mismatch between the settings on the device and the settings on the COM port used to connect. So before we ditch this box for having a bad console port, I'd like to have my script 'query' the console port and get its settings (if that's at all possible). Right now, when I run my program all it does is return the values that are set by me on my COM port on the PC. What I want is the program to tell me what the current settings are on the switch. We got this switch off of Craigslist for twenty bucks, and we can't do a thing with it until we can get a console connection. Because of the age of the switch (circa 2000) there's no hardware reset that we know of. We've cracked it open and tried serial connection headers and shorting pins, but no luck. So if it isn't possible to have the device cough up its current settings using Win32::SerialPort, perhaps it's possible with another module? If it isn't possible at all, meaning I don't fully understand the way a serial port works, then it was my thought to have the script keep all variables constant except for one (like baudrate) and modify its value sequentially. Then I would send some characters to the device and record the output. When I get something back I can read, I know I've got the right settings.

      Regards,
      Scott

        Bottom line: you can't ask the hardware - it doesn't know and can't tell what the settings are.

        As you suggest (and as I suggested in Re: Win32::SerialPort Query Current Values) the only way to figure it out is to "suck it to see". Re-read that reply. It tells you which parameters are important and how they should be set for quickest results.


        True laziness is hard work

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-25 18:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found