{"id":21577825,"url":"https://github.com/foxzool/bevy_serialport","last_synced_at":"2025-04-10T17:28:14.345Z","repository":{"id":57750434,"uuid":"525632149","full_name":"foxzool/bevy_serialport","owner":"foxzool","description":"serial port Plugin for Bevy","archived":false,"fork":false,"pushed_at":"2024-10-23T05:45:26.000Z","size":36,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-16T18:31:04.466Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foxzool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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}},"created_at":"2022-08-17T03:57:16.000Z","updated_at":"2024-10-23T05:45:30.000Z","dependencies_parsed_at":"2024-10-23T10:27:49.920Z","dependency_job_id":"9f8dc49f-8e5c-490e-a559-dab557e3cd19","html_url":"https://github.com/foxzool/bevy_serialport","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"897586a203f35866e8bf586e6d5aab306fcd7d7a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fbevy_serialport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fbevy_serialport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fbevy_serialport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fbevy_serialport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foxzool","download_url":"https://codeload.github.com/foxzool/bevy_serialport/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226165763,"owners_count":17583856,"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-24T13:08:44.042Z","updated_at":"2024-11-24T13:08:44.607Z","avatar_url":"https://github.com/foxzool.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bevy_serialport\n\n[![Crates.io](https://img.shields.io/crates/v/bevy_serialport)](https://crates.io/crates/bevy_serialport)\n[![Downloads](https://img.shields.io/crates/d/bevy_serialport)](https://crates.io/crates/bevy_serialport)\n[![Documentation](https://docs.rs/bevy_serialport/badge.svg)](https://docs.rs/bevy_serialport)\n[![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/Seldom-SE/seldom_pixel#license)\n\n`bevy_serialport` is a plugin for add async serial port support for bevy.\n\n## Usage\n\n``` no_run\nuse bevy::{app::ScheduleRunnerPlugin, log::LogPlugin};\nuse std::time::Duration;\n\nuse bevy::prelude::*;\nuse bytes::Bytes;\n\n\nuse bevy_serialport::{\n    DataBits, FlowControl, Parity, SerialData, SerialPortPlugin, SerialPortRuntime,\n    SerialPortSetting, SerialResource, StopBits,\n};\n\n\nfn main() {\n    App::new()\n        .add_plugins((\n            MinimalPlugins.set(ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(\n                1.0 / 60.0,\n            ))),\n            LogPlugin::default(),\n            SerialPortPlugin,\n        ))\n        .add_systems(Startup, setup)\n        .add_systems(Update, (receive, send_test_data))\n        .run();\n}\n\nfn setup(mut serial_res: ResMut\u003cSerialResource\u003e, rt: Res\u003cSerialPortRuntime\u003e) {\n    let serial_setting = SerialPortSetting {\n        port_name: \"COM1\".to_string(),\n        baud_rate: 115_200,\n        data_bits: DataBits::Five,\n        flow_control: FlowControl::None,\n        parity: Parity::None,\n        stop_bits: StopBits::One,\n        timeout: Default::default(),\n    };\n    serial_res\n        .open_with_setting(rt.clone(), serial_setting)\n        .expect(\"open serial port error\");\n}\n\nfn receive(mut serial_ev: EventReader\u003cSerialData\u003e) {\n    for message in serial_ev.read() {\n        info!(\"receive {:?}\", message);\n    }\n}\n\nfn send_test_data(mut serial_res: ResMut\u003cSerialResource\u003e) {\n    serial_res.send_message(\"COM1\", Bytes::from(\u0026b\"123457\"[..]))\n}\n\n```\n\n## Supported Versions\n\n| bevy | bevy_serialport |\n|------|-----------------|\n| 0.15 | 0.8             |\n| 0.14 | 0.7             |\n| 0.13 | 0.6             |\n| 0.12 | 0.5             |\n| 0.11 | 0.4             |\n| 0.10 | 0.3             |\n| 0.9  | 0.2             |\n| 0.8  | 0.1             |\n\n## License\n\nDual-licensed under either\n\n- MIT\n- Apache 2.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxzool%2Fbevy_serialport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxzool%2Fbevy_serialport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxzool%2Fbevy_serialport/lists"}