mariano-f-r / parse_rc_ibus

A Rust crate meant for parsing FlySky IBUS packets from a UART.
MIT License
2 stars 0 forks source link

IBUS Parser

A basic parser for the IBUS RC protocol, written in Rust. Ideal for decoding channel data in radio-controlled systems and other applications using the IBUS protocol. MSRV is 1.81.

Features

Installation

Add parse_rc_ibus to your Cargo.toml:

[dependencies]
parse_rc_ibus = "0.1.0"

Then, in your Rust code:

use parse_rc_ibus::IbusPacket;

Usage

Parsing an IBUS Packet

To parse an IBUS packet, pass the byte array to IbusPacket::try_from_bytes(). This will return the parsed packet or an error if the data is invalid.

let buffer [u8; 32] = [...];
let packet = IbusPacket::try_from_bytes(&buffer);

Note

You will have to sync the UART manually. This can be done by iterating byte by byte until you see the IBUS header, then skipping the next packet.

Contributing

Any and all contributions are welcome.

Branching

If you choose to contribute, when forking the repository and naming your branch, follow the below table. Type Branch Prefix
Bugfix fix/
Feature feat/
Chore chore/

One final note on branches: the main branch should always compile, so changes will not be merged unless they also compile.

Commits

In regards to commits, conventional commits should be used for merge/squash commits. Otherwise, keep your commits concise and understandable. No emojis.

Issues

When writing an issue, follow these guidelines:

License

MIT License. See LICENSE for more details.