GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSEC / V3-2-0 > qsec_extract / sun-gcc
#include "QSEC/QSEC.h"
#include "QSD/CCSDS_istream.h"
#include "QSD/CCSDS_apidDsc.h"
#include "QSD/CCSDS_telemetry.h"
#include "QSE/QSE_update.h"
#include "QSE/QSE_ctx.h"
#include "QSE/QSE_ebf.h"
#include "LSE/LSE_ids.h"
#include "LSF/LSF_scan.h"
#include "LSF/LSF.h"
#include "EDS/EBF_edw.h"
#include "EDS/EBF_ebw.h"
#include "EDS/EBF_pkt.h"
#include "EDS/io/EBF_stream.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Classes | |
struct | _Ctl |
Run time print options/parameters. More... | |
struct | _ApidStream |
The print context for one APID. More... | |
Defines | |
#define | RND_TO(_x, _r) (((_x) + (_r) - 1) / (_r)) * (_r) |
Round _x up to the nearest boundary of _r. | |
Typedefs | |
typedef struct _Ctl | Ctl |
Typedef for struct _Ctl. | |
typedef struct _ApidStream | ApidStream |
Typedef for struct _ApidStream. | |
Enumerations | |
enum | { QSEC_APID_BASE = 0x3c5, QSEC_MAX_APIDS = 4 } |
Miscellaneous constants. More... | |
Functions | |
static void | report_usage (void) |
static int | get_ctl (Ctl *ctl, int argc, char *const argv[]) |
static void | construct_astreams (ApidStream *astreams, int astream_cnt, unsigned int which, Ctl *ctl) |
static int | resolve (void *astreamp, const CCSDS_telemetry *pkt, CCSDS_apidDsc **dsc) |
static int | check_packet (void *parm, void *stream, const CCSDS_telemetry *pkt, CCSDS_apidDsc *dsc) |
static int | process_dgm (void *astream, const void *dgm, int dglen) |
static LSF_scanContributionHandler | handle_dgm (void *astreamp, const LSF_datagram *dgm) |
static LSF_scanRecordHandler | handle_ctb (void *astreamp, const LSF_contribution *ctb) |
static unsigned | handle_rec (void *astreamp, const LSF_record *rec) |
static LSF_scanContributionHandler | dgm_count (void *countp, const LSF_datagram *dgm) |
static LSF_scanRecordHandler | ctb_count (void *countp, const LSF_contribution *ctb) |
int | qsec_extract (int argc, char *const argv[]) |
int | main (int argc, char *const argv[]) |
> qsec_extract -n:<# of events> -s<# to skip> -o<file_name> <file_name>
#define RND_TO | ( | _x, | |||
_r | ) | (((_x) + (_r) - 1) / (_r)) * (_r) |
Round _x up to the nearest boundary of _r.
_x | The value to round | |
_r | The rounding |
anonymous enum |
int check_packet | ( | void * | parm, | |
void * | stream, | |||
const CCSDS_telemetry * | pkt, | |||
CCSDS_apidDsc * | dsc | |||
) | [static] |
Check a packet for validity
This routine is the packet checker callback routine for an APID stream. It simply calls the standard routine.
parm | The processing parameters. | |
stream | The data stream. | |
pkt | The address of the packet. | |
dsc | The address of the APID descriptor. |
void construct_astreams | ( | ApidStream * | astreams, | |
int | astream_cnt, | |||
unsigned int | which, | |||
Ctl * | ctl | |||
) | [static] |
Constructs the individual APID streams
astreams | The array of APID streams to construct | |
astream_cnt | The count of APID streams to construct | |
which | Bit mask of which CPUs to process | |
ctl | The control structure |
LSF_scanRecordHandler ctb_count | ( | void * | countp, | |
const LSF_contribution * | ctb | |||
) | [static] |
Count the number of events in this contribution
countp | Returned with the number of events in this contribution | |
ctb | The contribution |
LSF_scanContributionHandler dgm_count | ( | void * | countp, | |
const LSF_datagram * | dgm | |||
) | [static] |
Count the number of events in this datagram
countp | Returned with the number of events in this datagram | |
dgm | The datagram |
int get_ctl | ( | Ctl * | ctl, | |
int | argc, | |||
char *const | argv[] | |||
) | [static] |
Examines the command line parameters and fills the print run time options control structure
ctl | The parameter run time options block. | |
argc | The number of command line parameters. | |
argv | The array of pointers to the command line parameters. |
0,Everything | is okay. | |
-1,Incorrect | command usage. Usually this means that the input file name was absent. |
LSF_scanRecordHandler handle_ctb | ( | void * | astreamp, | |
const LSF_contribution * | ctb | |||
) | [static] |
Handle the event context information at contribution time
astreamp | The apid stream | |
ctb | The datagram contribution |
LSF_scanContributionHandler handle_dgm | ( | void * | astreamp, | |
const LSF_datagram * | dgm | |||
) | [static] |
Handle the datatgram
astreamp | The apid stream | |
dgm | The datagram |
unsigned int handle_rec | ( | void * | astreamp, | |
const LSF_record * | rec | |||
) | [static] |
Extract and write the contents of the event
astreamp | The apid stream | |
rec | The LSF record containing the event |
0 | Continue processing | |
LSF_SCAN_STATUS_M_DGM_USR_ABORT | Stop processing |
int main | ( | int | argc, | |
char *const | argv[] | |||
) |
Process a file of calibration events datagrams
argc | The argument count | |
argv | The vector of command line strings |
int process_dgm | ( | void * | astream, | |
const void * | dgm, | |||
int | dglen | |||
) | [static] |
Process a datagram
This routine is the datagram processor callback routine for an APID stream. It calls the LSF processor.
astream | The address of the APID stream. | |
dgm | The address of the datagram. | |
dglen | The length of the datagram. |
zero | Continue processing | |
non-zero | Stop processing |
int qsec_extract | ( | int | argc, | |
char *const | argv[] | |||
) |
Process a file of calibration events datagrams
argc | The argument count | |
argv | The vector of command line strings |
void report_usage | ( | void | ) | [static] |
Brief explanation on qsec_extract usage
int resolve | ( | void * | astreamp, | |
const CCSDS_telemetry * | pkt, | |||
CCSDS_apidDsc ** | dsc | |||
) | [static] |
Resolve a packet into its APID stream
This routine is the resolve callback routine for the entire data stream. It determines which APID stream (if any) the packet belongs to.
astreamp | The array of APID streams. | |
pkt | The address of the CCSDS packet. | |
dsc | The address of a pointer to receive the address of the matching APID descriptor. |
CCSDS_ISTREAM_RESOLVER_STATUS_K_SUCCESS | Stream found | |
CCSDS_ISTREAM_RESOLVER_STATUS_K_NOTFOUND | Stream not found |