WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
spacepacketutils.cpp File Reference
#include "spacepacketutils.hpp"
#include <cstring>
#include "core/clockwerkerrors.h"
#include "flight/flighterrors.h"

Namespaces

namespace  warpos

Functions

int16 warpos::computeCRC16 (uint32 &crc, const uint8 *packet_ptr, size_t length, uint32 input_crc=0)
 Function to compute the CRC16 checksum for a packet.
int16 warpos::validateCRC16 (const uint32 &crc, const uint8 *packet_ptr, size_t length, uint32 input_crc=0)
 Function to validate the CRC16 checksum for a packet.
int16 warpos::computeFletcher8Checksum (const uint8 *packet_ptr, uint8 length, uint16 &checksum)
 Function to calculate the fletcher 8 checksum.
int16 warpos::validateFletcher8Checksum (const uint8 *packet_ptr, uint8 length, const uint16 &checksum)
 Function to validate the fletcher8 checksum for a packet.
int16 warpos::writeCCSDSHeader (uint8 *header, bool is_tlm, uint16 apid, uint8 seq_flag, uint16 seq_count, uint16 data_len, clockwerk::Time timestamp, uint8 instance)
 Function to write the CCSDS packet header.
int16 warpos::readCCSDSHeader (uint8 *header, bool &is_tlm, uint16 &apid, uint8 &seq_flag, uint16 &seq_count, uint16 &data_len, clockwerk::Time &timestamp, uint8 &instance)
 Function to read the CCSDS packet header and extract its contents.

Variables

const floating_point warpos::NSEC_TO_BIT32 = (0xFFFFFFFF) / clockwerk::NSEC_PER_SEC_I
 Factor to convert nanoseconds to 2^-32 seconds.