36 uint8_t check_sum = 0;
39 for (
int i = 0; i < dataLength - 1; ++i) {
40 check_sum ^= sub_address[i];
43 if (check_sum == sub_address[dataLength - 1]) {
47 float pubMsg_gx = toValue<float>(sub_address, sub_index);
48 float m_msg_gx = pubMsg_gx;
49 float pubMsg_gy = toValue<float>(sub_address, sub_index);
50 float m_msg_gy = pubMsg_gy;
51 float pubMsg_gz = toValue<float>(sub_address, sub_index);
52 float m_msg_gz = pubMsg_gz;
55 float pubMsg_ax = toValue<float>(sub_address, sub_index);
56 float m_msg_ax = pubMsg_ax;
57 float pubMsg_ay = toValue<float>(sub_address, sub_index);
58 float m_msg_ay = pubMsg_ay;
59 float pubMsg_az = toValue<float>(sub_address, sub_index);
60 float m_msg_az = pubMsg_az;
63 middle = toValue<int16_t>(sub_address, sub_index);
64 float pubMsg_temperature = middle * 200.0 / 32768;
67 uint32_t timiddle = toValue<uint32_t>(sub_address, sub_index);
68 double time = timiddle * 2.5 * 0.0001;