GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSD / V0-4-2
Constituent: qsdccsds     Tag: sun-gcc
#include "QSD/CCSDS_istream.h"
#include "QSD/CCSDS_apidDsc.h"
#include "QSD/CCSDS_telemetry.h"
#include "PBI/Endianness.h"
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include "QSD/CCSDS_telemetryPrint.h"
Include dependency graph for CCSDS_istream.c:
Data Structures | |
struct | _CCSDS_istreamInput |
Function callbacks to read and close an input stream. More... | |
struct | _CCSDS_istream |
The control structure/context for reading a CCSDS formatted stream of bytes. More... | |
Defines | |
#define | CCSDS_M_SEQ 0x3fff |
Mask of the valid bits in the CCSDS sequence number. | |
Typedefs | |
typedef _CCSDS_istreamInput | CCSDS_istreamInput |
Typedef for struct _CCSDS_istreamInput. | |
Functions | |
static int __inline | form_transition (unsigned int siv, unsigned short int flags) |
Forms the new state transition word. This consists of 2 bits defining the previous packet state (ONLY, FIRST, MIDDLE, LAST) and 2 bits defining the current packet state. | |
static int __inline | check_transition (unsigned int state) |
Checks that the transition from the previous state to the current state is allowed. | |
static void | report_siv_error (int siv, int apid, int seq) |
Reports the reasons for CCSDS siv errors. | |
static int | file_read (FILE *file, unsigned char *buf, int nbytes, int sbytes) |
Simple routine to do a file read using fread. | |
static CCSDS_istream * | construct (CCSDS_istream *istream, int free) |
Construct for a newly minted CCSDS_istream structure. | |
static __inline unsigned int | check_sequencing (unsigned int siv, unsigned short int flags, unsigned short int prv_seq, unsigned short int sequence) |
Checks that both the packet transition from the previous state to the current state is allowed and that the sequence number advances correctly. Note that this routine only checks the integrity, it does not update any state information. | |
int | CCSDS_istreamSizeof (void) |
Returns the size, in bytes, of a CCSDS_istream structure. | |
CCSDS_istream * | CCSDS_istreamNew (void) |
Convenience function to allocate and initialize a CCSDS_istream control structure. | |
int | CCSDS_istreamConstruct (CCSDS_istream *istream) |
Constructs (initializes) a previously uninitialized CCSDS_istream control structure. | |
int | CCSDS_istreamConnect (CCSDS_istream *istream, void *prm, CCSDS_istreamReader read, CCSDS_istreamCloser close, CCSDS_istreamTeller tell) |
Connects a read mechanism with the specified stream. | |
int | CCSDS_istreamHdrRead (CCSDS_istream *istream, CCSDS_telemetry *packet) |
Reads the CCSDS header. | |
int | CCSDS_istreamDatAdvance (CCSDS_istream *istream, CCSDS_telemetry const *packet, CCSDS_apidDsc *dsc) |
Advances past the current CCSDS data payload with reading the data into the buffer. All integrity checks are preformed. This in contrast with calling CCSDS_istreamDatRead with a NULL descriptor. | |
int | CCSDS_istreamDatRead (CCSDS_istream *istream, CCSDS_telemetry const *packet, CCSDS_apidDsc *dsc) |
Reads the current CCSDS data payload into the buffer specified by dsc. | |
int | CCSDS_istreamPktCheck (unsigned int opts, CCSDS_istream *istream, CCSDS_telemetry const *pkt, CCSDS_apidDsc *dsc) |
Precanned CCSDS_istreamProcess callback routine to check the integrity of a CCSDS packet. | |
int | CCSDS_istreamPktResynch (CCSDS_istream *istream, CCSDS_telemetry const *packet, CCSDS_apidDsc *dsc) |
Routine to recover from an APID sequence number or sequence state (first, middle, last) packet error. It can be used part of the CCSDS_istreamProcess packer checker routine. | |
int | CCSDS_istreamFileOpen (CCSDS_istream *istream, char const *filename, unsigned int options, unsigned char *buf, unsigned int buf_size) |
Convenience function to construct a CCSDS_istream to read from the specified named file filename. | |
unsigned int | CCSDS_istreamTell (CCSDS_istream const *istream) |
Returns the current byte offset into the stream. | |
int | CCSDS_istreamProcess (CCSDS_istream *stream, CCSDS_istreamCsb *csb, CCSDS_istreamResolver resolve_rtn, void *resolve_ctx) |
Processes a stream of CCSDS packets. The packets may be from multiple APIDs. | |
int | CCSDS_istreamClose (CCSDS_istream *istream) |
Closes the input stream associated with istream. | |
int | CCSDS_istreamDestroy (CCSDS_istream *istream) |
Destroys (i.e. returns the resources) associated with the stream. | |
void | CCSDS_istreamHdrPrint (CCSDS_telemetry const *packet) |
Prints a one-line summary of the CCSDS_istream header. |
CVS $Id: CCSDS_istream.c,v 1.7 2008/12/06 19:35:06 russell Exp $
|
Closes the input stream associated with istream.
|
|
Connects a read mechanism with the specified stream.
|
|
Constructs (initializes) a previously uninitialized CCSDS_istream control structure.
|
|
Advances past the current CCSDS data payload with reading the data into the buffer. All integrity checks are preformed. This in contrast with calling CCSDS_istreamDatRead with a NULL descriptor.
|
|
Reads the current CCSDS data payload into the buffer specified by dsc.
|
|
Destroys (i.e. returns the resources) associated with the stream.
|
|
Convenience function to construct a CCSDS_istream to read from the specified named file filename.
|
|
Prints a one-line summary of the CCSDS_istream header.
|
|
Reads the CCSDS header.
|
|
Convenience function to allocate and initialize a CCSDS_istream control structure.
|
|
Precanned CCSDS_istreamProcess callback routine to check the integrity of a CCSDS packet.
|
|
Routine to recover from an APID sequence number or sequence state (first, middle, last) packet error. It can be used part of the CCSDS_istreamProcess packer checker routine.
|
|
Processes a stream of CCSDS packets. The packets may be from multiple APIDs.
|
|
Returns the size, in bytes, of a CCSDS_istream structure.
|
|
Returns the current byte offset into the stream.
|
|
Checks that both the packet transition from the previous state to the current state is allowed and that the sequence number advances correctly. Note that this routine only checks the integrity, it does not update any state information.
|
|
Checks that the transition from the previous state to the current state is allowed.
|
|
Construct for a newly minted CCSDS_istream structure.
|
|
Simple routine to do a file read using fread.
|
|
Forms the new state transition word. This consists of 2 bits defining the previous packet state (ONLY, FIRST, MIDDLE, LAST) and 2 bits defining the current packet state.
|
|
Reports the reasons for CCSDS siv errors.
|