mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-13 14:51:37 +08:00
mavlink static streams_list array
This commit is contained in:
@@ -1759,14 +1759,11 @@ MavlinkReceiver::set_message_interval(int msgId, float interval, int data_rate)
|
||||
// The interval between two messages is in microseconds.
|
||||
// Set to -1 to disable and 0 to request default rate
|
||||
if (msgId != 0) {
|
||||
for (unsigned int i = 0; streams_list[i] != nullptr; i++) {
|
||||
const StreamListItem *item = streams_list[i];
|
||||
const char *stream_name = get_stream_name(msgId);
|
||||
|
||||
if (msgId == item->get_id()) {
|
||||
_mavlink->configure_stream_threadsafe(item->get_name(), rate);
|
||||
found_id = true;
|
||||
break;
|
||||
}
|
||||
if (stream_name != nullptr) {
|
||||
_mavlink->configure_stream_threadsafe(stream_name, rate);
|
||||
found_id = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user