AMK_motor_drive_software 1.0.0
Loading...
Searching...
No Matches
CANMessage Class Reference

The CANMessage class represents a CAN message, containing an ID and data. More...

#include <CANMessage.hpp>

Public Member Functions

 CANMessage ()
 Default constructor for CANMessage.
 
 CANMessage (uint16_t t_canId)
 Constructs a CANMessage with a specified CAN ID.
 
void setCanId (uint16_t t_canId)
 Sets the CAN ID of the message.
 
uint16_t getCanId ()
 Retrieves the CAN ID of the message.
 

Public Attributes

uint8_t m_data [8]
 Array of 8 bytes representing the data of the CAN message.
 

Detailed Description

The CANMessage class represents a CAN message, containing an ID and data.

This class provides a structure to store and manipulate CAN messages, which include a 16-bit CAN identifier and up to 8 bytes of data.

Constructor & Destructor Documentation

◆ CANMessage() [1/2]

CANMessage::CANMessage ( )

Default constructor for CANMessage.

Initializes a CAN message with no specific CAN ID.

◆ CANMessage() [2/2]

CANMessage::CANMessage ( uint16_t t_canId)

Constructs a CANMessage with a specified CAN ID.

Parameters
t_canIdThe CAN ID to associate with this message.

Member Function Documentation

◆ getCanId()

uint16_t CANMessage::getCanId ( )

Retrieves the CAN ID of the message.

Returns
The CAN ID currently associated with the message.

◆ setCanId()

void CANMessage::setCanId ( uint16_t t_canId)

Sets the CAN ID of the message.

Parameters
t_canIdThe CAN ID to be set for this message.

Member Data Documentation

◆ m_data

uint8_t CANMessage::m_data[8]

Array of 8 bytes representing the data of the CAN message.


The documentation for this class was generated from the following files: