equal
deleted
inserted
replaced
29 cerr |
29 cerr |
30 << "Usage: ethercat <COMMAND> [OPTIONS]" << endl |
30 << "Usage: ethercat <COMMAND> [OPTIONS]" << endl |
31 << "Commands:" << endl |
31 << "Commands:" << endl |
32 << " list (ls, slaves) List all slaves (former 'lsec')." << endl |
32 << " list (ls, slaves) List all slaves (former 'lsec')." << endl |
33 << " pdos List Pdo mapping of given slaves." << endl |
33 << " pdos List Pdo mapping of given slaves." << endl |
|
34 << " xml Generate slave information xml." << endl |
34 << "Global options:" << endl |
35 << "Global options:" << endl |
35 << " --master -m <master> Index of the master to use. Default: " |
36 << " --master -m <master> Index of the master to use. Default: " |
36 << DEFAULT_MASTER << endl |
37 << DEFAULT_MASTER << endl |
37 << " --slave -s <slave> Positive numerical ring position," |
38 << " --slave -s <slave> Positive numerical ring position," |
38 << endl |
39 << endl |
119 try { |
120 try { |
120 master.open(masterIndex); |
121 master.open(masterIndex); |
121 |
122 |
122 if (command == "list" || command == "ls" || command == "slaves") { |
123 if (command == "list" || command == "ls" || command == "slaves") { |
123 master.listSlaves(); |
124 master.listSlaves(); |
124 |
|
125 } else if (command == "pdos") { |
125 } else if (command == "pdos") { |
126 master.listPdos(slavePosition); |
126 master.listPdos(slavePosition); |
|
127 } else if (command == "xml") { |
|
128 master.generateXml(slavePosition); |
127 } else { |
129 } else { |
128 cerr << "Unknown command " << command << "!" << endl; |
130 cerr << "Unknown command " << command << "!" << endl; |
129 printUsage(); |
131 printUsage(); |
130 exit(1); |
132 exit(1); |
131 } |
133 } |