in reply to using sprintf to print binary data collected from the serial port
I often use unpack with a hex format to display binary data:$ibuf_display = sprintf("%x ", ord(substr($ibuf, 1, 1)));
(my $hex = unpack("H*", $buf)) =~ s/(..)/$1 /g; print $hex, "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using sprintf to print binary data collected from the serial port
by Bruce32903 (Scribe) on May 23, 2008 at 13:51 UTC |