commit | 94b1963144022397152f4fcb67a01c22c1f8da17 | [log] [tgz] |
---|---|---|
author | Henri Chataing <[email protected]> | Tue Jul 16 18:02:30 2024 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Jul 16 18:02:30 2024 +0000 |
tree | a07699cc51ce482fed986bdbd0addb47022cd15d | |
parent | ea1609286fa938e10adb4bf09314432e5252fd00 [diff] | |
parent | c6521346dbec79ebdbbf901d4777caf092e159b2 [diff] |
Merge "Upgrade pdl-compiler to 0.3.1" into main am: 43a5e34751 am: c6521346db Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pdl-compiler/+/3174621 Change-Id: I42db0ee5bbf055b8fe3dc8b892cdaf778d5cce08 Signed-off-by: Automerger Merge Worker <[email protected]>
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: