Previously, beginning of the packet was "floating" in the
sense that the bit start position depended on how many bits
total were specified. This reasonably allows the omission
of fields (so that the definition does not fill the whole
packet), but that the definition would span to the end of
the packet. Implicitly, what was omitted would be assumed
to be the header (or more).
We've run into the situation where the length of a packet
might change at some point, but the change adds more
fields to the end of the packet... while the existing
structure of the packet remains the same.
Given the described, floating behavior of ccsdspy, the
same packet definition would not work. One initial idea
was to fix the start of the packet by specifying exactly
the start of the packet... eg. first bit_offset = 0.
This caused problems when leaving the rest of the
bit_offsets unspecified because, even though the first
packet would be at the start, the remaining would
misalign due to the counter variable not taking the
fixed start into account.
This commit improves handling of intermingled packet
definitions where some fields may have bit_offset
specified and other may not (ie bit_offset = None).
Previously, beginning of the packet was "floating" in the sense that the bit start position depended on how many bits total were specified. This reasonably allows the omission of fields (so that the definition does not fill the whole packet), but that the definition would span to the end of the packet. Implicitly, what was omitted would be assumed to be the header (or more).
We've run into the situation where the length of a packet might change at some point, but the change adds more fields to the end of the packet... while the existing structure of the packet remains the same.
Given the described, floating behavior of ccsdspy, the same packet definition would not work. One initial idea was to fix the start of the packet by specifying exactly the start of the packet... eg. first bit_offset = 0.
This caused problems when leaving the rest of the bit_offsets unspecified because, even though the first packet would be at the start, the remaining would misalign due to the counter variable not taking the fixed start into account.
This commit improves handling of intermingled packet definitions where some fields may have bit_offset specified and other may not (ie bit_offset = None).