Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements #256.
Adds asynchronous connect method
async connect_async(address)
as async version ofconnect(address)
.For this the following is added when the
tokio-1
feature is enabled:mod async_connection
withconnect_async(..)
trait AsyncMavConnection
as[#[async_trait]
as an async verions oftrait MavConnection
AsyncFileConnection
,AsyncTcpConnection
,AsyncUdpConnection
implementingAsyncMavConnection
AsyncPeekReader
as async verions ofPeekReader
read_versioned_msg_async
,read_versioned_msg_async_signed
,read_v1_raw_message_async
,read_v1_msg_async
,read_v2_msg_async_signed
,write_versioned_msg_async_signed
,write_v2_msg_async_signed
read_v2_raw_message_async
,read_v2_raw_message_async_inner
,read_v2_raw_message_async_signed
,read_v2_msg_async
to read from aAsyncPeekReader
instead of directly for atokio::io::AsyncReadExt
connect_async
is exposed asmavlink::connect_async
Tests:
AsyncUdpConnection
tests datagram_buffering similar to its blocking siblingtokio
featuresrt
,macros
are needed, for this reasontokio
with these additional features is required asdev-dependencies
for bothmavlink-core
andmavlink
Caveats
AsyncPeekReader
fromtokio::io::AsyncReadExt
is breakingwrite_versioned_msg
,write_versioned_msg_signed
,write_versioned_msg_async
andwrite_versioned_msg_async_signed
)