commit | f7c3ee68108dcb32fb407b93afe94d7ce6281ced | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Thu Sep 12 19:41:15 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Thu Sep 12 19:41:15 2024 +0000 |
tree | a07699cc51ce482fed986bdbd0addb47022cd15d | |
parent | 5d3f89b2cf601965bf781f45bf386d7d92447387 [diff] | |
parent | c6521346dbec79ebdbbf901d4777caf092e159b2 [diff] |
Snap for 12359238 from c6521346dbec79ebdbbf901d4777caf092e159b2 to android15-tests-release Change-Id: Iaabfdb378fce4f6a8fbeef15c0f56f02ccbc4337
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: