google / google/pdl

Have a way to represent the size of two equal data fields

Open
#91 2 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

Two options that we talked about are:
```
packet TwoEqualFields {
size_of_fields : 8,
field_one : 8[size_of_fields],
field_two : 8[size_of_fields],
}
```
```
packet TwoEqualFields {
_elementsize_(data) : 8,
data: 8[2][], // Two variable-size byte-arrays that have the same size.
}
```
The benefit of elementsize is that we will need something like that for GATT.
The downside is that data and mask are not the same, so it would be nicer to be able to have meaningful names.

Two other options are:
```
packet TwoEqualFields {
_size_(field_one) : 8,
field_one : 8[],
field_two : 8[_size_(field_one)],
}
```
```
packet TwoEqualFields {
_size_(field_one) {, && ==} _size_(field_two) : 8,
field_one : 8[],
field_two : 8[],
}
```

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.