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

one of the protocol data of lincoln vehicle 更多...

#include <version_7f.h>

类 apollo::canbus::lincoln::Version7f 继承关系图:
apollo::canbus::lincoln::Version7f 的协作图:

Public 成员函数

virtual void Parse (const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const
 
int32_t module_name (const std::uint8_t *bytes, int32_t length) const
 get module name based on byte array.
 
int32_t major_version (const std::uint8_t *bytes, int32_t length) const
 get major version based on byte array.
 
int32_t minor_version (const std::uint8_t *bytes, int32_t length) const
 get minor version based on byte array.
 
int32_t build_number (const std::uint8_t *bytes, int32_t length) const
 get build number based on byte array.
 
- Public 成员函数 继承自 apollo::drivers::canbus::ProtocolData< ::apollo::canbus::Lincoln >
 ProtocolData ()=default
 construct protocol data.
 
virtual ~ProtocolData ()=default
 destruct protocol data.
 
virtual uint32_t GetPeriod () const
 
virtual int32_t GetLength () const
 
virtual void Parse (const uint8_t *bytes, int32_t length, ::apollo::canbus::Lincoln *sensor_data) const
 
virtual void UpdateData (uint8_t *data)
 
virtual void UpdateData_Heartbeat (uint8_t *data)
 
virtual void Reset ()
 

静态 Public 属性

static const int32_t ID = 0x7f
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 apollo::drivers::canbus::ProtocolData< ::apollo::canbus::Lincoln >
static std::uint8_t CalculateCheckSum (const uint8_t *input, const uint32_t length)
 static function, used to calculate the checksum of input array.
 
static T BoundedValue (T lower, T upper, T val)
 

详细描述

one of the protocol data of lincoln vehicle

在文件 version_7f.h40 行定义.

成员函数说明

◆ build_number()

int32_t apollo::canbus::lincoln::Version7f::build_number ( const std::uint8_t *  bytes,
int32_t  length 
) const

get build number based on byte array.

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of build number

在文件 version_7f.cc88 行定义.

89 {
90 Byte frame_high(bytes + 7);
91 int32_t high = frame_high.get_byte(0, 8);
92 Byte frame_low(bytes + 6);
93 int32_t low = frame_low.get_byte(0, 8);
94 int32_t value = (high << 8) | low;
95 return value;
96}

◆ major_version()

int32_t apollo::canbus::lincoln::Version7f::major_version ( const std::uint8_t *  bytes,
int32_t  length 
) const

get major version based on byte array.

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of major version

在文件 version_7f.cc68 行定义.

69 {
70 Byte frame_high(bytes + 3);
71 int32_t high = frame_high.get_byte(0, 8);
72 Byte frame_low(bytes + 2);
73 int32_t low = frame_low.get_byte(0, 8);
74 int32_t value = (high << 8) | low;
75 return value;
76}

◆ minor_version()

int32_t apollo::canbus::lincoln::Version7f::minor_version ( const std::uint8_t *  bytes,
int32_t  length 
) const

get minor version based on byte array.

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of minor version

在文件 version_7f.cc78 行定义.

79 {
80 Byte frame_high(bytes + 5);
81 int32_t high = frame_high.get_byte(0, 8);
82 Byte frame_low(bytes + 4);
83 int32_t low = frame_low.get_byte(0, 8);
84 int32_t value = (high << 8) | low;
85 return value;
86}

◆ module_name()

int32_t apollo::canbus::lincoln::Version7f::module_name ( const std::uint8_t *  bytes,
int32_t  length 
) const

get module name based on byte array.

参数
bytesa pointer to the byte array
lengththe length of the byte array
返回
the value of byte input

在文件 version_7f.cc61 行定义.

62 {
63 Byte frame(bytes + 0);
64 int32_t x = frame.get_byte(0, 8);
65 return x; // 0x03 means Steering/Shifter, otherwise ignore
66}

◆ Parse()

void apollo::canbus::lincoln::Version7f::Parse ( const std::uint8_t *  bytes,
int32_t  length,
Lincoln chassis_detail 
) const
virtual

在文件 version_7f.cc29 行定义.

30 {
31 switch (module_name(bytes, length)) {
32 case 0x01:
33 chassis_detail->mutable_brake()->set_major_version(
34 major_version(bytes, length));
35 chassis_detail->mutable_brake()->set_minor_version(
36 minor_version(bytes, length));
37 chassis_detail->mutable_brake()->set_build_number(
38 build_number(bytes, length));
39 break;
40 case 0x02:
41 chassis_detail->mutable_gas()->set_major_version(
42 major_version(bytes, length));
43 chassis_detail->mutable_gas()->set_minor_version(
44 minor_version(bytes, length));
45 chassis_detail->mutable_gas()->set_build_number(
46 build_number(bytes, length));
47 break;
48 case 0x03:
49 chassis_detail->mutable_eps()->set_major_version(
50 major_version(bytes, length));
51 chassis_detail->mutable_eps()->set_minor_version(
52 minor_version(bytes, length));
53 chassis_detail->mutable_eps()->set_build_number(
54 build_number(bytes, length));
55 break;
56 default:
57 break;
58 }
59}
int32_t build_number(const std::uint8_t *bytes, int32_t length) const
get build number based on byte array.
Definition version_7f.cc:88
int32_t module_name(const std::uint8_t *bytes, int32_t length) const
get module name based on byte array.
Definition version_7f.cc:61
int32_t minor_version(const std::uint8_t *bytes, int32_t length) const
get minor version based on byte array.
Definition version_7f.cc:78
int32_t major_version(const std::uint8_t *bytes, int32_t length) const
get major version based on byte array.
Definition version_7f.cc:68

类成员变量说明

◆ ID

const int32_t apollo::canbus::lincoln::Version7f::ID = 0x7f
static

在文件 version_7f.h43 行定义.


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