commit | 74954b40aec2ef8c70ce76f92c38c6bafa7da2f0 | [log] [tgz] |
---|---|---|
author | Andrew Walbran <qwandor@google.com> | Wed Nov 08 18:49:36 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Nov 08 18:49:36 2023 +0000 |
tree | 533e1e85df6741e67c9256226869e50df319fb45 | |
parent | eaae88da25980c4e743b021bfa1e77d89f7a7afe [diff] | |
parent | 930befc884dcc9b4db522afea30bc7559278c6df [diff] |
Add cargo2android.json. am: 8febd65b6f am: 7a6e7cf265 am: 930befc884 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pdl-runtime/+/2822378 Change-Id: I05f97e6fac2a2cd78e8e8e46d564415e239935e8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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: