Main MRPT website > C++ reference for MRPT 1.5.9
Classes | Macros | Typedefs | Functions | Variables
xsmessage.h File Reference
#include "xstypesconfig.h"
#include "pstdint.h"
#include "xsbytearray.h"
#include "xsdataidentifier.h"
#include "xsxbusmessageid.h"
Include dependency graph for xsmessage.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  XsMessageHeader
 A message header. More...
 
union  XsMessageHeader::LengthData
 Contains optional extended length of message and first byte of data buffer. More...
 
struct  XsMessageHeader::LengthData::ExtendedLength
 Contains extended length information and first byte of data buffer if normal length is 255. More...
 
struct  XsMessageHeader::LengthData::ExtendedLength::ExtendedParts
 The high and low byte of the extended length. More...
 
struct  XsMessage
 Structure for storing a single message. More...
 

Macros

#define XSMESSAGE_INITIALIZER   { XSBYTEARRAY_INITIALIZER, 1, 0 }
 
#define XS_PREAMBLE   0xFA
 
#define XS_EXTLENCODE   0xFF
 
#define XS_LEN_MSGHEADER   4
 
#define XS_LEN_MSGEXTHEADER   6
 
#define XS_LEN_MSGHEADERCS   5
 
#define XS_LEN_MSGEXTHEADERCS   7
 
#define XS_LEN_CHECKSUM   1
 
#define XS_LEN_UNSIGSHORT   2
 
#define XS_LEN_UNSIGINT   4
 
#define XS_LEN_FLOAT   4
 
#define XS_MAXDATALEN   (8192-XS_LEN_MSGEXTHEADERCS)
 
#define XS_MAXSHORTDATALEN   254
 
#define XS_MAXMSGLEN   (XS_MAXDATALEN+XS_LEN_MSGEXTHEADERCS)
 
#define XS_MAXSHORTMSGLEN   (XS_MAXSHORTDATALEN+XS_LEN_MSGHEADERCS)
 
#define XS_MAXGARBAGE   (XS_MAXMSGLEN+1)
 
#define PACK_POST   __attribute__((__packed__))
 
#define swapEndian16(src)   (((src) >> 8) | ((src) << 8))
 
#define swapEndian32(src)   (((src) >> 24) | (((src) >> 8) & 0xFF00) | (((src) << 8) & 0xFF0000) | ((src) << 24))
 
#define swapEndian64(src)   (((src >> 56) & 0xFFULL) | ((src >> 40) & 0xFF00ULL) | ((src >> 24) & 0xFF0000ULL) | ((src >> 8) & 0xFF000000ULL) | ((src << 8) & 0xFF00000000ULL) | ((src << 24) & 0xFF0000000000ULL) | ((src << 40) & 0xFF000000000000ULL) | ((src << 56)))
 

Typedefs

typedef struct XsMessage XsMessage
 
typedef struct XsMessageHeader XsMessageHeader
 

Functions

XSTYPES_DLL_API void XsMessage_construct (XsMessage *thisPtr)
 
XSTYPES_DLL_API void XsMessage_constructSized (XsMessage *thisPtr, XsSize dataSize)
 
XSTYPES_DLL_API void XsMessage_copyConstruct (XsMessage *thisPtr, XsMessage const *src)
 
XSTYPES_DLL_API void XsMessage_assign (XsMessage *thisPtr, XsSize dataSize)
 
XSTYPES_DLL_API void XsMessage_load (XsMessage *thisPtr, XsSize msgSize, unsigned char const *src)
 
XSTYPES_DLL_API void XsMessage_destruct (XsMessage *thisPtr)
 
XSTYPES_DLL_API void XsMessage_copy (XsMessage *copy, XsMessage const *src)
 
XSTYPES_DLL_API void XsMessage_swap (XsMessage *a, XsMessage *b)
 
XSTYPES_DLL_API XsSize XsMessage_dataSize (XsMessage const *thisPtr)
 
XSTYPES_DLL_API const uint8_tXsMessage_constData (XsMessage const *thisPtr, XsSize offset)
 
XSTYPES_DLL_API const uint8_tXsMessage_getMessageStart (XsMessage const *thisPtr)
 
XSTYPES_DLL_API XsSize XsMessage_getTotalMessageSize (XsMessage const *thisPtr)
 
XSTYPES_DLL_API uint8_t XsMessage_getDataByte (XsMessage const *thisPtr, XsSize offset)
 
XSTYPES_DLL_API uint16_t XsMessage_getDataShort (XsMessage const *thisPtr, XsSize offset)
 
XSTYPES_DLL_API uint32_t XsMessage_getDataLong (XsMessage const *thisPtr, XsSize offset)
 
XSTYPES_DLL_API float XsMessage_getDataFloat (XsMessage const *thisPtr, XsSize offset)
 
XSTYPES_DLL_API double XsMessage_getDataDouble (XsMessage const *thisPtr, XsSize offset)
 
XSTYPES_DLL_API double XsMessage_getDataF1220 (XsMessage const *thisPtr, XsSize offset)
 
XSTYPES_DLL_API double XsMessage_getDataFP1632 (XsMessage const *thisPtr, XsSize offset)
 
XSTYPES_DLL_API const uint8_tXsMessage_getDataBuffer (XsMessage const *thisPtr, XsSize offset)
 
XSTYPES_DLL_API void XsMessage_setDataByte (XsMessage *thisPtr, uint8_t value, XsSize offset)
 
XSTYPES_DLL_API void XsMessage_setDataShort (XsMessage *thisPtr, uint16_t value, XsSize offset)
 
XSTYPES_DLL_API void XsMessage_setDataLong (XsMessage *thisPtr, uint32_t value, XsSize offset)
 
XSTYPES_DLL_API void XsMessage_setDataFloat (XsMessage *thisPtr, float value, XsSize offset)
 
XSTYPES_DLL_API void XsMessage_setDataDouble (XsMessage *thisPtr, double value, XsSize offset)
 
XSTYPES_DLL_API void XsMessage_setDataF1220 (XsMessage *thisPtr, double value, XsSize offset)
 
XSTYPES_DLL_API void XsMessage_setDataFP1632 (XsMessage *thisPtr, double value, XsSize offset)
 
XSTYPES_DLL_API void XsMessage_setDataBuffer (XsMessage *thisPtr, const uint8_t *buffer, XsSize size, XsSize offset)
 
XSTYPES_DLL_API uint8_t XsMessage_computeChecksum (XsMessage const *thisPtr)
 
XSTYPES_DLL_API void XsMessage_recomputeChecksum (XsMessage *thisPtr)
 
XSTYPES_DLL_API int XsMessage_isChecksumOk (XsMessage const *thisPtr)
 
XSTYPES_DLL_API XsMessageHeaderXsMessage_getHeader (XsMessage *)
 
XSTYPES_DLL_API const XsMessageHeaderXsMessage_getConstHeader (XsMessage const *thisPtr)
 
XSTYPES_DLL_API int XsMessage_empty (XsMessage const *thisPtr)
 
XSTYPES_DLL_API void XsMessage_resizeData (XsMessage *thisPtr, XsSize newSize)
 
XSTYPES_DLL_API void XsMessage_setBusId (XsMessage *thisPtr, uint8_t busId)
 
XSTYPES_DLL_API void XsMessage_setMessageId (XsMessage *thisPtr, XsXbusMessageId msgId)
 
XSTYPES_DLL_API void XsMessage_insertData (XsMessage *thisPtr, XsSize count, XsSize offset)
 
XSTYPES_DLL_API void XsMessage_deleteData (XsMessage *thisPtr, XsSize count, XsSize offset)
 
XSTYPES_DLL_API void XsMessage_getDataFPValues (XsMessage const *thisPtr, uint64_t outputSettings, double *dest, XsSize offset, XsSize numValues)
 
XSTYPES_DLL_API void XsMessage_setDataFPValues (XsMessage *thisPtr, uint64_t outputSettings, double const *data, XsSize offset, XsSize numValues)
 
XSTYPES_DLL_API void XsMessage_getDataFPValuesById (XsMessage const *thisPtr, XsDataIdentifier dataIdentifier, double *dest, XsSize offset, XsSize numValues)
 
XSTYPES_DLL_API void XsMessage_setDataFPValuesById (XsMessage *thisPtr, XsDataIdentifier dataIdentifier, double const *data, XsSize offset, XsSize numValues)
 
XSTYPES_DLL_API int XsMessage_compare (XsMessage const *a, XsMessage const *b)
 

Variables

struct XsMessageHeader PACK_POST
 

Macro Definition Documentation

◆ PACK_POST

#define PACK_POST   __attribute__((__packed__))

Definition at line 106 of file xsmessage.h.

◆ swapEndian16

#define swapEndian16 (   src)    (((src) >> 8) | ((src) << 8))

Definition at line 523 of file xsmessage.h.

◆ swapEndian32

#define swapEndian32 (   src)    (((src) >> 24) | (((src) >> 8) & 0xFF00) | (((src) << 8) & 0xFF0000) | ((src) << 24))

Definition at line 524 of file xsmessage.h.

◆ swapEndian64

#define swapEndian64 (   src)    (((src >> 56) & 0xFFULL) | ((src >> 40) & 0xFF00ULL) | ((src >> 24) & 0xFF0000ULL) | ((src >> 8) & 0xFF000000ULL) | ((src << 8) & 0xFF00000000ULL) | ((src << 24) & 0xFF0000000000ULL) | ((src << 40) & 0xFF000000000000ULL) | ((src << 56)))

Definition at line 525 of file xsmessage.h.

◆ XS_EXTLENCODE

#define XS_EXTLENCODE   0xFF

Definition at line 79 of file xsmessage.h.

Referenced by expectedMessageSize(), and ProtocolHandler::findMessage().

◆ XS_LEN_CHECKSUM

#define XS_LEN_CHECKSUM   1

Definition at line 85 of file xsmessage.h.

◆ XS_LEN_FLOAT

#define XS_LEN_FLOAT   4

Definition at line 88 of file xsmessage.h.

◆ XS_LEN_MSGEXTHEADER

#define XS_LEN_MSGEXTHEADER   6

Definition at line 82 of file xsmessage.h.

◆ XS_LEN_MSGEXTHEADERCS

#define XS_LEN_MSGEXTHEADERCS   7

◆ XS_LEN_MSGHEADER

#define XS_LEN_MSGHEADER   4

Definition at line 81 of file xsmessage.h.

◆ XS_LEN_MSGHEADERCS

#define XS_LEN_MSGHEADERCS   5

◆ XS_LEN_UNSIGINT

#define XS_LEN_UNSIGINT   4

Definition at line 87 of file xsmessage.h.

◆ XS_LEN_UNSIGSHORT

#define XS_LEN_UNSIGSHORT   2

Definition at line 86 of file xsmessage.h.

◆ XS_MAXDATALEN

#define XS_MAXDATALEN   (8192-XS_LEN_MSGEXTHEADERCS)

◆ XS_MAXGARBAGE

#define XS_MAXGARBAGE   (XS_MAXMSGLEN+1)

Definition at line 95 of file xsmessage.h.

◆ XS_MAXMSGLEN

#define XS_MAXMSGLEN   (XS_MAXDATALEN+XS_LEN_MSGEXTHEADERCS)

Definition at line 93 of file xsmessage.h.

◆ XS_MAXSHORTDATALEN

#define XS_MAXSHORTDATALEN   254

Definition at line 92 of file xsmessage.h.

◆ XS_MAXSHORTMSGLEN

#define XS_MAXSHORTMSGLEN   (XS_MAXSHORTDATALEN+XS_LEN_MSGHEADERCS)

Definition at line 94 of file xsmessage.h.

◆ XS_PREAMBLE

#define XS_PREAMBLE   0xFA

Definition at line 78 of file xsmessage.h.

Referenced by ProtocolHandler::findMessage().

◆ XSMESSAGE_INITIALIZER

#define XSMESSAGE_INITIALIZER   { XSBYTEARRAY_INITIALIZER, 1, 0 }

