32#include <boost/format.hpp>
42 const std::vector<unsigned char>&
data,
76 str(boost::format(
"Response length is too short, should be = %1% (is %2%)") %
len %
90 ss <<
" status != E_SUCCESS";
92 for (
int i = 0; i < (int)
len; i++)
94 ss << boost::format(
"%02X ") % (int)
data[i];
99 str(boost::format(
"Command not successful: %1% (0x%2$02X)") %
107 std::vector<unsigned char>
data;
119 return (
"Service or data is not available");
122 return (
"No sensor connected");
125 return (
"The device is not initialized");
128 return (
"Service is already running");
131 return (
"The requested feature is not supported");
134 return (
"One or more dependent parameters mismatch");
137 return (
"Timeout error");
140 return (
"Error while reading from a device");
143 return (
"Error while writing to a device");
146 return (
"No memory available");
149 return (
"Checksum error");
152 return (
"No parameters expected");
155 return (
"Not enough parameters");
158 return (
"Unknown command");
161 return (
"Command format error");
164 return (
"Access denied");
167 return (
"Interface already open");
170 return (
"Command failed");
173 return (
"Command aborted");
176 return (
"Invalid handle");
179 return (
"Device not found");
182 return (
"Device not open");
185 return (
"General I/O-Error");
188 return (
"Invalid parameter");
191 return (
"Index out of bounds");
194 return (
"Command is pending...");
197 return (
"Data overrun");
200 return (
"Value out of range");
203 return (
"Axis is blocked");
206 return (
"File already exists");
209 return (
"Internal error. Unknown error code.");
@ E_INSUFFICIENT_RESOURCES
@ E_FEATURE_NOT_SUPPORTED
#define ARMARX_ERROR_S
The logging level for unexpected behaviour, that must be fixed.
unsigned short getShort(int index)
Response(int res, unsigned char cmdId, status_t status, const std::vector< unsigned char > &data, unsigned int len)
unsigned int getUInt(int index)
unsigned char getByte(int index)
static const char * status_to_str(status_t status)
std::vector< unsigned char > data
void ensureMinLength(int len)