{"id":21745093,"url":"https://github.com/zpg6/lin-ldf","last_synced_at":"2026-01-31T05:34:05.644Z","repository":{"id":259115037,"uuid":"876436558","full_name":"zpg6/lin-ldf","owner":"zpg6","description":"Rust parser for LDF files that describe automotive LIN bus networks.","archived":false,"fork":false,"pushed_at":"2025-07-26T17:51:09.000Z","size":184,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-08T18:25:09.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://zpg6.github.io/lin-ldf/","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/zpg6.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-22T00:58:30.000Z","updated_at":"2025-07-26T17:51:13.000Z","dependencies_parsed_at":"2024-10-27T20:05:48.166Z","dependency_job_id":"23d7551f-9678-4c14-b133-64483e1e2ca6","html_url":"https://github.com/zpg6/lin-ldf","commit_stats":null,"previous_names":["zpg6/lin-ldf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zpg6/lin-ldf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpg6%2Flin-ldf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpg6%2Flin-ldf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpg6%2Flin-ldf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpg6%2Flin-ldf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zpg6","download_url":"https://codeload.github.com/zpg6/lin-ldf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpg6%2Flin-ldf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28930405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T04:05:25.756Z","status":"ssl_error","status_checked_at":"2026-01-31T04:02:35.005Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-11-26T07:13:38.485Z","updated_at":"2026-01-31T05:34:05.638Z","avatar_url":"https://github.com/zpg6.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lin-ldf\n\n\u003cbr\u003e\n\u003ca href=\"https://crates.io/crates/lin-ldf\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/v/lin-ldf.svg\" alt=\"Crates.io\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://docs.rs/lin-ldf\"\u003e\n    \u003cimg src=\"https://docs.rs/lin-ldf/badge.svg\" alt=\"Documentation\"\u003e\n\u003c/a\u003e\n\u003ca href=\"\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\"\u003e\n\u003c/a\u003e\n\u003cbr\u003e\u003cbr\u003e\n\nLIN Description File (.ldf) parser using Rust's `nom` parser combinator library. LIN is an automotive serial protocol used for communication between ECUs in a vehicle. The LDF file is used to describe the network configuration, including the different nodes and signals sent between them.\n\n\u003e [!WARNING]\n\u003e This crate may not be suitable for production use. It was written as hands-on learning exercise of a well-documented specification. It may not cover all edge cases or vendor-specific implementations. Please use with caution.\n\nThis parser attempts to be a simple reflection of the well-documented instructions from the LIN specification: https://www.lin-cia.org/fileadmin/microsites/lin-cia.org/resources/documents/LIN_2.2A.pdf\n\n## Alternatives\n\nThere are some existing alternatives that have been around for years if you need something more robust:\n\n- https://github.com/c4deszes/ldfparser (Python) (**most popular**)\n- https://github.com/uCAN-LIN/LinUSBConverter/tree/master/python_lib (Python)\n- https://github.com/TrippW/LDF-Parser (Python)\n- https://bitbucket.org/tobylorenz/lin/src/master/ (C++)\n\nHere are more recent alternatives:\n\n- https://github.com/dragonlock2/autodbconv (Rust)\n\n## Features\n\n- [x] Serde\n- [x] WASM sub-crate\n- [x] WASM NPM package\n\n## NPM package\n\n[![NPM Version](https://img.shields.io/npm/v/lin-ldf)](https://www.npmjs.com/package/lin-ldf)\n[![NPM Downloads](https://img.shields.io/npm/dt/lin-ldf)](https://www.npmjs.com/package/lin-ldf)\n[![License: MIT](https://img.shields.io/npm/l/lin-ldf)](https://opensource.org/licenses/MIT)\n\n```bash\nnpm install lin-ldf\n```\n\nSee [wasm/README.md](wasm/README.md) for more details.\n\n## Supported LDF sections (so far)\n\n- [x] LIN_protocol_version\n- [x] LIN_language_version\n- [x] LIN_speed\n- [x] (Channel_name)\n- [x] Nodes\n- [ ] (Node_composition)\n- [x] Signals\n- [x] (Diagnostic_signals)\n- [x] Frames\n- [ ] (Sporadic_frame)\n- [ ] (Event_triggered_frame)\n- [x] (Diagnostic_frames)\n- [x] Node_attributes\n- [x] Schedule_table\n- [ ] (Signal_groups)\n- [x] (Signal_encoding_type)\n- [x] (Signal_representation)\n\n(optional sections are in parentheses)\n\n\u003e [!TIP]\n\u003e It would be difficult to plan for all edge cases in vendor-specific implementations, so this just tries to follow the specification. CONTRIBUTIONS ARE WELCOMED! You can always open an issue or a PR if you find something that doesn't work as expected - but be sure to anonymize the data if it's proprietary (or just don't share it).\n\n## WebAssembly Demo\n\nThere's also a WebAssembly version that runs in the browser!\n\n🚀 **[Try the live demo](https://zpg6.github.io/lin-ldf/)** - Check out `lin-ldf` with no installation required!\n\nOr run it locally in the `wasm/` directory:\n\n```bash\n# Build the WASM module\ncd wasm\n./build.sh\n\n# Run the demo\npython3 -m http.server 8000\n# Then open http://localhost:8000\n```\n\nPerfect for quickly validating LDF files or exploring the parser's capabilities without installing!\n\n# Example\n\nHere's how you can parse an LDF file and access the parsed data for your use case:\n\n```rust\nuse lin_ldf::parse_ldf;\n\nlet ldf = r#\"\nLIN_description_file ;\nLIN_protocol_version = \"2.1\" ;\nLIN_language_version = \"2.1\" ;\nLIN_speed = 19.2 kbps ;\n\n/* PARSING IGNORES BLOCK COMMENTS */\n// AND LINE COMMENTS\n\nNodes {\n    Master: Master, 5 ms, 0.1 ms ;\n    Slaves: Slave1, Slave2, Slave3 ;\n}\n\nSignals {\n    Signal1: 10, 0, Master, Slave1 , Slave2 ;\n    Signal2: 10, 0, Master, Slave1 ;\n    Signal3: 10, 0, Slave1, Master ;\n    Signal4: 10, 0, Slave1, Master ;\n    Signal5: 2, 0, Slave1, Master ;\n    Signal6: 1, 0, Slave1, Master ;\n}\n\nFrames {\n    Frame1: 0, Master, 8 {\n        Signal1, 0 ;\n        Signal2, 10 ;\n    }\n    Frame2: 0x16, Slave1, 8 {\n        Signal3, 0 ;\n        Signal4, 10 ;\n    }\n}\n\nNode_attributes {\n   Slave1 {\n       LIN_protocol = \"2.1\" ;\n       configured_NAD = 0xB ;\n       initial_NAD = 0xB ;\n       product_id = 0x123, 0x4567, 8 ;\n       response_error = Signal1 ;\n       P2_min = 100 ms ;\n       ST_min = 0 ms ;\n       N_As_timeout = 1000 ms ;\n       N_Cr_timeout = 1000 ms ;\n       configurable_frames {\n           Frame1 ;\n           Frame2 ;\n       }\n   }\n   Slave2 {\n       LIN_protocol = \"2.1\" ;\n       configured_NAD = 0xC ;\n       initial_NAD = 0xC ;\n       product_id = 0x124, 0x4568, 0x66 ;\n       response_error = Signal2 ;\n       P2_min = 100 ms ;\n       ST_min = 0 ms ;\n       N_As_timeout = 1000 ms ;\n       N_Cr_timeout = 1000 ms ;\n       configurable_frames {\n           Frame1 ;\n           Frame2 ;\n       }\n   }\n}\n\nSchedule_tables {\n    AllFrames {\n        Frame1 delay 10 ms ;\n        Frame2 delay 10 ms ;\n    }\n}\n\"#;\n\nlet parsed_ldf = parse_ldf(ldf).expect(\"Failed to parse LDF file\");\n\nprintln!(\"LIN Version: {}\", parsed_ldf.lin_protocol_version); // 2.1\nprintln!(\"LIN Speed: {}\", parsed_ldf.lin_speed); // 19200\n\nfor frame in parsed_ldf.frames {\n    println!(\"Frame: `{}` is {} bytes long\", frame.frame_name, frame.frame_size);\n    for signal in frame.signals {\n        println!(\"\\tSignal: `{}` at bit position {}\", signal.signal_name, signal.start_bit);\n    }\n}\n```\n\n## License\n\n[MIT](./LICENSE)\n\n## Contributing\n\nContributions are welcome! Whether it's bug fixes, feature additions, or documentation improvements, we appreciate your help in making this project better. For major changes or new features, please open an issue first to discuss what you would like to change.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzpg6%2Flin-ldf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzpg6%2Flin-ldf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzpg6%2Flin-ldf/lists"}