Definition at line 24 of file xsmessage.h.

Typedef Documentation

◆ XsMessage

typedef struct XsMessage XsMessage

Definition at line 25 of file xsmessage.h.

◆ XsMessageHeader

Definition at line 26 of file xsmessage.h.

Function Documentation

◆ XsMessage_assign()

XSTYPES_DLL_API void XsMessage_assign ( XsMessage thisPtr,
XsSize  dataSize 
)

◆ XsMessage_compare()

XSTYPES_DLL_API int XsMessage_compare ( XsMessage const *  a,
XsMessage const *  b 
)

◆ XsMessage_computeChecksum()

XSTYPES_DLL_API uint8_t XsMessage_computeChecksum ( XsMessage const *  thisPtr)

◆ XsMessage_constData()

XSTYPES_DLL_API const uint8_t* XsMessage_constData ( XsMessage const *  thisPtr,
XsSize  offset 
)

◆ XsMessage_construct()

XSTYPES_DLL_API void XsMessage_construct ( XsMessage thisPtr)

◆ XsMessage_constructSized()

XSTYPES_DLL_API void XsMessage_constructSized ( XsMessage thisPtr,
XsSize  dataSize 
)

◆ XsMessage_copy()

XSTYPES_DLL_API void XsMessage_copy ( XsMessage copy,
XsMessage const *  src 
)

◆ XsMessage_copyConstruct()

XSTYPES_DLL_API void XsMessage_copyConstruct ( XsMessage thisPtr,
XsMessage const *  src 
)

◆ XsMessage_dataSize()

XSTYPES_DLL_API XsSize XsMessage_dataSize ( XsMessage const *  thisPtr)

◆ XsMessage_deleteData()

XSTYPES_DLL_API void XsMessage_deleteData ( XsMessage thisPtr,
XsSize  count,
XsSize  offset 
)

◆ XsMessage_destruct()

XSTYPES_DLL_API void XsMessage_destruct ( XsMessage thisPtr)

◆ XsMessage_empty()

XSTYPES_DLL_API int XsMessage_empty ( XsMessage const *  thisPtr)

◆ XsMessage_getConstHeader()

XSTYPES_DLL_API const XsMessageHeader* XsMessage_getConstHeader ( XsMessage const *  thisPtr)

◆ XsMessage_getDataBuffer()

XSTYPES_DLL_API const uint8_t* XsMessage_getDataBuffer ( XsMessage const *  thisPtr,
XsSize  offset 
)

◆ XsMessage_getDataByte()

XSTYPES_DLL_API uint8_t XsMessage_getDataByte ( XsMessage const *  thisPtr,
XsSize  offset 
)

◆ XsMessage_getDataDouble()

XSTYPES_DLL_API double XsMessage_getDataDouble ( XsMessage const *  thisPtr,
XsSize  offset 
)

◆ XsMessage_getDataF1220()

XSTYPES_DLL_API double XsMessage_getDataF1220 ( XsMessage const *  thisPtr,
XsSize  offset 
)

◆ XsMessage_getDataFloat()

XSTYPES_DLL_API float XsMessage_getDataFloat ( XsMessage const *  thisPtr,
XsSize  offset 
)

◆ XsMessage_getDataFP1632()

XSTYPES_DLL_API double XsMessage_getDataFP1632 ( XsMessage const *  thisPtr,
XsSize  offset 
)

◆ XsMessage_getDataFPValues()

XSTYPES_DLL_API void XsMessage_getDataFPValues ( XsMessage const *  thisPtr,
uint64_t  outputSettings,
double *  dest,
XsSize  offset,
XsSize  numValues 
)

◆ XsMessage_getDataFPValuesById()

XSTYPES_DLL_API void XsMessage_getDataFPValuesById ( XsMessage const *  thisPtr,
XsDataIdentifier  dataIdentifier,
double *  dest,
XsSize  offset,
XsSize  numValues 
)

◆ XsMessage_getDataLong()

XSTYPES_DLL_API uint32_t XsMessage_getDataLong ( XsMessage const *  thisPtr,
XsSize  offset 
)

◆ XsMessage_getDataShort()

XSTYPES_DLL_API uint16_t XsMessage_getDataShort ( XsMessage const *  thisPtr,
XsSize  offset 
)

◆ XsMessage_getHeader()

XSTYPES_DLL_API XsMessageHeader* XsMessage_getHeader ( XsMessage )

◆ XsMessage_getMessageStart()

XSTYPES_DLL_API const uint8_t* XsMessage_getMessageStart ( XsMessage const *  thisPtr)

◆ XsMessage_getTotalMessageSize()

XSTYPES_DLL_API XsSize XsMessage_getTotalMessageSize ( XsMessage const *  thisPtr)

◆ XsMessage_insertData()

XSTYPES_DLL_API void XsMessage_insertData ( XsMessage thisPtr,
XsSize  count,
XsSize  offset 
)

◆ XsMessage_isChecksumOk()

XSTYPES_DLL_API int XsMessage_isChecksumOk ( XsMessage const *  thisPtr)

◆ XsMessage_load()

XSTYPES_DLL_API void XsMessage_load ( XsMessage thisPtr,
XsSize  msgSize,
unsigned char const *  src 
)

◆ XsMessage_recomputeChecksum()

XSTYPES_DLL_API void XsMessage_recomputeChecksum ( XsMessage thisPtr)

◆ XsMessage_resizeData()

XSTYPES_DLL_API void XsMessage_resizeData ( XsMessage thisPtr,
XsSize  newSize 
)

◆ XsMessage_setBusId()

XSTYPES_DLL_API void XsMessage_setBusId ( XsMessage thisPtr,
uint8_t  busId 
)

◆ XsMessage_setDataBuffer()

XSTYPES_DLL_API void XsMessage_setDataBuffer ( XsMessage thisPtr,
const uint8_t buffer,
XsSize  size,
XsSize  offset 
)

◆ XsMessage_setDataByte()

XSTYPES_DLL_API void XsMessage_setDataByte ( XsMessage thisPtr,
uint8_t  value,
XsSize  offset 
)

◆ XsMessage_setDataDouble()

XSTYPES_DLL_API void XsMessage_setDataDouble ( XsMessage thisPtr,
double  value,
XsSize  offset 
)

◆ XsMessage_setDataF1220()

XSTYPES_DLL_API void XsMessage_setDataF1220 ( XsMessage thisPtr,
double  value,
XsSize  offset 
)

◆ XsMessage_setDataFloat()

XSTYPES_DLL_API void XsMessage_setDataFloat ( XsMessage thisPtr,
float  value,
XsSize  offset 
)

◆ XsMessage_setDataFP1632()

XSTYPES_DLL_API void XsMessage_setDataFP1632 ( XsMessage thisPtr,
double  value,
XsSize  offset 
)

◆ XsMessage_setDataFPValues()

XSTYPES_DLL_API void XsMessage_setDataFPValues ( XsMessage thisPtr,
uint64_t  outputSettings,
double const *  data,
XsSize  offset,
XsSize  numValues 
)

◆ XsMessage_setDataFPValuesById()

XSTYPES_DLL_API void XsMessage_setDataFPValuesById ( XsMessage thisPtr,
XsDataIdentifier  dataIdentifier,
double const *  data,
XsSize  offset,
XsSize  numValues 
)

◆ XsMessage_setDataLong()

XSTYPES_DLL_API void XsMessage_setDataLong ( XsMessage thisPtr,
uint32_t  value,
XsSize  offset 
)

◆ XsMessage_setDataShort()

XSTYPES_DLL_API void XsMessage_setDataShort ( XsMessage thisPtr,
uint16_t  value,
XsSize  offset 
)

◆ XsMessage_setMessageId()

XSTYPES_DLL_API void XsMessage_setMessageId ( XsMessage thisPtr,
XsXbusMessageId  msgId 
)

◆ XsMessage_swap()

XSTYPES_DLL_API void XsMessage_swap ( XsMessage a,
XsMessage b 
)

Variable Documentation

◆ PACK_POST

struct XsMessageHeader PACK_POST



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020