google / google/pdl

Add support for variant constraint values to PDL packet declarations

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

Description

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.

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.