GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> GRBP / V1-0-4 > grbp_msg_test / rhel4-32
#include <GRBP_pktdef.h>
#include <GRBP_msgdef.h>
#include <GRB/GRB_pktdef.h>
#include <GRBP/io/GRB_stream.h>
#include <stdio.h>
#include <stdlib.h>
Classes | |
struct | _Pkt |
A packet of 50 messages. More... | |
Typedefs | |
typedef struct _Pkt | Pkt |
Typedef for struct _Pkt. | |
Functions | |
int | main (int argc, const char *argv[]) |
Entry point to the GRB message testing program. | |
static __inline int | pick (int idx) |
Picks which buffer to use. Currently it just alternates. | |
static __inline int | set_limits (int which, int previous) |
Sets the number of messages to put into a packet. This cannot be greater than the maximum allowed by the packet (currently 50). | |
static void | report_usage (void) |
Reports on how to use this program. |
CVS $Id: grbp_msg_test.c,v 1.3 2011/03/30 22:11:50 russell Exp $
This not so much a test program as a template to show how to write a program that might do something more meaningful. In its current instantiation it writes 1000 pseudo-messages to two message packets in groups of 25 messages, with every other message going to every other packet. Thus the output represents an idealized situation, whereby every other packet comes from every other EPU and every other event in the source stream goes to every other packet.
Changes that would like be made include
The end use is ultimately to produce a realistic packet stream that one can use to exercise the code, running on the SIU, that will merge the packets from the two EPU sources and resort the messages back into the order that they were conceived in.
int main | ( | int | argc, | |
const char * | argv[] | |||
) |
Entry point to the GRB message testing program.
Usage is
$ grbp_msg <file-name> where file-name is the name of the file to write. By convention the extension is .grb.
References GRB_STREAM_TYPE_K_FILE, GRBP__pktMsgAdd(), _GRBP_pkt::hdr, pick(), report_usage(), and set_limits().
static __inline int pick | ( | int | idx | ) | [static] |
Picks which buffer to use. Currently it just alternates.
idx | The event index |
Referenced by main().
static __inline int set_limits | ( | int | which, | |
int | previous | |||
) | [static] |
Sets the number of messages to put into a packet. This cannot be greater than the maximum allowed by the packet (currently 50).
which | Which packet the limit is being calculated for | |
previous | The previous limit |
Referenced by main().