25using ::apollo::drivers::canbus::Byte;
30 Lincoln *chassis_detail)
const {
31 chassis_detail->mutable_safety()->set_front_left_tire_press(
32 front_left_tire(bytes, length));
33 chassis_detail->mutable_safety()->set_front_right_tire_press(
34 front_right_tire(bytes, length));
35 chassis_detail->mutable_safety()->set_rear_left_tire_press(
36 rear_left_tire(bytes, length));
37 chassis_detail->mutable_safety()->set_rear_right_tire_press(
38 rear_right_tire(bytes, length));
41int32_t Tirepressure71::front_left_tire(
const std::uint8_t *bytes,
42 int32_t length)
const {
43 Byte high_frame(bytes + 1);
44 int32_t high = high_frame.get_byte(0, 8);
45 Byte low_frame(bytes + 0);
46 int32_t low = low_frame.get_byte(0, 8);
47 return (high << 8) | low;
50int32_t Tirepressure71::front_right_tire(
const std::uint8_t *bytes,
51 int32_t length)
const {
52 Byte high_frame(bytes + 3);
53 int32_t high = high_frame.get_byte(0, 8);
54 Byte low_frame(bytes + 2);
55 int32_t low = low_frame.get_byte(0, 8);
56 return (high << 8) | low;
59int32_t Tirepressure71::rear_left_tire(
const std::uint8_t *bytes,
60 int32_t length)
const {
61 Byte high_frame(bytes + 5);
62 int32_t high = high_frame.get_byte(0, 8);
63 Byte low_frame(bytes + 4);
64 int32_t low = low_frame.get_byte(0, 8);
65 return (high << 8) | low;
68int32_t Tirepressure71::rear_right_tire(
const std::uint8_t *bytes,
69 int32_t length)
const {
70 Byte high_frame(bytes + 7);
71 int32_t high = high_frame.get_byte(0, 8);
72 Byte low_frame(bytes + 6);
73 int32_t low = low_frame.get_byte(0, 8);
74 return (high << 8) | low;
virtual void Parse(const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const
the class of Tirepressure71 (for lincoln vehicle)