commit | a82410aafa4250470cdf1429d9a06545f3f43a19 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Thu Aug 29 23:11:45 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Thu Aug 29 23:11:45 2024 +0000 |
tree | 298ce4189e419baffd78abb4be1d766eb16394c8 | |
parent | 0033ecc1536aae26ca089271f20264379a9d029c [diff] | |
parent | 987aae493a326cd0b0837bac120b24d2410e81cf [diff] |
Snap for 12296955 from 987aae493a326cd0b0837bac120b24d2410e81cf to 24Q4-release Change-Id: If3db436eadbeabc9f8aba9fb7044c5b93307f8b0
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: