rename command to be consistent with other examples
[perl-cwmp.git] / bin / acs.pl
index 6956123..f143b4c 100755 (executable)
@@ -12,25 +12,52 @@ use Getopt::Long;
 
 my $port = 3333;
 my $debug = 0;
+my $store_path = './';
+my $store_plugin = 'YAML';
+my $protocol_dump = 0;
 
 GetOptions(
        'debug+' => \$debug,
        'port=i' => \$port,
+       'store-path=s' => \$store_path,
+       'store-plugin=s' => \$store_plugin,
+       'protocol-dump!' => \$protocol_dump,
 );
 
+my $queue;
+
+if ( $protocol_dump ) {
+
+       warn "generating dump of xml protocol with CPE\n";
+
+       $queue = [
+                       'GetRPCMethods',
+                       'GetParameterNames',
+#                      [ 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.SerialNumber', 0 ],
+#                      [ 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.', 1 ],
+                       [ 'GetParameterValues',
+                               'InternetGatewayDevice.DeviceInfo.SerialNumber',
+                               'InternetGatewayDevice.DeviceInfo.VendorConfigFile.',
+                               'InternetGatewayDevice.DeviceInfo.X_000E50_Country',
+                       ],
+                       [ 'SetParameterValues',
+                               'InternetGatewayDevice.DeviceInfo.ProvisioningCode' => 'test provision',
+#                      'InternetGatewayDevice.DeviceInfo.X_000E50_Country' => 1,
+                       ],
+#                      'Reboot',
+       ];
+};
+
+
 my $server = CWMP::Server->new({
        port => $port,
        store => {
-#              module => 'DBMDeep',
-               module => 'YAML',
-               store_path => 'state.db',
+               module => $store_plugin,
+               path => $store_path,
+               debug => $debug,
        },
        debug => $debug,
-       default_queue => [ qw/
-               GetRPCMethods
-               GetParameterNames
-       / ],
-#              Reboot
+       default_queue => [ $queue ],
 });
 $server->run();