/[cwmp]/google/trunk/lib/CWMP/Methods.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /google/trunk/lib/CWMP/Methods.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 177 by dpavlin, Sun Oct 28 16:57:34 2007 UTC revision 178 by dpavlin, Sun Oct 28 19:47:30 2007 UTC
# Line 84  sub GetRPCMethods { Line 84  sub GetRPCMethods {
84    
85  =head2 SetParameterValues  =head2 SetParameterValues
86    
87  B<not implemented>    $method->SetParameterValues( $state,
88            param1 => 'value1',
89            param2 => 'value2',
90            ...
91      );
92    
93    It doesn't support base64 encoding of values yet.
94    
95    To preserve data, it does support repeatable parametar names.
96    Behaviour on this is not defined in protocol.
97    
98    =cut
99    
100    sub SetParameterValues {
101            my $self = shift;
102            my $state = shift;
103    
104            confess "SetParameterValues needs parameters" unless @_;
105    
106            my @params = @_;
107    
108            my ( @names, @values );
109    
110            while ( @_ ) {
111                    push @names, shift @_;
112                    push @values, shift @_;
113            }
114    
115            confess "can't convert params ", dump( @params ), " to name/value pairs" unless $#names == $#values;
116    
117            warn "# SetParameterValues", dump( @params ), "\n" if $self->debug;
118    
119            $self->xml( $state, sub {
120                    my ( $X, $state ) = @_;
121    
122                    $X->SetParameterValues( $cwmp,
123                            $X->ParameterList( $cwmp,
124                                    $X->ParameterNames( $cwmp,
125                                            map {
126                                                    $X->ParameterValueStruct( $cwmp,
127                                                            $X->Name( $cwmp, $_ ),
128                                                            $X->Value( $cwmp, shift @values )
129                                                    )
130                                            } @names
131                                    )
132                            )
133                    );
134            });
135    }
136    
137    
138  =head2 GetParameterValues  =head2 GetParameterValues
139    
# Line 96  sub GetParameterValues { Line 145  sub GetParameterValues {
145          my $self = shift;          my $self = shift;
146          my $state = shift;          my $state = shift;
147          my @ParameterNames = @_;          my @ParameterNames = @_;
148          confess "need ParameterNames" unless @ParameterNames;          confess "GetParameterValues need ParameterNames" unless @ParameterNames;
149          warn "# GetParameterValues", dump( @ParameterNames ), "\n" if $self->debug;          warn "# GetParameterValues", dump( @ParameterNames ), "\n" if $self->debug;
150    
151          $self->xml( $state, sub {          $self->xml( $state, sub {

Legend:
Removed from v.177  
changed lines
  Added in v.178

  ViewVC Help
Powered by ViewVC 1.1.26