From b0ee4211e860bd53dd9c709d4f93cb5b01e2ae8e Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 12 Dec 2014 15:17:04 +0100 Subject: [PATCH] don't dump response length without DEBUG=1 --- dialog.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dialog.pl b/dialog.pl index 7daf81c..0308a80 100755 --- a/dialog.pl +++ b/dialog.pl @@ -5,6 +5,8 @@ use strict; use Data::Dump qw(dump); use Device::SerialPort qw(:STAT); +my $debug = $ENV{DEBUG} || 0; + my $port = Device::SerialPort->new('/dev/ttyUSB0'); $port->baudrate(9600); $port->databits(8); @@ -61,7 +63,7 @@ retry: $port->write( $bytes ); my $data = $port->read(1); - warn "<< len: ",ord($data); + warn "<< len: ",ord($data) if $debug; goto retry if ord($data) == 0; @@ -77,3 +79,6 @@ v '07 0A 00 00 00 04 44', 'software version'; v '07 00 01 00 06 0E EA', 'temperatures'; +v '07 00 00 00 26 0A A6', 'last errros'; + +v '07 00 00 00 26 00 AC', 'last errros (with invalid length)'; -- 2.20.1