Expand description

This crate provides an implementation of the CCSDS Primary Header defined in the CCSDS Space Packet Protocol standards document.

This packet header is used in space applications, including the International Space Station and many cubesat applications, among many other.

The PrimaryHeader struct is defined in such a way that it is laid out in memory as defined by the standard, including bitfields and big endian byte order. To support this layout the fields are accessed through getters/setters rather then through direct access.

Header fields that have enumerations are retrieved as enums.

The main thing this crate provides is the PrimaryHeader struct. These can be created out of sequences of u8s, and by transmuting from raw memory as these structures read memory directly in the CCSDS format.

Structs

The control word is the first word of the primary header. This word contains:
The length word of the CCSDS header. This is just a u16, but it is wrapped in a struct for consistency with the other fields.
The PrimaryHeader struct represents a CCSDS Primary header. Its representation in memory matches the CCSDS standard.
The sequence word is the second word of the primary header. It contains a sequence count and an enum that determines how to interpret the sequence count.

Enums

The PacketType indicates whether the packet is a command (Command) or a telemetry (Data) packet.
The secondary header flag indicates whether there is another header following the primary header (Present) or not (NotPresent).
The sequence flag indicates the interpretation of the sequence count. Continuation- the sequence count indicates the block in a series of packets containing segmented data FirstSegement- the packet is the first in a series of segemented packets. LastSegement- the packet is the last in a series of segemented packets. Unsegmented- the sequence count is an incrementing counter used to distinguish packets.

Constants

The minimum size of a CCSDS packet’s data section.
The minimum packet length of a CCSDS packet. This is the primary header size plus 1 byte.
The CCSDS primary header size in bytes.
The CCSDS Version (always 0 currently).