diff options
Diffstat (limited to 'convert-modeswitch.pl')
-rwxr-xr-x | convert-modeswitch.pl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/convert-modeswitch.pl b/convert-modeswitch.pl index 48d0fd4..9d013b1 100755 --- a/convert-modeswitch.pl +++ b/convert-modeswitch.pl @@ -46,9 +46,15 @@ sub add_mode { return $_[1]; } +sub add_modeval { + return unless ($_[1] && $_[1] =~ /^\d+$/); + $_[0]->{"Modeval"} = $_[1]; +} + my $hex_option = [ undef, \&add_hex ]; my $msg_option = [ undef, \&add_message ]; my $mode_option = [ "Mode", \&add_mode ]; +my $value_mode_option = [ "Mode", \&add_mode, \&add_modeval ]; my %options = ( TargetVendor => $hex_option, TargetProductList => [ "TargetProduct", sub { return [ map(hex,split(/,/, $_[0])) ]; } ], @@ -64,6 +70,7 @@ my %options = ( HuaweiNewMode => $mode_option, QuantaMode => $mode_option, BlackberryMode => $mode_option, + PantechMode => $value_mode_option, OptionMode => $mode_option, SierraMode => $mode_option, SonyMode => $mode_option, @@ -116,6 +123,7 @@ sub parse_file($) { next; }; + $opt->[2] and &{$opt->[2]}($dev, $val, $var); $opt->[1] and $val = &{$opt->[1]}($val, $var); $opt->[0] and $var = $opt->[0]; $dev->{$var} = $val; |