DriveWorks SDK Reference

| 0.6.67 Release

Data

Detailed Description

Defines the Data sensor methods.

Data Structures

struct  dwDataPacket
 

Functions

DW_API_PUBLIC dwStatus dwSensorData_readPacket (const dwDataPacket **packet, dwTime_t timeout_us, dwSensorHandle_t sensor)
 Reads one data chunk. More...
 
DW_API_PUBLIC dwStatus dwSensorData_returnPacket (const dwDataPacket *packet, dwSensorHandle_t sensor)
 Returns the data read to the internal pool. More...
 

Variables

static const uint32_t DW_DATA_SENSOR_MAX_MEMORY_CHUNK_SIZE = 4096
 

Data Structure Documentation

◆ dwDataPacket

struct dwDataPacket
Data Fields
const void * data

Pointer to the transfering data.

uint32_t size

Data size in bytes.

uint64_t timestamp

Packet timestamp.

Function Documentation

◆ dwSensorData_readPacket()

DW_API_PUBLIC dwStatus dwSensorData_readPacket ( const dwDataPacket **  packet,
dwTime_t  timeout_us,
dwSensorHandle_t  sensor 
)

Reads one data chunk.

The pointer returned is to the internal data pool. DW guarantees that the data remains unchanged until returned by the application. The data must be explicitly returned by the application.

Parameters
[out]packetA pointer to a pointer read from the sensor. The struct contains timestamp, size and a pointer to transfered data chunk.
[in]timeout_usSpecifies the timeout in microseconds. Special values: DW_TIMEOUT_INFINITE - to wait infinitly. Zero - means polling of internal queue.
[in]sensorSpecifies the sensor handle of the sensor previously created with dwSAL_createSensor().
Returns
DW_INVALID_HANDLE sensor parameter is not valid data sensor handle.
DW_INVALID_ARGUMENT if provided packet argument is nullptr.
DW_NOT_AVAILABLE if sensor has not been started or data is not available in polling mode.
DW_TIME_OUT timeout occured while reading the chunk.
DW_END_OF_STREAM reached the end of the stream.
DW_CALL_NOT_ALLOWED if the previous chunk has not been returned to DW and the next one is requested.
DW_SUCCESS on success.

◆ dwSensorData_returnPacket()

DW_API_PUBLIC dwStatus dwSensorData_returnPacket ( const dwDataPacket packet,
dwSensorHandle_t  sensor 
)

Returns the data read to the internal pool.

At this point the pointer is still be valid, but data is changed based on newer readings of the sensor.

Parameters
[in]packetA pointer to the packet previously read from the sensor to be returned to the pool.
[in]sensorSpecifies the sensor handle of the sensor previously created with dwSAL_createSensor().
Returns
DW_INVALID_HANDLE sensor parameter is not valid data sensor handle.
DW_INVALID_ARGUMENT if packet argument is a nullptr.
DW_SUCCESS on success.

Variable Documentation

◆ DW_DATA_SENSOR_MAX_MEMORY_CHUNK_SIZE

const uint32_t DW_DATA_SENSOR_MAX_MEMORY_CHUNK_SIZE = 4096
static

Definition at line 56 of file Data.h.