ccsdspy
ccsdspy copied to clipboard
Allow optional secondary header fields based on secondary header flag
This tends to not happen very often in practice, but it's part of the spec and we should support it. PacketField's should have a keyword argument secondary_header=True
(defaults False). When this keyword argument is true, they are only included parsed into the packet body when the secondary header flag is 1.
The array in the return dictionary should be made a MaskedArray in this case. It only makes sense to do this for VariableLength
, because the FixedLength
decoder relies on fixed spacing between the packets.
This is solved by the more general solution proposed in #72