From 2c41e39ff7d7489da9a501f98819551b35a19b05 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 23 Mar 2021 11:24:09 +0100 Subject: [PATCH] collect data from heartbeat and alarm --- zc-mqtt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zc-mqtt b/zc-mqtt index 5060b8d..e1593be 100755 --- a/zc-mqtt +++ b/zc-mqtt @@ -135,7 +135,7 @@ while (1) { mkdir "$queue/$dir/$date" if ! -d "$queue/$dir/$date"; write_file "$queue/$dir/$date/$time.$t.$up_down.$function_code", $msg->message; - if ( substr($msg->message,2,1) eq "\x07" ) { # heartbeat + if ( $function_code == 7 || $function_code == 8 ) { # 7 = heartbeat, 8 = alarm my $hash = protocol_decode( $up_down, $msg->message ); $sth->execute( map { $hash->{data_id}->{$_} } @insert_data_ids ); -- 2.20.1