X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=lib%2FCWMP%2FRequest.pm;h=0cea935227fb4d15a7ebbf58a1f5fe1956324a1f;hb=774c5ba74d808d504f5e6dd2b838f68e37b50842;hp=7d2084c9a0af00a9bd82732fa829ae2ae99b353a;hpb=0d052d117960123b64bd8e66fb44515489d8800e;p=perl-cwmp.git diff --git a/lib/CWMP/Request.pm b/lib/CWMP/Request.pm index 7d2084c..0cea935 100644 --- a/lib/CWMP/Request.pm +++ b/lib/CWMP/Request.pm @@ -31,6 +31,7 @@ our $rules = [ 'ID' => sub { my ($tag_name, $tag_hash, $context, $parent_data) = @_; $state->{ID} = $tag_hash->{_content}; + chomp( $state->{ID} ); }, 'DeviceId' => sub { @@ -103,6 +104,28 @@ push @$rules, $state->{_trigger} = 'GetParameterNamesResponse'; }; +=head2 GetParameterAttributesResponse + +=cut + +push @$rules, + 'ParameterAttributeStruct' => sub { + my ($tag_name, $tag_hash, $context, $parent_data) = @_; + warn dump( $tag_name, $tag_hash, $context ); + + confess "need state" unless ( $state ); # don't remove! + + my $name = _tag($tag_hash, 'Name', '_content'); + + + $state->{ParameterAttribute}->{$name} = { + Notification => _tag($tag_hash, 'Notification', '_content' ), + AccessList => _tag($tag_hash, 'AccessList', 'string' ), + }; + + $state->{_trigger} = 'GetParameterAttributesResponse'; + }; + =head2 Fault =cut @@ -147,7 +170,7 @@ sub parse { rules => $rules, ); - warn "## created $parser\n"; +# warn "## created $parser\n"; $parser->parsestring( $xml );