commit | 6925bf0562c59c509a4854545ddcd96926745cda | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Mar 14 18:12:02 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Mar 14 18:12:02 2024 +0000 |
tree | f91c5674b32b7c7960b0bccab434426de019774b | |
parent | b91ba5464bf595d5fbc8d051e59ee57ae5bc695c [diff] | |
parent | 8ced8b9d88e6817bcceed48e114a3eb9655bda26 [diff] |
Snap for 11574415 from 8ced8b9d88e6817bcceed48e114a3eb9655bda26 to emu-35-1-release Change-Id: Iee3eb299571fe9bc34689e9d54f246ac5f6dd876
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: