Go to the documentation of this file.
33 #define MSG_PREAMBLE_BYTE 0xaa
34 #define MSG_PREAMBLE_LEN 3
37 #define make_short(lowbyte, highbyte) ((unsigned short)lowbyte | ((unsigned short)highbyte << 8))
38 #define make_signed_short(lowbyte, highbyte) \
39 ((signed short)((unsigned short)lowbyte | ((unsigned short)highbyte << 8)))
40 #define make_int(lowbyte, mid1, mid2, highbyte) \
41 ((unsigned int)lowbyte | ((unsigned int)mid1 << 8) | ((unsigned int)mid2 << 16) | \
42 ((unsigned int)highbyte << 24))
43 #define make_float(result, byteptr) memcpy(&result, byteptr, sizeof(float))
46 #define hi(x) (unsigned char)(((x) >> 8) & 0xff) // Returns the upper byte of the passed short
47 #define lo(x) (unsigned char)((x) & 0xff) // Returns the lower byte of the passed short
57 virtual int open() = 0;
58 virtual void close() = 0;
59 int read(
unsigned char* buf,
unsigned int len);
60 int write(
unsigned char* buf,
unsigned int len);
68 virtual std::string
toString()
const = 0;
70 int send(
unsigned char id,
unsigned int len,
unsigned char*
data);
72 Response submitCmd(
unsigned char id,
unsigned char* payload,
unsigned int len,
bool pending);
75 void fireAndForgetCmd(
unsigned char id,
unsigned char* payload,
unsigned int len,
bool pending);
83 virtual int readInternal(
unsigned char* buf,
unsigned int len) = 0;
84 virtual int writeInternal(
unsigned char* buf,
unsigned int len) = 0;
88 std::shared_ptr<BinaryLogger> log;
int read(unsigned char *buf, unsigned int len)
virtual ~AbstractInterface()
virtual std::string toString() const =0
std::ostream & operator<<(std::ostream &strm, const AbstractInterface &a)
int write(unsigned char *buf, unsigned int len)
friend std::ostream & operator<<(std::ostream &, const AbstractInterface &)
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)
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)
void startLogging(std::string file)
virtual int writeInternal(unsigned char *buf, unsigned int len)=0
virtual int readInternal(unsigned char *buf, unsigned int len)=0