GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSD / dev > qsdccsds / rhel5-64


Interface   Data Structures   File List   Data Fields   Globals  

CCSDS_telemetry.h File Reference

Layout of a CCSDS telemetry packet. More...

#include <QSD/CCSDS_header.h>
#include <PBI/Endianness.h>

Classes

struct  _CCSDS_telemetrySecondary
 The secondary header for the CCSDS telemetry packets. More...
struct  _CCSDS_telemetry
 Standard CCSDS telemetry packet (with only a placeholder for the payload). More...

Typedefs

typedef enum
_CCSDS_TELEMETRY_VERSION_K 
CCSDS_TELEMETRY_VERSION_K
 Typedef for _CCSDS_TELEMETRY_VERSION_K.
typedef struct
_CCSDS_telemetrySecondary 
CCSDS_telemetrySecondary
 Typedef for struct _CCSDS_telemetrySecondary.
typedef struct _CCSDS_telemetry CCSDS_telemetry
 Typedef for struct _CCSDS_telemetry.

Enumerations

enum  _CCSDS_TELEMETRY_VERSION_K { CCSDS_TELEMETRY_VERSION_K_EXPECTED = CCSDS_HEADER_VERSION_K_1 }
 Enumeration of the current version. More...

Functions

static __inline unsigned CCSDS__telemetryVersionIsWrong (const CCSDS_telemetry *packet)
 Checks if the CCSDS header format version matches the expectation.
static __inline unsigned CCSDS__telemetryApid (const CCSDS_telemetry *packet)
 Returns the application identifier.
static __inline unsigned CCSDS__telemetrySecondaryFlag (const CCSDS_telemetry *packet)
 Returns the value of the secondary header present flag.
static __inline unsigned CCSDS__telemetryType (const CCSDS_telemetry *packet)
 Returns the type of the packet.
static __inline unsigned CCSDS__telemetryVersion (const CCSDS_telemetry *packet)
 Returns the CCSDS header format version.
static __inline unsigned CCSDS__telemetrySequenceNumber (const CCSDS_telemetry *packet)
 Returns the packet sequence number.
static __inline unsigned CCSDS__telemetrySequenceFlags (const CCSDS_telemetry *packet)
 Returns the packet sequence flagnumber.
static __inline unsigned CCSDS__telemetryLength_m1 (const CCSDS_telemetry *packet)
 Returns the value of length_m1 field, in bytes.
static __inline unsigned CCSDS__telemetryVerify (const CCSDS_telemetry *packet)
 Verifies that a telemetry packet is properly formated.
static __inline unsigned CCSDS__telemetrySeconds (const CCSDS_telemetry *packet)
 Returns the seconds part of the time field in the secondary header of a telemetry packet.
static __inline unsigned CCSDS__telemetryUseconds (const CCSDS_telemetry *packet)
 Returns the micros seconds part of the time field in the secondary header of a telemetry packet.
static __inline unsigned CCSDS__telemetryBridge (const CCSDS_telemetry *packet)
 Returns the bridge word of in the telemetry payload.
static __inline unsigned CCSDS__telemetryLength (const CCSDS_telemetry *packet)
 Returns the number of bytes in the telemetry payload.
static __inline const void * CCSDS__telemetryPayload (const CCSDS_telemetry *packet)
 Returns a pointer to the telemetry payload.
static __inline void CCSDS__telemetrySwapb (CCSDS_telemetry *packet)
 On little-endian machines, swaps the header to big-endian format. On big-endian machines, this is a NOOP.
static __inline void CCSDS__telemetrySwap2b (CCSDS_telemetry *packet, const CCSDS_telemetry *src)
 On little-endian machines, swaps the header to big-endian format. On big-endian machines, this is a copy.
static __inline void CCSDS__telemetrySsrSwapb (CCSDS_telemetry *packet)
 On little-endian machines, swaps the header to big-endian format. On big-endian machines, this is a NOOP.
static __inline void CCSDS__telemetrySsrSwap2b (CCSDS_telemetry *packet, const CCSDS_telemetry *src)
 On little-endian machines, swaps the header + the first payload word (the number of pad bytes) to big-endian format. On big-endian machines, this is a copy.
static __inline unsigned CCSDS__telemetrySsrPad (const CCSDS_telemetry *packet)
 Returns the number of pad bytes in the telemetry SSR payload.
