commit | 0231e146b6ca2dcb0aac285cae5f793521d8187c | [log] [tgz] |
---|---|---|
author | Henri Chataing <[email protected]> | Tue Oct 24 10:28:27 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Oct 24 10:28:27 2023 +0000 |
tree | 19bc6fbb8b36697fc0c5352fc51cc233385b885c | |
parent | 28953123fda90c7b330156af2e71a61aa3ebc572 [diff] | |
parent | c3e01062da960236d4abdff7cb007a4c52c585c3 [diff] |
Import platform/external/rust/crates/pdl-runtime am: 42955e2a20 am: a0dbf075f8 am: c3e01062da Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pdl-runtime/+/2799356 Change-Id: Ic9c5bf8228cd7b91d7de7f4dbd368bd42b6c694d 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: