STCAN_MSG Structure
STCAN_MSG is the CAN message structure which accepts CAN parameters and data.
class STCAN_MSG { unsigned int id; bool isExtended; bool isRtr; unsigned char dlc; unsigned char cluster; unsigned char data[64]; unsigned long timeStamp; bool isCanfd; // To set data bool byteAt(int index, unsigned char val); bool wordAt(int index, unsigned short val); bool longAt(int index, unsigned long val); // To get data unsigned char byteAt(int index); unsigned short wordAt(int index); unsigned long longAt(int index); };
Member Description id CAN message identifier is a unsigned integer in decimal or hexadecimal (0x) to identify the message isExtended true for extended message. Possible values: true, false isRtr true for Remote Transmission Request. Possible values: true, false dlc Data Length in bytes. [0-8] for CAN messages, [0-64] for CANFD messages cluster channel on which the frame is received or to be transmitted data[64] Message data. [0-7] bytes for CAN, [0-63] bytes for CANFD messages isCanfd true for CANFD message. Possible values: true, false timeStamp Received frame absolute timestamp in 100’s of microseconds bool byteAt(int index, unsigned char val) To set data byte (8 bit). Possible index: [0-7]. Example: byteAt(0, 10); ‘0’ is index, 10 is value bool wordAt(int index, unsigned short val) To set data word (16 bit). Possible index: [0-3]. Example: wordAt(0, 10); ‘0’ is index, 10 is value. bool longAt(int index, unsigned long val) To set data word (32 bit). Possible index: [0-1]. Example: longAt(0, 10); ‘0’ is index, 10 is value.
Authoritative source: BUSMASTER DITA help source stcan_struct.dita, compiled into BUSMASTER.CHM with the application.