commit | 63679968fab712d96902ae57d108dc7d1add990f | [log] [tgz] |
---|---|---|
author | Henri Chataing <[email protected]> | Wed Aug 02 21:59:52 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Wed Aug 02 21:59:52 2023 +0000 |
tree | 26fb766f433f2511d34f90463afb6f8e8271aeca | |
parent | 0e263d18752106b4f73b339c3f684ed1508d094c [diff] | |
parent | 6e418cc0c7efdd32cb92b38b3bbcae061436be75 [diff] |
Merge "Add //system/nfc:__subpackages__ to the package visibility" into main am: 6e418cc0c7 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pdl-compiler/+/2654668 Change-Id: I56304c298ed457b227a11a64b749af76279d9b85 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: