Greetings, fellow monks.
I'm having an unusual (judging by the google results) problem with the Win32::SerialPort module. Following is the error, and the relevant code.
The error:
Missing REQUIRED setting for BAUD at Foo.pm line 35
write_settings failed, closing port at Foo.pm line 35
Failed to write settings at Foo.pm line 35.
The code: (Foo.pm lines 26-35)
my $Serial = new Win32::SerialPort('COM1') or die "Serial port died";
$Serial->baudrate(115200);
$Serial->parity('none');
$Serial->databits(8);
$Serial->stopbits(1);
$Serial->handshake('none');
$Serial->buffers(4096, 4096);
$Serial->error_msg(1);
$Serial->user_msg(1);
$Serial->write_settings || die "Failed to write settings";
The error shows up after booting the computer, and after using any program that communicates with the serial port at a different baud rate. I can only seem to resolve it by running something that opens the serial port at my preferred baud rate (115200), such as setting it in HyperTerminal.
Have any of you had any experience with this error? Can I do whatever HyperTerminal and the other programs do to make the baud rate valid? Am I just missing a line somewhere? Thanks.
-BronzeWing
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|