das2C
das core C utilities (v3)
Functions
serial.h File Reference

Creating, reading and writing datasets to and from buffers. More...

#include <das2/stream.h>
#include <das2/dataset.h>
Include dependency graph for serial.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

DAS_API DasDsdasds_from_xmlheader3 (DasBuf *pBuf, StreamDesc *pParent, int nPktId)
 Define a das dataset and all it's constiutant parts from a das3 XML header. More...
 
DAS_API DasDsdasds_from_xmlheader2 (DasBuf *pBuf, StreamDesc *pParent, int nPktId)
 Define a das dataset and all it's constiutant parts from a legacy das2 XML header. More...
 
DAS_API DasErrCode dasds_decode_data (DasDs *pDs, DasBuf *pBuf)
 Given a das dataset decode it's packets. More...
 

Detailed Description

Creating, reading and writing datasets to and from buffers.

Function Documentation

◆ dasds_from_xmlheader3()

DAS_API DasDs* dasds_from_xmlheader3 ( DasBuf pBuf,
StreamDesc pParent,
int  nPktId 
)

Define a das dataset and all it's constiutant parts from a das3 XML header.

Parameters
pBufThe buffer to read. Reading will start with the read point and will run until DasBuf_remaining() is 0 or the end tag is found, which ever comes first.
pParentThe parent descriptor for this data set. This is assumed to be an object which can hold vector frame definitions.
nPktIdThe packet's ID within it's parent's array. My be 0 if and only if pParent is NULL
Returns
A pointer to a new DasDs and all if it's children allocated on the heap, or NULL on an error.

◆ dasds_from_xmlheader2()

DAS_API DasDs* dasds_from_xmlheader2 ( DasBuf pBuf,
StreamDesc pParent,
int  nPktId 
)

Define a das dataset and all it's constiutant parts from a legacy das2 XML header.

Parameters
pBufThe buffer to read. Reading will start with the read point and will run until DasBuf_remaining() is 0 or the end tag is found, which ever comes first.
pParentThe parent descriptor for this data set. This is assumed to be an object which can hold vector frame definitions.
nPktIdThe packet's ID within it's parent's array. My be 0 if and only if pParent is NULL
Returns
A pointer to a new DasDs and all if it's children allocated on the heap, or NULL on an error.

◆ dasds_decode_data()

DAS_API DasErrCode dasds_decode_data ( DasDs pDs,
DasBuf pBuf 
)

Given a das dataset decode it's packets.

Parameters
pDsA pointer to a das dataset object that has defined encoders and arrays. This can be created via dasds_from_xmlheader()
pBufThe buffer to read. Reading will start with the read point and will run until the end of the packet. Since reading from the buffer advances the read point, the caller can determine how many bytes were read.
Returns
DAS_OKAY if reading was successful or a error code if not.