static __inline unsigned CCSDS__telemetrySsrLength (const CCSDS_telemetry *packet)
 Returns the number of bytes in the telemetry SSR payload.
static __inline unsigned CCSDS__telemetrySsrActiveLength (const CCSDS_telemetry *packet)
 Returns the number of bytes in the telemetry SSR payload, not including the pad bytes.
static __inline const void * CCSDS__telemetrySsrPayload (const CCSDS_telemetry *packet)
 Returns a pointer to the telemetry payload when the packet is from the SSR.


Detailed Description

Layout of a CCSDS telemetry packet.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: CCSDS_telemetry.h,v 1.6 2011/03/26 21:06:58 russell Exp $

i


Typedef Documentation

Typedef for _CCSDS_TELEMETRY_VERSION_K.

This is a little overkill, but it gets the symbol into the debugger


Enumeration Type Documentation

Enumeration of the current version.

Enumerator:
CCSDS_TELEMETRY_VERSION_K_EXPECTED  The expected CCSDS version for telemetry packets


Function Documentation

static __inline unsigned CCSDS__telemetryApid ( const CCSDS_telemetry packet  )  [static]

Returns the application identifier.

Returns:
The APID
Parameters:
packet The telemetry packet

References _CCSDS_headerPid::bf, _CCSDS_telemetry::header, and _CCSDS_header::pid.

Referenced by CCSDS_istreamPktCheck().

static __inline unsigned CCSDS__telemetryBridge ( const CCSDS_telemetry packet  )  [static]

Returns the bridge word of in the telemetry payload.

Returns:
The bridge word
Parameters:
packet The telemetry packet.
The bridge word is term used to describe the orphaned 16-bit word that follows the normal 7 x 16-bit word header. In many telemetry packets, this word is treated more like an extension of the secondary header that as the first word of the payload. Which way a telemetry packet treats this word is dependent on the APID.

References _CCSDS_telemetry::payload.

static __inline unsigned CCSDS__telemetryLength ( const CCSDS_telemetry packet  )  [static]

Returns the number of bytes in the telemetry payload.

Returns:
The number of bytes in the telemetry payload
Parameters:
packet The telemetry packet
Warning:
This is not the raw value of the length field in the CCSDS packet. It is a derived value representing the size the size, in bytes, of the payload. If wishes the raw value of the length field in the CCSDS packet, use CCSDS_packetLength_m1.

References _CCSDS_telemetry::header, _CCSDS_header::length_m1, and _CCSDS_telemetry::secondary.

static __inline unsigned CCSDS__telemetryLength_m1 ( const CCSDS_telemetry packet  )  [static]

Returns the value of length_m1 field, in bytes.

Returns:
The value of length field, in bytes
Parameters:
packet The telemetry packet
Warning:
This is the raw value of the length field in the CCSDS packet. It is the size, in bytes of any secondary header + the payload - 1. If one wishes the size of just the command or telemetry payloads, use CCSDS__packetCommandLength and CCSDS__packetTelemetryLength.

References _CCSDS_telemetry::header, and _CCSDS_header::length_m1.

static __inline const void * CCSDS__telemetryPayload ( const CCSDS_telemetry packet  )  [static]

Returns a pointer to the telemetry payload.

Returns:
A pointer to the telemetry payload
Parameters:
packet The telemetry packet

References _CCSDS_telemetry::payload.

static __inline unsigned CCSDS__telemetrySecondaryFlag ( const CCSDS_telemetry packet  )  [static]

Returns the value of the secondary header present flag.

Return values:
==0,if a secondary header is not present
!=0,if a secondary header is present
Parameters:
packet The telemetry packet

References _CCSDS_headerPid::bf, _CCSDS_telemetry::header, and _CCSDS_header::pid.

Referenced by CCSDS_telemetryPrintStatus().

static __inline unsigned CCSDS__telemetrySeconds ( const CCSDS_telemetry packet  )  [static]

Returns the seconds part of the time field in the secondary header of a telemetry packet.

Returns:
The seconds part of the time field in the secondary
Parameters:
packet The telemetry packet

References _CCSDS_telemetry::secondary, _CCSDS_telemetrySecondary::secs_hi, and _CCSDS_telemetrySecondary::secs_lo.

static __inline unsigned CCSDS__telemetrySequenceFlags ( const CCSDS_telemetry packet  )  [static]

Returns the packet sequence flagnumber.

Return values:
0 (00b) If the packet contains a continuation segment of user data
1 (01b) If the packet contains the first segment of user data
2 (10b) If the packet contains the last segment of user data
3 (11b) If the packet contains unsegmented user data
Parameters:
packet The telemetry packet

References _CCSDS_headerSeq::bf, _CCSDS_telemetry::header, and _CCSDS_header::seq.

Referenced by CCSDS_istreamDatAdvance(), CCSDS_istreamDatRead(), CCSDS_istreamHdrPrint(), CCSDS_istreamPktCheck(), and CCSDS_istreamPktResynch().

static __inline unsigned CCSDS__telemetrySequenceNumber ( const CCSDS_telemetry packet  )  [static]

Returns the packet sequence number.

Returns:
The packet sequence number
Parameters:
packet The telemetry packet

References _CCSDS_headerSeq::bf, _CCSDS_telemetry::header, and _CCSDS_header::seq.

Referenced by CCSDS_istreamDatAdvance(), CCSDS_istreamDatRead(), and CCSDS_istreamPktCheck().

static __inline unsigned CCSDS__telemetrySsrActiveLength ( const CCSDS_telemetry packet  )  [static]

Returns the number of bytes in the telemetry SSR payload, not including the pad bytes.

Returns:
The number of bytes in the telemetry payload not including the pad bytes
Parameters:
packet The telemetry packet
Warning:
This is not the raw value of the length field in the CCSDS packet. It is a derived value representing the size the size, in bytes, of the SSR payload. This value does not include either
  1. the length of the word containing the number of pad bytes
  2. the number of pad bytes
If one wishes the raw value of the length field in the CCSDS packet, use CCSDS_telemetryLength_m1. If one wishes the number of bytes in what CCSDS calls the user data, then call CCSDS_telemetryLength. The value of this later call will include both the above quantities and must always be a multiple of an LCB cell-size, i.e. 16-bytes.

References _CCSDS_telemetry::header, _CCSDS_header::length_m1, _CCSDS_telemetry::payload, and _CCSDS_telemetry::secondary.

static __inline unsigned CCSDS__telemetrySsrLength ( const CCSDS_telemetry packet  )  [static]

Returns the number of bytes in the telemetry SSR payload.

Returns:
The number of bytes in the telemetry payload. This includes the pad bytes, but not the bytes occupied by the word containing the number of pad bytes.
Parameters:
packet The telemetry packet
Warning:
This is not the raw value of the length field in the CCSDS packet. It is a derived value representing the size the size, in bytes, of the SSR payload. This value does not include either
  1. the length of the word containing the number of pad bytes
  2. the number of pad bytes
If one wishes the raw value of the length field in the CCSDS packet, use CCSDS_telemetryLength_m1. If one wishes the number of bytes in what CCSDS calls the user data, then call CCSDS_telemetryLength. The value of this later call will include both the above quantities and must always be a multiple of an LCB cell-size, i.e. 16-bytes.

References _CCSDS_telemetry::header, _CCSDS_header::length_m1, and _CCSDS_telemetry::secondary.

Referenced by CCSDS_istreamDatAdvance(), and CCSDS_istreamDatRead().

static __inline unsigned CCSDS__telemetrySsrPad ( const CCSDS_telemetry packet  )  [static]

Returns the number of pad bytes in the telemetry SSR payload.

Returns:
The number of pad bytes in the telemetry SSR payload
Parameters:
packet The telemetry packet. This must be a telemetry packet that was placed on the SSR.

References _CCSDS_telemetry::payload.

Referenced by CCSDS_istreamDatRead().

static __inline const void * CCSDS__telemetrySsrPayload ( const CCSDS_telemetry packet  )  [static]

Returns a pointer to the telemetry payload when the packet is from the SSR.

Returns:
A pointer to the telemetry payload
Parameters:
packet The telemetry packet

References _CCSDS_telemetry::payload.

static __inline void CCSDS__telemetrySsrSwap2b ( CCSDS_telemetry dst_packet,
const CCSDS_telemetry src_packet 
) [static]

On little-endian machines, swaps the header + the first payload word (the number of pad bytes) to big-endian format. On big-endian machines, this is a copy.

