commit | 32daa7f814fca0daac1dca092caff795af682c5b | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Sat Nov 11 22:12:44 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Sat Nov 11 22:12:44 2023 +0000 |
tree | b93dc16bcb9e649881601e1254728a899ed4a2d1 | |
parent | 9a28a41e6926ee65932306208098002794195d71 [diff] | |
parent | 863821c54d346bc79833e69b62ec4e8f289c4b56 [diff] |
Snap for 11086585 from 863821c54d346bc79833e69b62ec4e8f289c4b56 to 24Q1-release Change-Id: I5d6e72c8808941d8d43b3865a0c5f695dd1ede3a
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: