added imei as first column
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 9 Oct 2020 11:30:11 +0000 (13:30 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 9 Oct 2020 11:30:11 +0000 (13:30 +0200)
zc-queue-inspect

index 60ac5a2..63fcd53 100755 (executable)
@@ -9,7 +9,7 @@ use POSIX qw(strftime);
 use lib '.';
 use Protocol;
 
-my $debug = $ENV{DEBUG};
+my $debug = $ENV{DEBUG} // 0;
 $| = 1;
 
 if ( $debug > 1 ) {
@@ -35,6 +35,8 @@ foreach my $filename ( @ARGV ) {
 
        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 ",
@@ -45,6 +47,7 @@ foreach my $filename ( @ARGV ) {
 
        foreach my $data_id ( @{ $hash->{data_id_order} } ) {
                print join(" | ", 
+                       $imei,
                        $hash->{up_down},
                        unpack('H*', chr($data_id)),
                        $protocol->{$data_id}->{description},