space_packet_parser icon indicating copy to clipboard operation
space_packet_parser copied to clipboard

MNT/ENH: Add a raw CCSDS packet generator

Open greglucas opened this issue 1 year ago • 2 comments
trafficstars

This refactors out the reading of a byte-stream into a separate generator function that can yield raw CCSDSPackets with only a header and the raw bytes. The definitions and parsing logic can use this generator to yield packets and then parse whatever they need to after the fact. This enables someone to use this generator without a packet definition and to investigate what is in the packet stream without needing to know more detailed information about how individual packets are laid out internally.

This is proposal to address https://github.com/medley56/space_packet_parser/issues/104 Another idea rather than having multiple packet_generators() laying around would be to go all-in on this and invert the logic somewhat by passing in the definition. This could take that inpackets.packet_generator(*, definition=None) as a keyword argument and only parse the packets if a definition is not None. Thoughts on that approach rather than separate generators (one hanging off the definition).

Checklist

  • [x] Changes are fully implemented without dangling issues or TODO items
  • [ ] Deprecated/superseded code is removed or marked with deprecation warning
  • [ ] Current dependencies have been properly specified and old dependencies removed
  • [x] New code/functionality has accompanying tests and any old tests have been updated to match any new assumptions
  • [ ] The changelog.md has been updated

greglucas avatar Oct 10 '24 17:10 greglucas