Skip to content

Add support for variant constraint values to PDL packet declarations #90

@hchataing

Description

@hchataing

Example use case taken from the UWB's UCI specification:

enum MessageType: 3 {
    DATA = 0x00,
    COMMAND = 0x01,
    RESPONSE = 0x02,
    NOTIFICATION = 0x03,
}

packet UciPacket {
    message_type: MessageType,
    _body_
}

packet UciControlPacket: UciPacket (message_type = COMMAND | RESPONSE | NOTIFICATION) {
    opcode: 8,
    _size_(_payload_): 8,
    _payload_,
}

packet UciDataPacket: UciPacket (message_type = DATA) {
    _size_(_payload_): 16,
    _payload_,
}

In this example UciControlPacket covers multiple message types. It is not possible to describe this constraint using the exisiting syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions