32 #include "sdo_response.h"
41 return (((uint16_t)
data[2])<<8) + (uint16_t)data[1];
57 return (((uint32_t)
data[3+3]) << 24)
58 + (((uint32_t)
data[3+2]) << 16)
59 + (((uint32_t)
data[3+1]) << 8)
60 + (uint32_t)
data[3+0];
70 for (
unsigned i=0;i<7;++i) {
72 PRINT(
"data["<<i<<
"] = 0x"<<std::hex<<(
unsigned)
data[i]);
90 case 0x05030000:
return "Toggle bit not alternated";
91 case 0x05040000:
return "SDO protocol timed out";
92 case 0x05040001:
return "Client/server command specifier not valid or unknown";
93 case 0x05040002:
return "Invalid block size (block mode only)";
94 case 0x05040003:
return "Invalid sequence number (block mode only)";
95 case 0x05040004:
return "CRC error (block mode only)";
96 case 0x05040005:
return "Out of memory";
97 case 0x06010000:
return "Unsupported access to an object";
98 case 0x06010001:
return "Attempt to read a write only object";
99 case 0x06010002:
return "Attempt to write a read only object";
100 case 0x06020000:
return "Object does not exist in the object dictionary";
101 case 0x06040041:
return "Object cannot be mapped to the PDO";
102 case 0x06040042:
return "The number and length of the objects to be mapped whould exeed PDO length";
103 case 0x06040043:
return "General parameter incompatibility reason";
104 case 0x06040047:
return "General internal incompatibility in the device";
105 case 0x06060000:
return "Access failed due to a hardware error";
106 case 0x06070010:
return "Data type does not match, length of service parameter does not match";
107 case 0x06070012:
return "Data type does not match, length of service parameter too high";
108 case 0x06070013:
return "Data type does not match, length of service parameter too low";
109 case 0x06090011:
return "Sub-index does not exist.";
110 case 0x06090030:
return "Value range of parameter exceeded (only for write access)";
111 case 0x06090031:
return "Value of parameter written too high";
112 case 0x06090032:
return "Value of parameter written too low";
113 case 0x06090036:
return "Maximum value is less than minimum value";
114 case 0x08000000:
return "General error";
115 case 0x08000020:
return "Data cannot be transferred or stored to the application";
116 case 0x08000021:
return "Data cannot be transferred or stored to the application because of local control";
117 case 0x08000022:
return "Data cannot be transferred or stored to the application because ofthe present device";
118 case 0x08000023:
return "Object dictionary dynamic generation fails or no object dictionary is present.";
119 default:
return "unknown error code";
void print() const
Prints the response to command line.
uint8_t get_length() const
Returns the number of data bytes.
uint8_t failed() const
Check if the transfer failed.
uint16_t get_subindex() const
Returns the subindex (only for expedited transfer).
std::string get_error() const
Returns a human-readable representation of the error (only if failed()==true)
uint8_t command
SDO command specifier.
uint16_t get_index() const
Returns the dictionary index (only for expedited transfer).
uint32_t get_data() const
Returns the data as a single 4-byte value (only for expedited transfer).
uint8_t data[7]
Data bytes.