mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
mavlink static streams_list array
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user