CCSDS SpacePacket Library

manipulates SpacePackets


Project maintained by yuasatakayuki Hosted on GitHub Pages — Theme by mattgraham

Introduction

CCSDS SpacePacket Library is a header-only C++ class library that manipulates packets in the CCSDS SpacePacket format. Secondary Header Part is implemented for JAXA/ISAS missions.

Related libraries:

Installation and Build

Git repository is hosted on the github.com. To install the latest source tree, execute git clone like below.

git clone https://github.com/yuasatakayuki/CCSDSLibrary.git

The library does not need to be pre-compiled since this consists only from header files. Just include CCSDSLibrary/includes/CCSDS.hh and provide a header search path to your compiler.

For example, in a source file,

#include "CCSDS.hh"
...your source...

and compile it with a -I flag,

g++ -I/path/to/CCSDSLibrary/includes your_application.cc -o your_application

Classes

Users mainly interface with instances of the CCSDSSpacePacket class. CCSDSSpacePacket internally contains

See Class List for complete API reference.

Example Usages

Packet creation

    //constructs an empty instance
    CCSDSSpacePacket* ccsdsPacket = new CCSDSSpacePacket();

    //set APID
    ccsdsPacket->getPrimaryHeader()->setAPID(apid);

    //set Packet Type (Telemetry or Command)
    ccsdsPacket->getPrimaryHeader()->
        setPacketType(CCSDSSpacePacketPacketType::TelemetryPacket);

    //set Secondary Header Flag (whether this packet has the Secondary Header part)
    ccsdsPacket->getPrimaryHeader()->
        setSecondaryHeaderFlag(
            CCSDSSpacePacketSecondaryHeaderFlag::Present
        );

    //set segmentation information
    ccsdsPacket->getPrimaryHeader()->
        setSequenceFlag(
            CCSDSSpacePacketSequenceFlag::UnsegmentedUserData
        );

    //set Category
    ccsdsPacket->getSecondaryHeader()->setCategory(category);

    //set secondary header type (whether ADU Channel presence)
    ccsdsPacket->getSecondaryHeader()->
        setSecondaryHeaderType(
            CCSDSSpacePacketSecondaryHeaderType::ADUChannelIsUsed
        );

    //set ADU Channel ID
    ccsdsPacket->getSecondaryHeader()->setADUChannelID(0x00);

    //set ADU Segmentation Flag (whether ADU is segmented)
    ccsdsPacket->getSecondaryHeader()->
        setADUSegmentFlag(
            CCSDSSpacePacketADUSegmentFlag::UnsegmentedADU
        );

    //set counters
    ccsdsPacket->getPrimaryHeader()->setSequenceCount(sequenceCount);
    ccsdsPacket->getSecondaryHeader()->setADUCount(aduCount);

    //set absolute time
    uint8_t time[4];
    ccsdsPacket->getSecondaryHeader()->setTime(time);

    //set data
    ccsdsPacket->setUserDataField(smcpByteArray);
    ccsdsPacket->setPacketDataLength();

    //get packet as byte array
    std::vector<uint8_t> packet = ccsdsPacket->getAsByteVector();

Packet interpretation

    //constructs an empty instance
    CCSDSSpacePacket* ccsdsPacket = new CCSDSSpacePacket();

    //interpret an input data as a CCSDS SpacePacket
    ccsdsPacket->interpret(data,length);

    //check if the packet has Secondary Header
    if(ccsdsPacket->isSecondaryHeaderPresent()){
        ...
    }

    //get APID
    std::cout << 
        ccsdsPacket->getPrimaryHeader()->
            getAPIDAsInteger() << std::endl;

    //dump packet content
    std::cout << ccsdsPacket->toString() << std::endl;

Feedback

Questions, comments, and requests are welcome. Raise them to the CCSDS SpacePacket Library Github site.