mavlink static streams_list array

This commit is contained in:
Daniel Agar
2018-04-03 13:24:04 -04:00
parent 450229c2a4
commit f145b65cbb
4 changed files with 90 additions and 71 deletions

View File

@@ -1393,17 +1393,15 @@ Mavlink::configure_stream(const char *stream_name, const float rate)
return OK;
}
/* search for stream with specified name in supported streams list */
for (unsigned int i = 0; streams_list[i] != nullptr; i++) {
// search for stream with specified name in supported streams list
// create new instance if found
stream = create_mavlink_stream(stream_name, this);
if (strcmp(stream_name, streams_list[i]->get_name()) == 0) {
/* create new instance */
stream = streams_list[i]->new_instance(this);
stream->set_interval(interval);
LL_APPEND(_streams, stream);
if (stream != nullptr) {
stream->set_interval(interval);
LL_APPEND(_streams, stream);
return OK;
}
return OK;
}
/* if we reach here, the stream list does not contain the stream */