use lib '.';
use Protocol;
-my $debug = $ENV{DEBUG};
+my $debug = $ENV{DEBUG} // 0;
$| = 1;
if ( $debug > 1 ) {
warn "hash = ",dump($hash) if $debug;
+ my $imei = $1 if $filename =~ m{queue/(\d+)};
+
my $function_code = $hash->{function_code} || die "no function_code";
my $fc_desc = $function_code_description->{$up_down}->{$function_code} || die "no function_code_description for $up_down $function_code";
print " function_code=$function_code ",
foreach my $data_id ( @{ $hash->{data_id_order} } ) {
print join(" | ",
+ $imei,
$hash->{up_down},
unpack('H*', chr($data_id)),
$protocol->{$data_id}->{description},