commit | 704dad0c9b7458e4ca01550f3099fdeeb6da02a6 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Tue May 21 23:14:17 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Tue May 21 23:14:17 2024 +0000 |
tree | 61b23dbcf4832ffec58313f49fc92b8d9261fd40 | |
parent | 69cfcd0b6f5b63650536c1ebf4aa2f977279432f [diff] | |
parent | 7880889369ce638fffe3bbd54723f3c9030f24f6 [diff] |
Snap for 11869550 from 7880889369ce638fffe3bbd54723f3c9030f24f6 to 24Q3-release Change-Id: I2475ea7738d25e0254342a7e99a147b2aebbf55b
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: