File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1002,9 +1002,16 @@ struct BatchReadFromSensorResponse
1002
1002
bit_utils::int_to_bytes (static_cast <uint8_t >(sensor), iter, limit);
1003
1003
iter = bit_utils::int_to_bytes (static_cast <uint8_t >(sensor_id), iter,
1004
1004
limit);
1005
+ iter = bit_utils::int_to_bytes (static_cast <uint8_t >(data_length), iter,
1006
+ limit);
1005
1007
for (auto i = 0 ; i < data_length; i++) {
1006
1008
iter = bit_utils::int_to_bytes (sensor_data.at (i), iter, limit);
1007
1009
}
1010
+ // Since python expects statically sized messages to unpack, pad the end
1011
+ // with 0's
1012
+ for (auto i = data_length; i < BATCH_SENSOR_MAX_LEN; i++) {
1013
+ iter = bit_utils::int_to_bytes (int32_t (0 ), iter, limit);
1014
+ }
1008
1015
return iter - body;
1009
1016
}
1010
1017
auto operator ==(const BatchReadFromSensorResponse& other) const
You can’t perform that action at this time.
0 commit comments