commit | 4faa8dc3b9522b068615f203824d0b56a5e64129 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Thu Nov 16 00:13:37 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Thu Nov 16 00:13:37 2023 +0000 |
tree | 40b5fb74851bbe10e4eedcb94a663faf615c15bb | |
parent | cb619f8b2b8336cdddebe5d2c6bb9a5f5370d5d5 [diff] | |
parent | 75618274e9e33762f16caa49747c70cd5969866d [diff] |
Snap for 11104212 from 75618274e9e33762f16caa49747c70cd5969866d to 24Q1-release Change-Id: I202427fb5b67d342e459cc0347bd217b7be07cb4
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: