billvaglienti / ProtoGen

Communications protocol generation software
MIT License
30 stars 16 forks source link

Feature Suggestion: "dependsOnValue" #82

Closed SchrodingersGat closed 5 years ago

SchrodingersGat commented 6 years ago

The "dependsOn" parameter only checks for non-zero values (e.g. bitfield). It might be considered useful to have a secondary parameter "dependsOnValue" which (if present) complements "dependsOn" and compares the value of the named variable.

e.g.

<Data name="foo" inMemoryType="unsigned8"/>
<Data name="bar" inMemoryType="unsigned8" dependsOn="foo" dependsOnValue="0xBA"/>
<Data name="cat" inMemoryType="unsigned8" dependsOn="foo" dependsOnValue="0xCA"/>
<Data name="dog" inMemoryType="unsigned8" dependsOn="foo" dependsOnValue="0xD0"/>

In this example at most one of [bar | cat | dog] will be encoded / decoded (depending on the value of foo)

billvaglienti commented 5 years ago

Done in 2.16