commit | 6962663d43643d0336b1b2e0ef75be115e12d373 | [log] [tgz] |
---|---|---|
author | Henri Chataing <[email protected]> | Fri May 12 15:28:29 2023 +0000 |
committer | Henri Chataing <[email protected]> | Fri May 26 21:40:13 2023 +0000 |
tree | 51b36d886865f420c52e5d496c53f1ce17624624 | |
parent | c01de065fe29ed387a2f00d3797c97e690af6d76 [diff] |
Import platform/external/rust/crates/pdl-compiler Import version 0.1.1 of crate pdl-compiler Cargo.lock is removed to make sure the emulator build is working with corrosion. Bug: 283153347 Test: m Change-Id: I6d0d099c1548762b608e933b148f5b2f5261f5e2
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: