24using ::apollo::drivers::canbus::Byte;
27inline T ByteTo(
const Byte&
byte) {
28 return static_cast<T
>(
byte.get_byte(0, 8));
31inline std::string ByteToString(
const Byte&
byte) {
32 return std::string(1, ByteTo<char>(
byte));
43 vin_part0_flag_(false),
44 vin_part1_flag_(false),
45 vin_part2_flag_(false),
46 parse_success_(false) {}
49 Lincoln* chassis_detail)
const {
50 if (!parse_success_) {
51 switch (
mux(bytes, length)) {
53 vin_part0_ =
vin00(bytes, length) +
vin01(bytes, length) +
56 vin_part0_flag_ =
true;
59 vin_part1_ =
vin06(bytes, length) +
vin07(bytes, length) +
62 vin_part1_flag_ =
true;
65 vin_part2_ =
vin12(bytes, length) +
vin13(bytes, length) +
68 vin_part2_flag_ =
true;
72 if (vin_part0_flag_ && vin_part1_flag_ && vin_part2_flag_) {
73 parse_success_ =
true;
74 chassis_detail->mutable_vehicle_id()->set_vin(
75 (vin_part0_ + vin_part1_ + vin_part2_));
84 Byte frame(bytes + 0);
85 return ByteTo<int>(frame);
92 Byte frame(bytes + 1);
93 return frame.is_bit_1(0);
100 Byte frame(bytes + 1);
101 return frame.is_bit_1(1);
108 Byte frame(bytes + 1);
109 return frame.is_bit_1(2);
117 Byte frame(bytes + 2);
118 return frame.is_bit_1(0);
125 Byte frame(bytes + 2);
126 return ByteTo<int>(frame);
133 Byte frame(bytes + 2);
134 return ByteTo<int>(frame);
141 Byte frame(bytes + 2);
142 return ByteTo<int>(frame);
149 Byte frame(bytes + 2);
150 return ByteToString(frame);
157 Byte frame(bytes + 2);
158 return ByteToString(frame);
165 Byte frame(bytes + 2);
166 return ByteToString(frame);
174 Byte frame(bytes + 2);
175 return frame.is_bit_1(1);
182 Byte frame(bytes + 3);
183 return ByteTo<int>(frame);
190 Byte frame(bytes + 3);
191 return ByteTo<int>(frame);
198 Byte frame(bytes + 3);
199 return ByteTo<int>(frame);
206 Byte frame(bytes + 3);
207 return ByteToString(frame);
214 Byte frame(bytes + 3);
215 return ByteToString(frame);
222 Byte frame(bytes + 3);
223 return ByteToString(frame);
230 Byte frame(bytes + 4);
231 return ByteTo<int>(frame);
238 Byte frame(bytes + 4);
239 return ByteTo<int>(frame);
246 Byte frame(bytes + 4);
247 return ByteTo<int>(frame);
254 Byte frame(bytes + 4);
255 return ByteToString(frame);
262 Byte frame(bytes + 4);
263 return ByteToString(frame);
270 Byte frame(bytes + 4);
271 return ByteToString(frame);
281 int x = t0.get_byte(0, 8);
283 int t = t1.get_byte(0, 8);
293 Byte frame(bytes + 5);
294 return ByteTo<int>(frame);
301 Byte frame(bytes + 5);
302 return ByteTo<int>(frame);
309 Byte frame(bytes + 5);
310 return ByteTo<int>(frame);
317 Byte frame(bytes + 5);
318 return ByteToString(frame);
325 Byte frame(bytes + 5);
326 return ByteToString(frame);
333 Byte frame(bytes + 5);
334 return ByteToString(frame);
341 Byte frame(bytes + 6);
342 return ByteTo<int>(frame);
349 Byte frame(bytes + 6);
350 return ByteTo<int>(frame);
357 Byte frame(bytes + 6);
358 return ByteToString(frame);
365 Byte frame(bytes + 6);
366 return ByteToString(frame);
373 Byte frame(bytes + 6);
374 return ByteToString(frame);
384 int x = t0.get_byte(0, 8);
386 int t = t1.get_byte(0, 8);
396 Byte frame(bytes + 7);
397 return ByteTo<int>(frame);
404 Byte frame(bytes + 7);
405 return ByteTo<int>(frame);
412 Byte frame(bytes + 7);
413 return ByteToString(frame);
420 Byte frame(bytes + 7);
421 return ByteToString(frame);
int mac2(const std::uint8_t *bytes, int length) const
int date2(const std::uint8_t *bytes, int length) const
std::string vin01(const std::uint8_t *bytes, int length) const
bool is_feat_base_trial(const std::uint8_t *bytes, int length) const
bool is_trial(const std::uint8_t *bytes, int length) const
std::string vin06(const std::uint8_t *bytes, int length) const
std::string vin05(const std::uint8_t *bytes, int length) const
int mac5(const std::uint8_t *bytes, int length) const
int date1(const std::uint8_t *bytes, int length) const
std::string vin04(const std::uint8_t *bytes, int length) const
std::string vin08(const std::uint8_t *bytes, int length) const
bool is_expired(const std::uint8_t *bytes, int length) const
std::string vin16(const std::uint8_t *bytes, int length) const
std::string vin00(const std::uint8_t *bytes, int length) const
std::string vin12(const std::uint8_t *bytes, int length) const
std::string vin15(const std::uint8_t *bytes, int length) const
int date8(const std::uint8_t *bytes, int length) const
std::string vin02(const std::uint8_t *bytes, int length) const
std::string vin14(const std::uint8_t *bytes, int length) const
int date5(const std::uint8_t *bytes, int length) const
bool is_ready(const std::uint8_t *bytes, int length) const
std::string vin13(const std::uint8_t *bytes, int length) const
int date3(const std::uint8_t *bytes, int length) const
virtual void Parse(const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const
std::string vin10(const std::uint8_t *bytes, int length) const
int date6(const std::uint8_t *bytes, int length) const
int feat_base_trials_remaining(const std::uint8_t *bytes, int length) const
int date9(const std::uint8_t *bytes, int length) const
int date4(const std::uint8_t *bytes, int length) const
int date0(const std::uint8_t *bytes, int length) const
std::string vin07(const std::uint8_t *bytes, int length) const
int mac4(const std::uint8_t *bytes, int length) const
std::string vin03(const std::uint8_t *bytes, int length) const
bool is_feat_base_enabled(const std::uint8_t *bytes, int length) const
int date7(const std::uint8_t *bytes, int length) const
int mac0(const std::uint8_t *bytes, int length) const
int feat_base_trials_used(const std::uint8_t *bytes, int length) const
int mac3(const std::uint8_t *bytes, int length) const
int mux(const std::uint8_t *bytes, int length) const
std::string vin11(const std::uint8_t *bytes, int length) const
std::string vin09(const std::uint8_t *bytes, int length) const
int mac1(const std::uint8_t *bytes, int length) const