divyanshupundir / mavlink-kotlin

A modern MAVLink library for Kotlin Multiplatform.
https://divyanshupundir.github.io/mavlink-kotlin/
Apache License 2.0
46 stars 7 forks source link

Help with Serial Connection #94

Closed dxkruse closed 1 month ago

dxkruse commented 1 month ago

Does this repo support usb serial connections or only UDP/TCP?

divyanshupundir commented 1 month ago

@dxkruse, the connection-core module is designed so that users can implement their own connections for any platform. The important classes for this are AbstractMavConnection and BufferedMavConnection.

As an example, you can have a look at the JvmTcpClientMavConnection implementation.

In short, your SerialMavConnection will need to extend the AbstractMavConnection and override the open() method. It needs to return a BufferedMavConnection which will be created using your serial port.

BufferedMavConnection requires BufferedSource, BufferedSink and a Closeable callback to help close the port.

dxkruse commented 1 month ago

Awesome, thank you for pointing me in the right direction!

divyanshupundir commented 1 month ago

@dxkruse, should I close this issue if you were able to solve the problem?