better introspect ZTE devices
[perl-cwmp.git] / bin / cpe-queue.pl
index b378405..55a8f8f 100755 (executable)
@@ -21,7 +21,7 @@ GetOptions(
        'list!' => \$list,
 );
 
-die "usage: $0 CPE_id [--protocol-dump]\n" unless @ARGV;
+die "usage: $0 [...queue/]CPE_id [--list|--protocol-dump]\n" unless @ARGV;
 
 foreach my $id ( @ARGV ) {
 
@@ -114,27 +114,62 @@ foreach my $id ( @ARGV ) {
 
                warn "injecting some tests commands\n";
 
-               $q->enqueue( 'GetRPCMethods' );
+#              $q->enqueue( 'GetRPCMethods' ); # XXX not supported by ZTE
+
+               $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.', 1 ] );
+
+               $q->enqueue( 'GetParameterValues', [
+               'InternetGatewayDevice.',
+               ]);
+
 
-       #       $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.LANDevice.', 1 ] );
+               # turn on periodic reporting to ACS server
+
+               $q->enqueue( 'GetParameterValues', [ 'InternetGatewayDevice.ManagementServer.' ] );
+               $q->enqueue( 'SetParameterValues', {
+                       'InternetGatewayDevice.ManagementServer.PeriodicInformEnable' => 1,
+                       'InternetGatewayDevice.ManagementServer.PeriodicInformInterval' => 15, # s
+               } );
+               $q->enqueue( 'GetParameterValues', [ 'InternetGatewayDevice.ManagementServer.' ] );
 
-       #       $q->enqueue( 'GetParameterValues', [
-       #               'InternetGatewayDevice.',
-       #       ]);
 
-       #       $q->enqueue( 'GetParameterNames', [ '.ExternalIPAddress', 1 ] );
+#              $q->enqueue( 'GetParameterNames', [ '.ExternalIPAddress', 1 ] );
 
-       #       $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.', 1 ] );
-       #       $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.DeviceInfo.', 1 ] );
-       #       $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.DeviceConfig.', 1 ] );
-       #       $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.ManagementServer.', 1 ] );
-       #       $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.Services.', 1 ] );
-       #       $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.LANDevice.', 1 ] );
+               $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.', 1 ] );
+#              $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.DeviceInfo.', 1 ] );
+#              $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.DeviceConfig.', 1 ] );
+#              $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.ManagementServer.', 1 ] );
+#              $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.Services.', 1 ] );
+#              $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.LANDevice.', 1 ] );
 
                $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.', 0 ] );
                $q->enqueue( 'GetParameterValues', [
-                       'InternetGatewayDevice.',
+                       #'InternetGatewayDevice.',      # too big for ZTE 
+                       'InternetGatewayDevice.DeviceConfig.',
+                       'InternetGatewayDevice.DeviceInfo.',
+                       'InternetGatewayDevice.DeviceSummary',
+                       'InternetGatewayDevice.ManagementServer.',
+               ]);
+
+               $q->enqueue( 'GetParameterValues' => [ $_ ] ) foreach ( qw/
+InternetGatewayDevice.IPPingDiagnostics.
+InternetGatewayDevice.LANConfigSecurity.
+InternetGatewayDevice.LANDevice.
+InternetGatewayDevice.Layer2Bridging.
+InternetGatewayDevice.Layer3Forwarding.
+InternetGatewayDevice.ManagementServer.
+InternetGatewayDevice.QueueManagement.
+InternetGatewayDevice.Time.
+InternetGatewayDevice.UserInterface.
+InternetGatewayDevice.WANDevice.
+               / );
+
+               $q->enqueue( 'GetParameterAttributes', [
+                       'InternetGatewayDevice.DeviceInfo.SerialNumber',
+                       'InternetGatewayDevice.DeviceInfo.SoftwareVersion',
                ]);
+
+#              $q->enqueue( 'SetParameterAttributes', [ '
        }
 
 }