commit | 8addf364247a85b5a3083da19d316080d43697b1 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Sat Dec 16 02:12:29 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Sat Dec 16 02:12:29 2023 +0000 |
tree | 7f329964d84aec6acacc4881c092e424d49a49a2 | |
parent | e5f3986d1e740294e1dcc174b54d50e2a1fe841f [diff] | |
parent | fe8259d830ff106945047415548a712325e836ce [diff] |
Snap for 11227258 from fe8259d830ff106945047415548a712325e836ce to 24Q2-release Change-Id: Ibc59478e62e8581550ffa38a282a2b3de2b828f9
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: