commit | eaae88da25980c4e743b021bfa1e77d89f7a7afe | [log] [tgz] |
---|---|---|
author | Andrew Walbran <[email protected]> | Wed Nov 08 18:48:56 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Wed Nov 08 18:48:56 2023 +0000 |
tree | 533e1e85df6741e67c9256226869e50df319fb45 | |
parent | f02a9768d351a5ca40fec9ebe431704f605cbbe5 [diff] | |
parent | bad5ec493085b653eb458481a182811adb207a37 [diff] |
Add cargo2android.json. am: 8febd65b6f am: 27eb0ace08 am: bad5ec4930 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pdl-runtime/+/2822378 Change-Id: Iad38b985ef1bb6eaec42a86ee39082133adce682 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: