projects
/
vrDialog
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
70e7c37
)
decode temperatures and 16-bit numbers
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 14 Dec 2014 12:24:19 +0000
(13:24 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 14 Dec 2014 12:24:19 +0000
(13:24 +0100)
dialog.pl
patch
|
blob
|
history
diff --git
a/dialog.pl
b/dialog.pl
index
d259990
..
006eded
100755
(executable)
--- a/
dialog.pl
+++ b/
dialog.pl
@@
-73,6
+73,14
@@
retry:
crc($data);
warn "<< ",as_hex($data);
+ my $o = 2;
+ while ( $o < length($data) - 2 ) {
+ my $n = unpack('n', substr($data,$o,2));
+ $n = -( 0xffff - $n ) if $n & 0x8000;
+ warn "## $o = ",$n, "\t",$n / 16,"\n";
+ $o += 2;
+ }
+
return $data;
}