GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CCSDS / V3-5-3 > ccsds_pri / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

CCSDS_pri.h File Reference

CCSDS Packet Primary Header Format Library. More...

#include <CCSDS/CCSDS_msg.h>

Functions

unsigned int CCSDS_priHdrSizeof (void)
 Get the size of a CCSDS packet primary header.
unsigned int CCSDS_priHdrVerify (const void *pkt)
 Verify the prescience of a valid CCSDS packet primary header.
unsigned int CCSDS_priHdrGetLength (const void *pkt, unsigned short *length)
 Get the packet length value in a CCSDS packet primary header.
unsigned int CCSDS_priHdrGetType (const void *pkt, unsigned short *type)
 Get the packet type value in a CCSDS packet header.
unsigned int CCSDS_priHdrGetApid (const void *pkt, unsigned short *apid)
 Get the application ID value in a CCSDS packet primary header.
unsigned int CCSDS_priHdrGetSeqCount (const void *pkt, unsigned short *seqCount)
 Get the packet sequence count value in a CCSDS packet primary header.
unsigned int CCSDS_priHdrGetSeqFlags (const void *pkt, unsigned short *seqFlags)
 Get the packet grouping value in a CCSDS packet primary header.


Detailed Description

CCSDS Packet Primary Header Format Library.

Author:
D.L. Wood
This library contains functions and definitions for manipulating and examining the values in the CCSDS Version 1 Packet primary headers. The functions will work with both Telecommand Packets (uplink and SC command) and Telemetry Source Packets (downlink).

The specifications for the CCSDS Packet header formats may be found in the following documents:

Telecommand - CCSDS Telecommand Part 3 (203.0-B-1 Blue Book)
Telemetry - CCSDS Packet Telemetry (102.0-B-5 Blue Book)

The functions in this library are generic, and do not suppose any peculiar fomatting for the secondary header. Thus, they may be used to examine SC or GBM packets in mixed telemetry streams. No support is given for creating packet headers, or for examining secondary header contents. The CCSDS_priGetLength() only accounts for the size of the primary header, so the size of the secondary header is included in the returned length value.


Function Documentation

unsigned int CCSDS_priHdrGetApid ( const void *  pkt,
unsigned short *  apid 
)

Get the application ID value in a CCSDS packet primary header.

Returns the CCSDS packet application ID.

Parameters:
pkt A pointer to the start of the packet buffer.
apid Stores the application ID value.
Returns:
A CSDS MSG value.

References CCSDS_ID_APID_MASK, CCSDS_PKT_MSG, _CCSDS_Pkt_Hdr_Pri::hdr_id, and NULL.

unsigned int CCSDS_priHdrGetLength ( const void *  pkt,
unsigned short *  length 
)

Get the packet length value in a CCSDS packet primary header.

Returns the value of the CCSDS packet header length member. The size of the packet secondary header is not taken into account when extracting the packet header length member, so that the return value from this function includes the secondary header size and the size of application data following the packet secondary header.

Parameters:
pkt A pointer to the start of the packet buffer.
length Stores the length in bytes of the user application data to following the packet header.
Returns:
A CSDS MSG value.

References CCSDS_PKT_MSG, _CCSDS_Pkt_Hdr_Pri::hdr_length, and NULL.

unsigned int CCSDS_priHdrGetSeqCount ( const void *  pkt,
unsigned short *  seqCount 
)

Get the packet sequence count value in a CCSDS packet primary header.

Returns the CCSDS packet sequence count.

Parameters:
pkt A pointer to the start of the packet buffer.
seqCount Stores the sequence count value.
Returns:
A CSDS MSG value.

References CCSDS_PKT_MSG, CCSDS_SEQ_COUNT_MASK, _CCSDS_Pkt_Hdr_Pri::hdr_seq, and NULL.

unsigned int CCSDS_priHdrGetSeqFlags ( const void *  pkt,
unsigned short *  seqFlags 
)

Get the packet grouping value in a CCSDS packet primary header.

Returns the CCSDS packet sequence flags.

Parameters:
pkt A pointer to the start of the packet buffer.
seqFlags Stores the sequence flags value:
CCSDS_PKT_SEQ_FIRST The packet is the first packet in a group. CCSDS_PKT_SEQ_MID The packet is an intermediate packet in a group. CCSDS_PKT_SEQ_LAST The packet is the last packet in a group. CCSDS_PKT_SEQ_NONE The packet is standalone and not part of a group.
Returns:
A CSDS MSG value.

References CCSDS_PKT_MSG, CCSDS_SEQ_FLAGS_MASK, _CCSDS_Pkt_Hdr_Pri::hdr_seq, and NULL.

unsigned int CCSDS_priHdrGetType ( const void *  pkt,
unsigned short *  type 
)

Get the packet type value in a CCSDS packet header.

Returns the CCSDS packet header type.

Parameters:
pkt A pointer to the start of the packet buffer.
type Stores the packet type:
CCSDS_PKT_TYPE_CMD The packet is a Telecommand packet.
CCSDS_PKT_TYPE_TELEM The packet is a Telemetry Source packet.
Returns:
A CSDS MSG value.

References CCSDS_ID_TYPE_MASK, CCSDS_PKT_MSG, _CCSDS_Pkt_Hdr_Pri::hdr_id, and NULL.

unsigned int CCSDS_priHdrSizeof ( void   ) 

Get the size of a CCSDS packet primary header.

Returns the size of the CCSDS packet primary header.

Returns:
The size in bytes of a CCSDS packet primary header.

References CCSDS_PKT_PRI_SIZE.

unsigned int CCSDS_priHdrVerify ( const void *  pkt  ) 

Verify the prescience of a valid CCSDS packet primary header.

Checks to see if the contents of pkt contain a properly formatted CCSDS packet primary header.

Parameters:
pkt A pointer to the start of the packet buffer.
Returns:
A CSDS MSG value.

References CCSDS_ID_VERSION_MASK, CCSDS_PKT_MSG, CCSDS_PKT_VERSION_1, _CCSDS_Pkt_Hdr_Pri::hdr_id, and NULL.


Generated on Wed Nov 21 18:24:11 2012 by  doxygen 1.5.8