11 #include "CommandSdos.h" |
11 #include "CommandSdos.h" |
12 |
12 |
13 /*****************************************************************************/ |
13 /*****************************************************************************/ |
14 |
14 |
15 CommandSdos::CommandSdos(): |
15 CommandSdos::CommandSdos(): |
16 SdoCommand("sdos", "List Sdo dictionaries.") |
16 SdoCommand("sdos", "List SDO dictionaries.") |
17 { |
17 { |
18 } |
18 } |
19 |
19 |
20 /*****************************************************************************/ |
20 /*****************************************************************************/ |
21 |
21 |
25 |
25 |
26 str << getName() << " [OPTIONS]" << endl |
26 str << getName() << " [OPTIONS]" << endl |
27 << endl |
27 << endl |
28 << getBriefDescription() << endl |
28 << getBriefDescription() << endl |
29 << endl |
29 << endl |
30 << "Sdo dictionary information is displayed in two layers," << endl |
30 << "SDO dictionary information is displayed in two layers," << endl |
31 << "which are indented accordingly:" << endl |
31 << "which are indented accordingly:" << endl |
32 << endl |
32 << endl |
33 << "1) Sdos - Hexadecimal Sdo index and the name. Example:" << endl |
33 << "1) SDOs - Hexadecimal SDO index and the name. Example:" << endl |
34 << endl |
34 << endl |
35 << " Sdo 0x1018, \"Identity object\"" << endl |
35 << " SDO 0x1018, \"Identity object\"" << endl |
36 << endl |
36 << endl |
37 << "2) Sdo entries - Sdo index and Sdo entry subindex (both" << endl |
37 << "2) SDO entries - SDO index and SDO entry subindex (both" << endl |
38 << " hexadecimal) followed by the data type, the length in" << endl |
38 << " hexadecimal) followed by the data type, the length in" << endl |
39 << " bit, and the description. Example:" << endl |
39 << " bit, and the description. Example:" << endl |
40 << endl |
40 << endl |
41 << " 0x1018:01, uint32, 32 bit, \"Vendor id\"" << endl |
41 << " 0x1018:01, uint32, 32 bit, \"Vendor id\"" << endl |
42 << endl |
42 << endl |
43 << "If the --quiet option is given, only the Sdos are output." |
43 << "If the --quiet option is given, only the SDOs are output." |
44 << endl << endl |
44 << endl << endl |
45 << "Command-specific options:" << endl |
45 << "Command-specific options:" << endl |
46 << " --alias -a <alias>" << endl |
46 << " --alias -a <alias>" << endl |
47 << " --position -p <pos> Slave selection. See the help of" << endl |
47 << " --position -p <pos> Slave selection. See the help of" << endl |
48 << " the 'slaves' command." << endl |
48 << " the 'slaves' command." << endl |
49 << " --quiet -q Only output Sdos (without the" << endl |
49 << " --quiet -q Only output SDOs (without the" << endl |
50 << " Sdo entries)." << endl |
50 << " SDO entries)." << endl |
51 << endl |
51 << endl |
52 << numericInfo(); |
52 << numericInfo(); |
53 |
53 |
54 return str.str(); |
54 return str.str(); |
55 } |
55 } |
88 cout << "=== Slave " << slave.position << " ===" << endl; |
88 cout << "=== Slave " << slave.position << " ===" << endl; |
89 |
89 |
90 for (i = 0; i < slave.sdo_count; i++) { |
90 for (i = 0; i < slave.sdo_count; i++) { |
91 m.getSdo(&sdo, slave.position, i); |
91 m.getSdo(&sdo, slave.position, i); |
92 |
92 |
93 cout << "Sdo 0x" |
93 cout << "SDO 0x" |
94 << hex << setfill('0') |
94 << hex << setfill('0') |
95 << setw(4) << sdo.sdo_index |
95 << setw(4) << sdo.sdo_index |
96 << ", \"" << sdo.name << "\"" << endl; |
96 << ", \"" << sdo.name << "\"" << endl; |
97 |
97 |
98 if (getVerbosity() == Quiet) |
98 if (getVerbosity() == Quiet) |