commit | 42955e2a200acb81007c67251964f3874b6f2d93 | [log] [tgz] |
---|---|---|
author | Henri Chataing <[email protected]> | Thu Oct 19 15:34:32 2023 +0000 |
committer | Henri Chataing <[email protected]> | Mon Oct 23 17:10:44 2023 +0000 |
tree | 19bc6fbb8b36697fc0c5352fc51cc233385b885c | |
parent | 18ee7a9e1cce70a3839dd2a519d3c1301d682b2c [diff] |
Import platform/external/rust/crates/pdl-runtime Bug: 306901204 Change-Id: I551d341a021724ef2ada39b46f84e780fe1fc930
PDL is a domain specific language for writing the definition of binary protocol packets. Parsing and validating packets from raw bytes is tedious and error prone in any language. PDL generates memory safe and tailored backends for multiple target languages:
- Rust - C++ - Python
Historically PDL was developed as part of the Android Bluetooth stack (bluetooth_packetgen) as a way to generate the parser and serializer for Bluetooth packets, and reduce the number of memory safety issues that come with manipulating and validating raw data.
cargo run my-protocol.pdl --output-format rust > my-protocol.rs
Language specific instructions are provided for all supported backends: