commit | 9a28a41e6926ee65932306208098002794195d71 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Fri Nov 10 00:12:43 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Fri Nov 10 00:12:43 2023 +0000 |
tree | aa2013363f222302f64a6d58626633d16bb1f487 | |
parent | 9b7eecd98f32dfeeacd6439701d8bab668a66acf [diff] | |
parent | e354afbf2c9c287e7a26fbdb027055fc00081def [diff] |
Snap for 11078623 from e354afbf2c9c287e7a26fbdb027055fc00081def to 24Q1-release Change-Id: I90e41e335c1893ff31780e1515332c5727e2ca0a
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: