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


Interface   Data Structures   File List   Data Fields   Globals  

CCSDS_pri_hdr.c File Reference

Function definitions for CCSDS primary header packet header library. More...

#include <CCSDS/CCSDS_pri.h>
#include <CCSDS/CCSDS_pkt.h>
#include <CCSDS_pkt_private.h>
#include <PBI/PTR.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

Function definitions for CCSDS primary header packet header library.

Author:
D.L. Wood

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.

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 Tue Nov 29 16:56:14 2011 by  doxygen 1.5.8