Go to the documentation of this file.
32 #define MSG_PREAMBLE_BYTE 0xaa
33 #define MSG_PREAMBLE_LEN 3
36 #define make_short( lowbyte, highbyte ) ( (unsigned short)lowbyte | ( (unsigned short)highbyte << 8 ) )
37 #define make_signed_short( lowbyte, highbyte ) ( (signed short) ( (unsigned short) lowbyte | ( (unsigned short) highbyte << 8 ) ) )
38 #define make_int( lowbyte, mid1, mid2, highbyte ) ( (unsigned int) lowbyte | ( (unsigned int) mid1 << 8 ) | ( (unsigned int) mid2 << 16 ) | ( (unsigned int) highbyte << 24 ) )
39 #define make_float( result, byteptr ) memcpy( &result, byteptr, sizeof( float ) )
42 #define hi( x ) (unsigned char) ( ((x) >> 8) & 0xff ) // Returns the upper byte of the passed short
43 #define lo( x ) (unsigned char) ( (x) & 0xff ) // Returns the lower byte of the passed short
54 virtual int open() = 0;
55 virtual void close() = 0;
56 int read(
unsigned char* buf,
unsigned int len);
57 int write(
unsigned char* buf,
unsigned int len);
64 virtual std::string
toString()
const = 0;
66 int send(
unsigned char id,
unsigned int len,
unsigned char*
data);
68 Response submitCmd(
unsigned char id,
unsigned char* payload,
unsigned int len,
bool pending);
71 void fireAndForgetCmd(
unsigned char id,
unsigned char* payload,
unsigned int len,
bool pending);
79 virtual int readInternal(
unsigned char* buf,
unsigned int len) = 0;
80 virtual int writeInternal(
unsigned char* buf,
unsigned int len) = 0;
84 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