mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-08 23:31:37 +08:00
Robustify RTPS bridge stream parsing.
This commit is contained in:
committed by
Daniel Agar
parent
089fbdccc9
commit
cd66a262ee
@@ -364,10 +364,14 @@ int main(int argc, char **argv)
|
||||
if (!receiving) { start = std::chrono::steady_clock::now(); }
|
||||
|
||||
// Publish messages received from UART
|
||||
if (0 < (length = transport_node->read(&topic_ID, data_buffer, BUFFER_SIZE))) {
|
||||
length = transport_node->read();
|
||||
if (length > 0) {
|
||||
total_read += length;
|
||||
}
|
||||
|
||||
while (transport_node->parse(&topic_ID, data_buffer, BUFFER_SIZE)) {
|
||||
topics->publish(topic_ID, data_buffer, sizeof(data_buffer));
|
||||
++received;
|
||||
total_read += length;
|
||||
receiving = true;
|
||||
end = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user