Ilmsens HAL API  1.1.1
A cross-platform C-library for interfacing m:explore UWB-sensors
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Raw measured data retrieval

Functions to read measured data out of internal ring-buffer. More...

Typedefs

typedef int32_t ilmsens_hal_SampleType
 Represents the data type of raw measured data.

Functions

int ilmsens_hal_measRdy (unsigned int *pDevNums, unsigned int pNum)
 Reads the fill-level of the internal ring-buffer for all specified devices.
int ilmsens_hal_measRead (unsigned int *pDevNums, unsigned int pNum, ilmsens_hal_SampleType *pBuffer, size_t pBufSizeBytes)
 Reads the measurement data for all specified devices in non-blocking way.
int ilmsens_hal_measGet (unsigned int *pDevNums, unsigned int pNum, ilmsens_hal_SampleType *pBuffer, size_t pBufSizeBytes, unsigned int pTimeoutMillis)
 Blocks and reads the measurement data for all specified devices when it becomes available.

Detailed Description

Functions to read measured data out of internal ring-buffer.

Function Documentation

int ilmsens_hal_measRdy ( unsigned int *  pDevNums,
unsigned int  pNum 
)

Reads the fill-level of the internal ring-buffer for all specified devices.

This functions is not blocking and returns immediately. However, in raw mode, it will transfer data from a device to the libraries' ring-buffer on the host, if it discovers that a complete dataset is available.

Parameters
pDevNumspointer to a first element or an array of device-indexes
pNumnumber of array-elements
Returns
minimum number of complete datasets available for all specified devices
0 if at least one device has no new data available
negative error-code
int ilmsens_hal_measRead ( unsigned int *  pDevNums,
unsigned int  pNum,
ilmsens_hal_SampleType pBuffer,
size_t  pBufSizeBytes 
)

Reads the measurement data for all specified devices in non-blocking way.

This functions is not blocking and returns immediately with the next measurement data or an error-code if no data are available.

Parameters
pDevNumspointer to a first element or an array of device-indexes
pNumnumber of array-elements
pBufferpointer to output buffer for measured data
pBufSizeBytesSize of buffer pointed to by pBuffer in bytes
Returns
number of elements (samples) copied to the buffer
ILMSENS_ERROR_AGAIN if a completed dataset is not available for every device
negative error-code
See Also
Measurement Data Format
Calculating the output-buffer size
int ilmsens_hal_measGet ( unsigned int *  pDevNums,
unsigned int  pNum,
ilmsens_hal_SampleType pBuffer,
size_t  pBufSizeBytes,
unsigned int  pTimeoutMillis 
)

Blocks and reads the measurement data for all specified devices when it becomes available.

This functions blocks the caller until at least one complete measurement is available for every device or a specified timeout expired. The buffer pBuffer must be large enough to hold one complete dataset for each device, i.e. it must be able to hold at least pNum complete datasets.

Note: if pTimeoutMillis is 0, this function will block forever...

Parameters
pDevNumspointer to a first element or an array of device-indexes
pNumnumber of array-elements
pBufferpointer to output buffer for measured data
pBufSizeBytesSize of buffer pointed to by pBuffer in bytes
pTimeoutMillistimeout [ms] (0 = forever)
Returns
number of elements (samples) copied to the buffer
ILMSENS_ERROR_TIMEOUT when the timeout expired before enough data was received
negative error-code
See Also
Measurement Data Format
Calculating the output-buffer size