Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: Unusual error in Win32::SerialPort (Missing REQUIRED setting for BAUD) (guess)

by Anonymous Monk
on Aug 28, 2013 at 19:34 UTC ( [id://1051314]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Unusual error in Win32::SerialPort (Missing REQUIRED setting for BAUD) (guess)
in thread Unusual error in Win32::SerialPort (Missing REQUIRED setting for BAUD)

Thank you. But it does not work. Nor work similar other tricks like:

$Serial->baudrate(int($baud_rate)) $Serial->baudrate("$baud_rate") $Serial->baudrate(eval{$baud_rate})

The following seems to work (in the sense that it does not produces an error message), but the serial stream does not have the baudrate it is supposed to have

$Serial->{"_L_BAUD"}{$baud_rate} = $baud_rate; $Serial->baudrate($baud_rate);

I don't know what it may be

Replies are listed 'Best First'.
Re^5: Unusual error in Win32::SerialPort (Missing REQUIRED setting for BAUD) (guess)
by Anonymous Monk on Aug 29, 2013 at 18:32 UTC
    It was my fault. The code was in a subroutine where $baud_rate was passed by reference and used as if it were passed by value. After correcting the mistake the following construct worked perfectly:
    $Serial->{"_L_BAUD"}{$baud_rate} = $baud_rate; $Serial->baudrate($baud_rate);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-19 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found