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 );