X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=zc-mqtt;h=e1593bec86aec997d0d36564c3e120c6353b55fc;hb=93c26262fb1edaa3d67c01d24c3602a583eaad82;hp=5060b8dfd7634ccc3de462519e4175371bf091c4;hpb=f85a8940fb873de9d6a7e829072318c69cca5608;p=zc 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 );