{"id":17994966,"url":"https://github.com/totalkrill/serial_frame","last_synced_at":"2025-07-26T03:08:31.359Z","repository":{"id":57666797,"uuid":"225587487","full_name":"TotalKrill/serial_frame","owner":"TotalKrill","description":"Simple serial framer built in rust","archived":false,"fork":false,"pushed_at":"2020-01-13T12:08:49.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-30T17:08:01.790Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TotalKrill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-03T10:01:29.000Z","updated_at":"2020-11-13T06:34:09.000Z","dependencies_parsed_at":"2022-09-02T14:22:56.431Z","dependency_job_id":null,"html_url":"https://github.com/TotalKrill/serial_frame","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TotalKrill/serial_frame","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotalKrill%2Fserial_frame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotalKrill%2Fserial_frame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotalKrill%2Fserial_frame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotalKrill%2Fserial_frame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TotalKrill","download_url":"https://codeload.github.com/TotalKrill/serial_frame/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotalKrill%2Fserial_frame/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267109974,"owners_count":24037629,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-29T20:17:22.158Z","updated_at":"2025-07-26T03:08:31.331Z","avatar_url":"https://github.com/TotalKrill.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# SerialFrame\n\n[![Latest version](https://img.shields.io/crates/v/serial_frame.svg)](https://crates.io/crates/serial_frame)\n![License](https://img.shields.io/crates/l/serial_frame.svg)\n\nSimple serialport frame reciever, that asynchrounous sends chunks of bytes over an mpsc channel.\nthe chunks are sent with the chosen delimiter.\n\nCan be used to recieve lines over serialports in an asynchronous manner, or to recieve cobs messages, or custom parsing to whatever type you want from the chunks\n\nSee the example for an example usage for just receiving lines\n\n## Example\n\n```rust\nuse serialport::prelude::*;\nuse simple_logger;\nuse std::sync::mpsc::*;\nuse std::time::Duration;\n\nuse serial_frame::{create_line_sender, Line, SerialFrameError, SerialFrameSender};\n\nfn main() {\n    // Setup the serialport to act on\n    let serialport: Box\u003cdyn SerialPort\u003e = init();\n\n    // get a Reciever for strings that all end with a newline\n    let (rx, linestop) = create_line_sender(serialport).unwrap();\n\n    // Recieve the lines, stop if timeout\n    while let Ok(line) = rx.recv_timeout(Duration::from_secs(2)) {\n        // Inspect the received line\n        match line {\n            Ok(line) =\u003e {\n                println!(\"line is: {}\", line);\n            }\n            Err(e) =\u003e {\n                println!(\"Error: {:?}\", e);\n            }\n        }\n    }\n    // This will end the thread if it not stopped\n    let e = linestop.stop();\n    println!(\"Stop: {:?}\", e);\n}\n\nfn init() -\u003e Box\u003cdyn SerialPort\u003e {\n    simple_logger::init_with_level(log::Level::Debug).unwrap();\n\n    let mut settings: SerialPortSettings = Default::default();\n    settings.timeout = Duration::from_millis(100);\n    let baudrate = 115200;\n    settings.baud_rate = baudrate;\n    let serialport = serialport::open_with_settings(\"/dev/ttyACM0\", \u0026settings).unwrap();\n    serialport\n}\n\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotalkrill%2Fserial_frame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftotalkrill%2Fserial_frame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotalkrill%2Fserial_frame/lists"}