Implemented CompleteAccess for SDO downloads.

This commit is contained in:
Florian Pose
2009-08-13 13:53:56 +02:00
parent 454d502ada
commit 10c7501851
11 changed files with 146 additions and 30 deletions
+14 -17
View File
@@ -131,7 +131,7 @@ void CommandConfig::showDetailedConfigs(
)
{
ConfigList::const_iterator configIter;
unsigned int j, k, l;
unsigned int i, j, k, l;
ec_ioctl_slave_t slave;
ec_ioctl_config_pdo_t pdo;
ec_ioctl_config_pdo_entry_t entry;
@@ -217,26 +217,23 @@ void CommandConfig::showDetailedConfigs(
<< hex << setfill('0')
<< setw(4) << sdo.index << ":"
<< setw(2) << (unsigned int) sdo.subindex
<< ", " << dec << sdo.size << " byte: " << hex;
<< ", " << dec << sdo.size << " byte" << endl;
switch (sdo.size) {
case 1:
cout << "0x" << setw(2)
<< (unsigned int) *(uint8_t *) &sdo.data;
break;
case 2:
cout << "0x" << setw(4)
<< le16_to_cpup(&sdo.data);
break;
case 4:
cout << "0x" << setw(8)
<< le32_to_cpup(&sdo.data);
break;
default:
cout << "???";
cout << " " << hex;
for (i = 0; i < min((uint32_t) sdo.size,
(uint32_t) EC_MAX_SDO_DATA_SIZE); i++) {
cout << setw(2) << (unsigned int) sdo.data[i];
if ((i + 1) % 16 == 0 && i < sdo.size - 1) {
cout << endl << " ";
} else {
cout << " ";
}
}
cout << endl;
if (sdo.size > EC_MAX_SDO_DATA_SIZE) {
cout << " ..." << endl;
}
}
} else {
cout << " None." << endl;