das2C
das core C utilities (v3)
Data Structures | Macros | Functions
packet.h File Reference
#include <das2/plane.h>
Include dependency graph for packet.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PktDesc
 Holds information for a single packet type in a Das2 stream. More...
 

Macros

#define MAXPLANES   100
 maximum planes allowed in a packet
 

Functions

DAS_API void del_PktDesc (PktDesc *pThis)
 Free a packet descriptor and all it's contained objects. More...
 
DAS_API bool PktDesc_equalFormat (const PktDesc *pPd1, const PktDesc *pPd2)
 Check for packet descriptor format equality. More...
 
DAS_API int PktDesc_getPlaneIdx (PktDesc *pThis, PlaneDesc *pPlane)
 Get the plane number within this packet description. More...
 
DAS_API PlaneDescPktDesc_getPlaneByName (PktDesc *pThis, const char *name)
 Get a Plane Descriptor for the plane with the name name. More...
 
DAS_API PlaneDescPktDesc_getPlaneByType (PktDesc *pThis, plane_type_t ptype, int iRelIndex)
 Get the Ith plane of a given type. More...
 

Function Documentation

◆ del_PktDesc()

DAS_API void del_PktDesc ( PktDesc pThis)

Free a packet descriptor and all it's contained objects.

Parameters
pThisThe packet descriptor to free, the caller should set the pointer to NULL after this call.

◆ PktDesc_equalFormat()

DAS_API bool PktDesc_equalFormat ( const PktDesc pPd1,
const PktDesc pPd2 
)

Check for packet descriptor format equality.

This function checks to see if two packet descriptors define the same data note that the StreamDesc parent of each need not be the same, nor are the descriptors required to have the same current data values.

Parameters
pPd1
pPd2
Returns
true if both packet descriptors provide the same definition, false otherwise

◆ PktDesc_getPlaneIdx()

DAS_API int PktDesc_getPlaneIdx ( PktDesc pThis,
PlaneDesc pPlane 
)

Get the plane number within this packet description.

Parameters
pThisthe packet descriptor to query
pPlanea pointer to the plane who's index is required
Returns
a number from 0 to 99 if successful or -1 if the plane pointed to by pPlane is not part of this packet description

◆ PktDesc_getPlaneByName()

DAS_API PlaneDesc* PktDesc_getPlaneByName ( PktDesc pThis,
const char *  name 
)

Get a Plane Descriptor for the plane with the name name.

Returns
A pointer to the plane, or NULL if no plane with the given name is present in the packet descriptor

◆ PktDesc_getPlaneByType()

DAS_API PlaneDesc* PktDesc_getPlaneByType ( PktDesc pThis,
plane_type_t  ptype,
int  iRelIndex 
)

Get the Ith plane of a given type.

Parameters
pThisThe packet descriptor to query
ptypeThe plane type, one X, Y, Z, YScan
iRelIndexThe number of the plane of a given type to find. The lowest index will be 0 for a given type.
Returns
A pointer to the plane, or NULL if there are not at least iRelIndex + 1 planes of the given type in the packet