commit | 56874967a015aab64115c8b4e1ff675d65393ad8 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Tue Jul 16 23:14:37 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Tue Jul 16 23:14:37 2024 +0000 |
tree | a07699cc51ce482fed986bdbd0addb47022cd15d | |
parent | aadf52b759406baa8c81cdd234dd7788db609236 [diff] | |
parent | 94b1963144022397152f4fcb67a01c22c1f8da17 [diff] |
Snap for 12098010 from 94b1963144022397152f4fcb67a01c22c1f8da17 to 24Q4-release Change-Id: I8234d545f6a7e1961ff115e820f3afbcd939bb9c
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: