commit | a0dbf075f8502d9220d07e2989d6ca460bfb8291 | [log] [tgz] |
---|---|---|
author | Henri Chataing <[email protected]> | Tue Oct 24 09:38:43 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Oct 24 09:38:43 2023 +0000 |
tree | 19bc6fbb8b36697fc0c5352fc51cc233385b885c | |
parent | 18ee7a9e1cce70a3839dd2a519d3c1301d682b2c [diff] | |
parent | 42955e2a200acb81007c67251964f3874b6f2d93 [diff] |
Import platform/external/rust/crates/pdl-runtime am: 42955e2a20 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pdl-runtime/+/2799356 Change-Id: If2761eb68ce042bf47991774e8f69737bfe8da01 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: