GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSD / V0-3-0
Constituent: qsdccsds     Tag: linux-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 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. | |
static __inline unsigned int | update_siv_io (unsigned int siv, unsigned int status) |
Updates the SIV according to the IO status. | |
static __inline unsigned int | update_siv_flags (unsigned int siv, unsigned int flags) |
Updates the sequencing state of the SIV. | |
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 *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 *packet, CCSDS_apidDsc *dsc) |
Reads the current CCSDS data payload into the buffer specified by dsc. | |
int | CCSDS_istreamFileOpen (CCSDS_istream *istream, const char *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 (const CCSDS_istream *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 (const CCSDS_telemetry *packet) |
Prints a one-line summary of the CCSDS_istream header. |
CVS $Id: CCSDS_istream.c,v 1.3 2008/09/19 18:08:46 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.
|
|
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.
|
|
Updates the sequencing state of the SIV.
|
|
Updates the SIV according to the IO status.
|