fixed TextMasterSlaveLSS
authorgroke6
Mon, 11 Feb 2008 11:00:12 +0100
changeset 387 6efc85c5493e
parent 386 0f56a144ba5f
child 388 1c1e3599d66a
fixed TextMasterSlaveLSS
examples/TestMasterSlaveLSS/TestMasterSlaveLSS.c
--- a/examples/TestMasterSlaveLSS/TestMasterSlaveLSS.c	Fri Feb 08 18:28:22 2008 +0100
+++ b/examples/TestMasterSlaveLSS/TestMasterSlaveLSS.c	Mon Feb 11 11:00:12 2008 +0100
@@ -60,26 +60,30 @@
 void help()
 {
   printf("**************************************************************\n");
-  printf("*  TestMasterSlaveLSS                                           *\n");
-  printf("*                                                            *\n");
-  printf("*  A LSS example for PC. It does implement 3 CanOpen      *\n");
-  printf("*  nodes in the same process. A master and 2 slaves. Both     *\n");
+  printf("*  TestMasterSlaveLSS                                        *\n");
+  printf("*                                                            *\n");
+  printf("*  A LSS example for PC. It does implement 3 CanOpen         *\n");
+  printf("*  nodes in the same process. A master and 2 slaves. All     *\n");
   printf("*  communicate together, exchanging periodically NMT, SYNC,  *\n");
   printf("*  SDO and PDO. Master configure heartbeat producer time     *\n");
-  printf("*  at 1000 ms for slave node-id 0x02 by concise DCF.         *\n");                                  
+  printf("*  at 0 ms for slave node-id 0x02 and 0x03 by concise DCF.   *\n");                                  
   printf("*                                                            *\n");
   printf("*   Usage:                                                   *\n");
-  printf("*   ./TestMasterSlaveLSS  [OPTIONS]                             *\n");
+  printf("*   ./TestMasterSlaveLSS  [OPTIONS]                          *\n");
   printf("*                                                            *\n");
   printf("*   OPTIONS:                                                 *\n");
-  printf("*     -l : Can library [\"libcanfestival_can_virtual.so\"]     *\n");
-  printf("*                                                            *\n");
-  printf("*    SlaveA:                                                  *\n");
-  printf("*     -s : bus name [\"0\"]                                    *\n");
-  printf("*     -S : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable)  *\n");
+  printf("*     -l : Can library [\"libcanfestival_can_virtual.so\"]   *\n");
+  printf("*                                                            *\n");
+  printf("*    SlaveA:                                                 *\n");
+  printf("*     -a : bus name [\"0\"]                                  *\n");
+  printf("*     -A : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable)  *\n");
+  printf("*                                                            *\n");
+   printf("*    SlaveB:                                                *\n");
+  printf("*     -b : bus name [\"1\"]                                  *\n");
+  printf("*     -B : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable)  *\n");
   printf("*                                                            *\n");
   printf("*    Master:                                                 *\n");
-  printf("*     -m : bus name [\"1\"]                                    *\n");
+  printf("*     -m : bus name [\"2\"]                                  *\n");
   printf("*     -M : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable)  *\n");
   printf("*                                                            *\n");
   printf("**************************************************************\n");
@@ -128,11 +132,11 @@
   extern char *optarg;
   char* LibraryPath="../../drivers/can_virtual/libcanfestival_can_virtual.so";
 
-  while ((c = getopt(argc, argv, "-m:s:M:S:l:")) != EOF)
+  while ((c = getopt(argc, argv, "-m:a:b:M:A:B:l:")) != EOF)
   {
     switch(c)
     {
-      case 's' :
+      case 'a' :
         if (optarg[0] == 0)
         {
           help();
@@ -140,6 +144,14 @@
         }
         SlaveBoardA.busname = optarg;
         break;
+      case 'b' :
+        if (optarg[0] == 0)
+        {
+          help();
+          exit(1);
+        }
+        SlaveBoardB.busname = optarg;
+        break;
       case 'm' :
         if (optarg[0] == 0)
         {
@@ -148,7 +160,7 @@
         }
         MasterBoard.busname = optarg;
         break;
-      case 'S' :
+      case 'A' :
         if (optarg[0] == 0)
         {
           help();
@@ -156,6 +168,14 @@
         }
         SlaveBoardA.baudrate = optarg;
         break;
+      case 'B' :
+        if (optarg[0] == 0)
+        {
+          help();
+          exit(1);
+        }
+        SlaveBoardB.baudrate = optarg;
+        break;
       case 'M' :
         if (optarg[0] == 0)
         {