I have a serial device (a scrolling led sign to be precise) which I can send text to. It also has a buffer, which I can read the current length of. Both of these things I have managed to do in windows and freeBSD using (respectively) Win32::SerialPort and Dev::SerialPort.
I am trying to work out how to change the output (which should be the number of bytes in the buffer) into a readable form that I can test things against; From my windows monitoring it seems that the device is returning hex in the form:
I know this output to be the number of bytes in the buffer, however, when I capture it with $PortObject->read, and try to print it out I get unicode characters. I've tried using hex() and ord() but both convert all output to 0.
How can I convert my hex into decimal?
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>
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
Want more info? How to link or
or How to display code and escape characters
are good places to start.