Parameters:
dst_packet The telemetry destination packet to swap
src_packet The telemetry source packet

References ccsds_bswp2_16().

static __inline void CCSDS__telemetrySsrSwapb ( CCSDS_telemetry packet  )  [static]

On little-endian machines, swaps the header to big-endian format. On big-endian machines, this is a NOOP.

Parameters:
packet The telemetry packet to swap

References ccsds_bswp1_16().

Referenced by CCSDS_istreamHdrRead().

static __inline void CCSDS__telemetrySwap2b ( CCSDS_telemetry dst_packet,
const CCSDS_telemetry src_packet 
) [static]

On little-endian machines, swaps the header to big-endian format. On big-endian machines, this is a copy.

Parameters:
dst_packet The telemetry destination packet to swap
src_packet The telemetry source packet

References ccsds_bswp2_16(), and _CCSDS_telemetry::payload.

static __inline void CCSDS__telemetrySwapb ( CCSDS_telemetry packet  )  [static]

On little-endian machines, swaps the header to big-endian format. On big-endian machines, this is a NOOP.

Parameters:
packet The telemetry packet to swap

References ccsds_bswp1_16(), and _CCSDS_telemetry::payload.

static __inline unsigned CCSDS__telemetryType ( const CCSDS_telemetry packet  )  [static]

Returns the type of the packet.

Return values:
==0,if the packet is a telemetry packet
!=0,if the packet is a command packet
Parameters:
packet The telemetry packet

References _CCSDS_headerPid::bf, _CCSDS_telemetry::header, and _CCSDS_header::pid.

Referenced by CCSDS_telemetryPrintStatus().

static __inline unsigned CCSDS__telemetryUseconds ( const CCSDS_telemetry packet  )  [static]

Returns the micros seconds part of the time field in the secondary header of a telemetry packet.

Returns:
The umicro seconds part of the time field in the secondary
Parameters:
packet The telemetry packet

References _CCSDS_telemetry::secondary, _CCSDS_telemetrySecondary::usecs_hi, and _CCSDS_telemetrySecondary::usecs_lo.

static __inline unsigned CCSDS__telemetryVerify ( const CCSDS_telemetry packet  )  [static]

Verifies that a telemetry packet is properly formated.

Return values:
==0 The telemetry packet is properly formatted
!=0 A bit mask of items that are incorrectly formatted, see
See also:
CCSDS_VERIFY_ERR_V for an enumeration of the bits
Parameters:
packet The telemetry packet
Warning:
While this is, in theory a nice check, when all is said and done it is not that strong, involving only 4 bits
  • 2 bits for the version (must be 0)
  • 1 bit telemetry packet flag (must be 0)
  • 1 bit secondary header flag (must be 1)
Given that the three out of the four bits are 0, this is weaker than it looks.

References _CCSDS_headerPid::bf, CCSDS_HEADER_TYPE_K_TELEMETRY, CCSDS_HEADER_VERSION_K_1, CCSDS_VERIFY_ERR_M_SECONDARY, CCSDS_VERIFY_ERR_M_TYPE, CCSDS_VERIFY_ERR_M_VERSION, _CCSDS_telemetry::header, and _CCSDS_header::pid.

Referenced by CCSDS_istreamProcess().

static __inline unsigned CCSDS__telemetryVersion ( const CCSDS_telemetry packet  )  [static]

Returns the CCSDS header format version.

Returns:
The CCSDS header format version
Parameters:
packet The telemetry packet

References _CCSDS_headerPid::bf, _CCSDS_telemetry::header, and _CCSDS_header::pid.

Referenced by CCSDS_telemetryPrintStatus().

static __inline unsigned CCSDS__telemetryVersionIsWrong ( const CCSDS_telemetry packet  )  [static]

Checks if the CCSDS header format version matches the expectation.

Return values:
==0 if it does
!=0 if it does not (actually the difference expected - actual
Parameters:
packet The telemetry packet
Since this returns the expected - actual, the expected can be gotten by adding the actual version to the return value.

References _CCSDS_headerPid::bf, CCSDS_TELEMETRY_VERSION_K_EXPECTED, _CCSDS_telemetry::header, and _CCSDS_header::pid.


Generated on Thu Sep 27 16:31:57 2012 by  doxygen 1.5.8