Skip to content

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

Description

@cmanton-hue

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions