Fork of the official mbed C/C++ SDK provides the software platform and libraries to build your applications. The fork has the documentation converted to Doxygen format

Dependents:   NervousPuppySprintOne NervousPuppySprint2602 Robot WarehouseBot1 ... more

Fork of mbed by mbed official

Embed: (wiki syntax)

« Back to documentation index

CANMessage Class Reference

CANMessage Class Reference

CANMessage class. More...

#include <CAN.h>

Inherits CAN_Message.

Public Member Functions

 CANMessage ()
 Creates empty CAN message.
 CANMessage (int _id, const char *_data, char _len=8, CANType _type=CANData, CANFormat _format=CANStandard)
 Creates CAN message with specific content.
 CANMessage (int _id, CANFormat _format=CANStandard)
 Creates CAN remote message.

Data Fields

unsigned int id
 The message id.
unsigned char data [8]
 Space for 8 byte payload.
unsigned char len
 Length of data in bytes.
CANFormat format
 Defines if the message has standard or extended format.
CANType type
 Defines the type of a message.

Detailed Description

CANMessage class.

Definition at line 26 of file CAN.h.


Constructor & Destructor Documentation

CANMessage (  )

Creates empty CAN message.

Definition at line 32 of file CAN.h.

CANMessage ( int  _id,
const char *  _data,
char  _len = 8,
CANType  _type = CANData,
CANFormat  _format = CANStandard 
)

Creates CAN message with specific content.

Definition at line 42 of file CAN.h.

CANMessage ( int  _id,
CANFormat  _format = CANStandard 
)

Creates CAN remote message.

Definition at line 52 of file CAN.h.


Field Documentation

unsigned char data[8]

Space for 8 byte payload.

If type is CANData data can store up to 8 byte data.

Definition at line 72 of file CAN.h.

CANFormat format

Defines if the message has standard or extended format.

Defines the type of message id: Default is CANStandard which implies 11 bit id. CANExtended means 29 bit message id.

Definition at line 86 of file CAN.h.

unsigned int id

The message id.

  • If format is CANStandard it must be an 11 bit long id.
  • If format is CANExtended it must be an 29 bit long id.

Definition at line 66 of file CAN.h.

unsigned char len

Length of data in bytes.

If type is CANData data can store up to 8 byte data.

Definition at line 78 of file CAN.h.

CANType type

Defines the type of a message.

The message type can rather be CANData for a message with data (default). Or CANRemote for a request of a specific CAN message.

Definition at line 93 of file CAN.h.