google / google/pdl

Tracking: Review CXX backend generator & enable Big-Endian support for AVCT/AVRC

Open
#176 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
86
Forks
18
Avg merge
20h 49m
Merged PRs (30d)
1

Description

**Status & Context**:
Review the new cxx backend generator in the PDL compiler (pdl-compiler). A key requirement for onboarding more Bluetooth protocols to PDL is support for _big-endian_ packet definitions. Specifically, to define and generate code for AVCTP and AVRCP which use big-endian byte order.

Currently, most PDL usage in the Bluetooth stack (like HCI and L2CAP) is little-endian. We need to ensure the new C++ backend fully supports and correctly implements big_endian_packets.

**Objectives**:
**Review CXX Backend**: General review of the new C++ code generator for correctness, safety, and performance.
**Verify/Implement Big-Endian Support**:
Ensure the cxx generator correctly parses and respects the big_endian_packets declaration.
Verify that generated serialization and deserialization code handles byte-swapping correctly on little-endian host systems.
Ensure proper alignment and bit-field extraction for big-endian layouts.
**Onboard AVCT/AVRC**:
Define avct and avrc packet schemas in PDL using big_endian_packets.
Validate the generated C++ code against existing hand-written parser/serializer implementations in the Bluetooth stack.

**Proposed Checklist**:
Review codebase of the new cxx backend generator in pdl-compiler.
Create canonical test .pdl files using big_endian_packets and verify C++ generation.
Verify generated code correctness (unit tests for big-endian read/write).
Draft PDL definitions for AVCTP (AVCT).
Draft PDL definitions for AVRCP (AVRC).
Integrate generated C++ headers into system/stack/avct and system/stack/avrc and run existing stack tests.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.