equal
deleted
inserted
replaced
45 { |
45 { |
46 } |
46 } |
47 |
47 |
48 /*****************************************************************************/ |
48 /*****************************************************************************/ |
49 |
49 |
50 string CommandConfig::helpString() const |
50 string CommandConfig::helpString(const string &binaryBaseName) const |
51 { |
51 { |
52 stringstream str; |
52 stringstream str; |
53 |
53 |
54 str << getName() << " [OPTIONS]" << endl |
54 str << binaryBaseName << " " << getName() << " [OPTIONS]" << endl |
55 << endl |
55 << endl |
56 << getBriefDescription() << endl |
56 << getBriefDescription() << endl |
57 << endl |
57 << endl |
58 << "Without the --verbose option, slave configurations are" << endl |
58 << "Without the --verbose option, slave configurations are" << endl |
59 << "output one-per-line. Example:" << endl |
59 << "output one-per-line. Example:" << endl |
151 unsigned int i, j, k, l; |
151 unsigned int i, j, k, l; |
152 ec_ioctl_slave_t slave; |
152 ec_ioctl_slave_t slave; |
153 ec_ioctl_config_pdo_t pdo; |
153 ec_ioctl_config_pdo_t pdo; |
154 ec_ioctl_config_pdo_entry_t entry; |
154 ec_ioctl_config_pdo_entry_t entry; |
155 ec_ioctl_config_sdo_t sdo; |
155 ec_ioctl_config_sdo_t sdo; |
|
156 ec_ioctl_config_idn_t idn; |
156 string indent(doIndent ? " " : ""); |
157 string indent(doIndent ? " " : ""); |
157 |
158 |
158 for (configIter = configList.begin(); |
159 for (configIter = configList.begin(); |
159 configIter != configList.end(); |
160 configIter != configList.end(); |
160 configIter++) { |
161 configIter++) { |
257 } |
258 } |
258 } else { |
259 } else { |
259 cout << indent << " None." << endl; |
260 cout << indent << " None." << endl; |
260 } |
261 } |
261 |
262 |
|
263 cout << indent << "IDN configuration:" << endl; |
|
264 if (configIter->idn_count) { |
|
265 for (j = 0; j < configIter->idn_count; j++) { |
|
266 m.getConfigIdn(&idn, configIter->config_index, j); |
|
267 |
|
268 cout << indent << " Drive " << (unsigned int) idn.drive_no |
|
269 << ", " << outputIdn(idn.idn) |
|
270 << ", " << dec << idn.size << " byte" << endl; |
|
271 |
|
272 cout << indent << " " << hex << setfill('0'); |
|
273 for (i = 0; i < min((uint32_t) idn.size, |
|
274 (uint32_t) EC_MAX_IDN_DATA_SIZE); i++) { |
|
275 cout << setw(2) << (unsigned int) idn.data[i]; |
|
276 if ((i + 1) % 16 == 0 && i < idn.size - 1) { |
|
277 cout << endl << indent << " "; |
|
278 } else { |
|
279 cout << " "; |
|
280 } |
|
281 } |
|
282 |
|
283 cout << endl; |
|
284 if (idn.size > EC_MAX_IDN_DATA_SIZE) { |
|
285 cout << indent << " ..." << endl; |
|
286 } |
|
287 } |
|
288 } else { |
|
289 cout << indent << " None." << endl; |
|
290 } |
262 if (configIter->dc_assign_activate) { |
291 if (configIter->dc_assign_activate) { |
263 int i; |
292 int i; |
264 |
293 |
265 cout << indent << "DC configuration:" << endl |
294 cout << indent << "DC configuration:" << endl |
266 << indent << " AssignActivate: 0x" << hex << setfill('0') |
295 << indent << " AssignActivate: 0x" << hex << setfill('0') |