commit | d9e9117b48e77548b59e29974b6e6b741e450995 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Sat Jul 20 01:13:58 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Sat Jul 20 01:13:58 2024 +0000 |
tree | 77f8cca5250ed5628d58411e095ab2079f34ebce | |
parent | 56874967a015aab64115c8b4e1ff675d65393ad8 [diff] | |
parent | 3763df02b1772ceaad52804a7add17886520231a [diff] |
Snap for 12116631 from 3763df02b1772ceaad52804a7add17886520231a to 24Q4-release Change-Id: I49f05c1797e380a44698ca7f08507f33b4612209
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: