projects
/
vaillant-thermostat
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f9ad94
)
parse serial log into csv
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 1 Mar 2017 12:21:57 +0000
(13:21 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 1 Mar 2017 12:21:57 +0000
(13:21 +0100)
parse.pl
[new file with mode: 0755]
patch
|
blob
diff --git a/parse.pl
b/parse.pl
new file mode 100755
(executable)
index 0000000..
6f6911a
--- /dev/null
+++ b/
parse.pl
@@ -0,0
+1,24
@@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+while(<>) {
+ chomp;
+ if ( m/^([0-9\.]+) .+aa fc 39 aa (.+)/ ) {
+ #warn "# $1 $2\n";
+ my @l = split(/\s/,$2);
+ my @d = (
+ $1,
+ hex( $l[0] . $l[1] ),
+ hex( $l[3] . $l[4] ),
+ hex( $l[6] ),
+ hex( $l[12] ),
+ hex( $l[14] ) * 300,
+ hex( $l[15] ) * 400,
+ hex( $l[18] ),
+ );
+ print join(',', @d),$/;
+ } else {
+ warn "# $_\n";
+ }
+}