5 use Data::Dump qw(dump);
11 my $debug = $ENV{DEBUG};
15 warn "## protocol = ",dump( $protocol );
16 warn "## function_code_description = ",dump( $function_code_description );
21 foreach my $filename ( @ARGV ) {
22 my $up_down = $1 if $filename =~ m/(up|down)/;
23 my $raw = read_file $filename;
24 print "# $filename size:", -s $filename, " ";
25 my $hash = protocol_decode( $up_down, $raw );
27 warn "hash = ",dump($hash);
29 my $function_code = $hash->{function_code} || die "no function_code";
30 my $fc_desc = $function_code_description->{$up_down}->{$function_code} || die "no function_code_description for $up_down $function_code";
31 print " function_code=$function_code ",
33 " ver=", $hash->{ver},
34 " len=", $hash->{len},
37 foreach my $data_id ( @{ $hash->{data_id_order} } ) {
40 unpack('H*', chr($data_id)),
41 $protocol->{$data_id}->{description},
42 $hash->{data_id}->{$data_id},
43 "hex:" . unpack('H*', $hash->{data_range}->{$data_id}),
44 "len:" . $hash->{data_len}->{$data_id},
45 "fmt:" . $protocol->{$data_id}->{pack_fmt},
46 "range:" . $protocol->{$data_id}->{range},
47 "remark:" . $protocol->{$data_id}->{remark}