projects
/
vrDialog
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
decode temperatures and 16-bit numbers
[vrDialog]
/
dialog.pl
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;
}