Module spp

Source
Expand description

Provides functionality to create, encode, and decode Space Packet Protocol packets specified by the CCSDS 133.0-B-2 June 2020 Standard.

General Usage:

use ccsds::spp::{SpacePacket, PacketType, SequenceFlag};

    // Define user specified data.
    let my_payload = "Hello, world!".as_bytes().to_vec();

    // Generate SpacePacket
    let my_space_packet = SpacePacket::new(
        PacketType::Telecommand,
        false,
        67,
        SequenceFlag::Unsegmented,
        0,
        my_payload // User data (includes secondary header if used)
    );

    // Encode SpacePacket as vector of bytes for transmission
    let encoded = my_space_packet.encode();

    // Do something with space packet....

    // Decoding a space packet.
    let decoded = SpacePacket::decode(&mut encoded.as_slice())
    .expect("Failed to decode SpacePacket!");

Structs§

PrimaryHeader
Primary Header used in the Space Packet Protocol.
SpacePacket
SPP Packet as defined by the CCSDS 133.0-B-2 Standard.

Enums§

PacketType
Indicates if the SPP packet is of the Telemetry or Telecommand types.
SequenceFlag
Sequence flag indicating if the packet is the start, end, or continuation in a sequence of packets, or is the packet is unsegmented.