mavlink static streams_list array

This commit is contained in:
Daniel Agar
2018-04-03 18:37:51 -04:00
parent 450229c2a4
commit f145b65cbb
4 changed files with 90 additions and 71 deletions
+4 -7
View File
@@ -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;
}
}