commit | 338a745b2eba3a1e6ddb963484f4daa4e54a2d3a | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Sun Aug 20 07:12:15 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Sun Aug 20 07:12:15 2023 +0000 |
tree | 897836674c74faac90707276de61c91a3c2e8c6b | |
parent | a7c65ba705128da4a01bc15d9324a907598d2330 [diff] | |
parent | c926f5b2ffcdda548241ea633c8d6b77975de1df [diff] |
Snap for 10684499 from c926f5b2ffcdda548241ea633c8d6b77975de1df to mainline-healthfitness-release Change-Id: I54addbe95026a192673975958568d2ecc28b16e0
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: