commit | 789b1a846251c810ff7955817cf983198c4e6190 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Tue May 21 23:14:18 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Tue May 21 23:14:18 2024 +0000 |
tree | c93e0fb668b84918c7f625744efe3145a2af51a9 | |
parent | 0352af0f7229f1d0f3d5f90144b7759f55a96305 [diff] | |
parent | 97f74011e835bbdf51fd6715b3bcd5a79d191311 [diff] |
Snap for 11869550 from 97f74011e835bbdf51fd6715b3bcd5a79d191311 to 24Q3-release Change-Id: Iae8fec510f6268aac70210a4bae0db9c0476fa0c
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: