Skip to content

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

Description

@hchataing

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[],
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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