Go to the documentation of this file.
51 log->logRead(buf, res);
61 log->logWrite(buf, len);
86 res =
send(
id, len, payload);
144 if (msg.
id != expectedId)
149 throw TransmissionException(
str(boost::format(
"Response ID (%02X) does not match submitted command ID (%02X)") % (
int)msg.
id % (
int)expectedId));
172 unsigned char header[3];
173 unsigned short checksum = 0x50f5;
182 res =
read(header, 1);
195 res =
read(header, 3);
216 unsigned char*
data =
new unsigned char[ msg->
len + 2u ];
301 unsigned char* buf =
new unsigned char[ 6 + len + 2 ];
302 memcpy(buf, header, 6);
303 memcpy(buf + 6,
data, len);
304 memcpy(buf + 6 + len, (
unsigned char*) &crc, 2);
306 res =
write(buf, 6 + len + 2);
308 if (res < 6 + (
int)len + 2)
328 return strm <<
a.toString();
int read(unsigned char *buf, unsigned int len)
virtual ~AbstractInterface()
int write(unsigned char *buf, unsigned int len)
message(STATUS "Boost-Library-Dir: " "${Boost_LIBRARY_DIRS}") message(STATUS "Boost-LIBRARIES
Response receiveWithoutChecks()
Response submitCmd(unsigned char id, unsigned char *payload, unsigned int len, bool pending)
int send(unsigned char id, unsigned int len, unsigned char *data)
static unsigned short Crc16(unsigned char *data, unsigned int size)
Calculates the CRC16 checksum of an array by using a table.
static unsigned short Update_crc16(unsigned char *data, unsigned int size, unsigned short crc)
Calculates the CRC16 checksum of an array by using a table.
void fireAndForgetCmd(unsigned char id, unsigned char *payload, unsigned int len, bool pending)
double a(double t, double a0, double j)
void logText(std::string message)
#define make_short(lowbyte, highbyte)
void startLogging(std::string file)
#define MSG_PREAMBLE_BYTE
virtual int writeInternal(unsigned char *buf, unsigned int len)=0
virtual int readInternal(unsigned char *buf, unsigned int len)=0
std::ostream & operator<<(std::ostream &strm, const AbstractInterface &a)
std::vector< unsigned char > data