{"id":19601403,"url":"https://github.com/aerorust/sbus-rs","last_synced_at":"2025-05-12T21:47:16.901Z","repository":{"id":238924329,"uuid":"796435834","full_name":"AeroRust/sbus-rs","owner":"AeroRust","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-15T13:34:12.000Z","size":132,"stargazers_count":4,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-11T06:55:45.928Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AeroRust.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-05T23:13:33.000Z","updated_at":"2025-04-14T14:03:30.000Z","dependencies_parsed_at":"2024-11-07T19:02:25.023Z","dependency_job_id":"4be4600c-481d-4bd2-a5c3-0ca7b5483b80","html_url":"https://github.com/AeroRust/sbus-rs","commit_stats":null,"previous_names":["aerorust/sbus-rs","ragarnoy/sbus-rs"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AeroRust%2Fsbus-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AeroRust%2Fsbus-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AeroRust%2Fsbus-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AeroRust%2Fsbus-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AeroRust","download_url":"https://codeload.github.com/AeroRust/sbus-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253829901,"owners_count":21970988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T09:18:18.073Z","updated_at":"2025-05-12T21:47:16.879Z","avatar_url":"https://github.com/AeroRust.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sbus-rs\n\n[![Crates.io](https://img.shields.io/crates/v/sbus-rs.svg)](https://crates.io/crates/sbus-rs)\n[![Documentation](https://docs.rs/sbus-rs/badge.svg)](https://docs.rs/sbus-rs)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA no_std compatible Rust implementation of the SBUS (Serial Bus) protocol parser, commonly used in RC (Radio Control) applications. Part of the [AeroRust](https://github.com/AeroRust) organization, dedicated to aerospace-related software in Rust.\n\n## Features\n\n- 🦀 Pure Rust implementation\n- 🚫 `no_std` compatible for embedded systems\n- ⚡ Async and blocking IO support\n- 🔍 Robust error handling and validation\n- 🧪 Thoroughly tested with unit tests, property-based tests, and fuzzing\n- 📊 Benchmarked for performance optimization\n- 🛠️ Zero-copy parsing for efficient memory usage\n\n## Installation\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nsbus-rs = \"0.1.0\"\n```\n\nFor async support:\n```toml\n[dependencies]\nsbus-rs = { version = \"0.1.0\", features = [\"async\"] }\n```\n\n## Usage\n\n### Blocking Example\n\n```rust\nuse sbus_rs::{SbusParser, SbusError};\nuse embedded_io_adapters::std::FromStd;\n\nfn main() -\u003e Result\u003c(), SbusError\u003e {\n    let serial = /* your serial port */;\n    let mut parser = SbusParser::new(FromStd::new(serial));\n    \n    // Read a single SBUS frame\n    let frame = parser.read_frame()?;\n    \n    // Access channel values (0-2047)\n    println!(\"Channel 1: {}\", frame.channels[0]);\n    \n    // Check flags\n    if frame.flags.failsafe {\n        println!(\"Failsafe active!\");\n    }\n    \n    Ok(())\n}\n```\n\n### Async Example\n\n```rust\nuse sbus_rs::{SbusParserAsync, SbusError};\nuse embedded_io_adapters::tokio_1::FromTokio;\n\nasync fn read_sbus() -\u003e Result\u003c(), SbusError\u003e {\n    let serial = /* your async serial port */;\n    let mut parser = SbusParserAsync::new(FromTokio::new(serial));\n    \n    // Read frames asynchronously\n    let frame = parser.read_frame().await?;\n    \n    println!(\"Channels: {:?}\", frame.channels);\n    println!(\"Frame lost: {}\", frame.flags.frame_lost);\n    \n    Ok(())\n}\n```\n\n## Protocol Details\n\nSBUS frames consist of:\n- Start byte (0x0F)\n- 22 bytes of channel data (16 channels, 11 bits each)\n- 1 byte of flags\n- End byte (0x00)\n\nChannel values range from 0 to 2047 (11 bits).\n\nFlag bits:\n- Digital Channel 1\n- Digital Channel 2\n- Frame Lost\n- Failsafe Active\n\n## Performance\n\nThe library is optimized for performance with careful consideration of:\n- Zero-copy parsing\n- Efficient bit manipulation\n- Minimal allocations\n- Vectorization opportunities\n\nBenchmarks are available and can be run with:\n```bash\ncargo bench\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. Make sure to:\n\n1. Run the full test suite: `cargo test --all-features`\n2. Run benchmarks: `cargo bench`\n3. Run clippy: `cargo clippy --all-features`\n4. Format code: `cargo fmt`\n\n## Safety\n\nThe crate uses safe Rust and includes:\n- Miri checks for undefined behavior\n- Memory sanitizer tests\n- Fuzzing tests\n- Property-based testing\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE.txt) file for details.\n\n## Acknowledgments\n\nPart of the [AeroRust](https://github.com/AeroRust) organization, promoting the use of Rust in aerospace applications.\n\nSpecial thanks to:\n- The AeroRust community\n- Contributors and maintainers\n- The Rust embedded community","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerorust%2Fsbus-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faerorust%2Fsbus-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerorust%2Fsbus-rs/lists"}