Apollo 10.0
自动驾驶开放平台
apollo::drivers::canbus::CanFrame类 参考

The class which defines the information to send and receive. 更多...

#include <can_client.h>

apollo::drivers::canbus::CanFrame 的协作图:

Public 成员函数

 CanFrame ()
 Constructor
 
std::string CanFrameString () const
 CanFrame string including essential information about the message.
 

Public 属性

uint32_t id
 Message id
 
uint8_t len
 Message length
 
uint8_t data [8]
 Message content
 
struct timeval timestamp
 Time stamp
 

详细描述

The class which defines the information to send and receive.

在文件 can_client.h48 行定义.

构造及析构函数说明

◆ CanFrame()

apollo::drivers::canbus::CanFrame::CanFrame ( )
inline

Constructor

在文件 can_client.h61 行定义.

61 : id(0), len(0), timestamp{0} {
62 std::memset(data, 0, sizeof(data));
63 }
uint8_t len
Message length
Definition can_client.h:52
struct timeval timestamp
Time stamp
Definition can_client.h:56
uint8_t data[8]
Message content
Definition can_client.h:54

成员函数说明

◆ CanFrameString()

std::string apollo::drivers::canbus::CanFrame::CanFrameString ( ) const
inline

CanFrame string including essential information about the message.

返回
The info string.

在文件 can_client.h69 行定义.

69 {
70 std::stringstream output_stream("");
71 output_stream << "id:0x" << Byte::byte_to_hex(id)
72 << ",len:" << static_cast<int>(len) << ",data:";
73 for (uint8_t i = 0; i < len; ++i) {
74 output_stream << Byte::byte_to_hex(data[i]);
75 }
76 output_stream << ",";
77 return output_stream.str();
78 }
static std::string byte_to_hex(const uint8_t value)
Transform an integer with the size of one byte to its hexadecimal represented by a string.
Definition byte.cc:42

类成员变量说明

◆ data

uint8_t apollo::drivers::canbus::CanFrame::data[8]

Message content

在文件 can_client.h54 行定义.

◆ id

uint32_t apollo::drivers::canbus::CanFrame::id

Message id

在文件 can_client.h50 行定义.

◆ len

uint8_t apollo::drivers::canbus::CanFrame::len

Message length

在文件 can_client.h52 行定义.

◆ timestamp

struct timeval apollo::drivers::canbus::CanFrame::timestamp

Time stamp

在文件 can_client.h56 行定义.


该类的文档由以下文件生成: