DriveWorks SDK Reference
5.14.77 Release
For Test and Development only

Detailed Description

Defines the Data sensor structure.

Data Structures

struct  dwDataPacket
 Holds a data packet. More...
 

Functions

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

Data Structure Documentation

◆ dwDataPacket

struct dwDataPacket
Data Fields
dwTime_t hostTimestamp Timestamp of the message in microseconds (using clock of the context).
uint8_t * raw Payload.
size_t size Number of bytes of the payload.

Function Documentation

◆ dwSensorData_readPacket()

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

Reads the next packet.

The pointer returned is to the internal data pool. The data must be explicitly returned by the application. The method blocks until either a new valid frame is received from the sensor or the given timeout exceeds.

Parameters
[out]packetA pointer to a pointer to a data packet read from the sensor.
[in]timeoutUsSpecifies 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 if given sensor handle is invalid
, DW_INVALID_ARGUMENT if given arguments are invalid
, DW_NOT_AVAILABLE if sensor has not been started or data is not available in polling mode
, DW_TIME_OUT if operation has timeout
, DW_SUCCESS if call is successful.

◆ dwSensorData_returnPacket()

DW_API_PUBLIC dwStatus dwSensorData_returnPacket ( dwDataPacket const *const  scan,
dwSensorHandle_t const  sensor 
)

Returns the data read to the internal pool.

Parameters
[in]scanA pointer to the data previously read from the data sensor to be returned to the pool.
[in]sensorSpecifies the sensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE if given sensor handle is invalid
, DW_INVALID_ARGUMENT if given arguments are invalid
, DW_NOT_AVAILABLE if sensor has not been started or data is not available in polling mode
, DW_TIME_OUT if operation has timeout
, DW_SUCCESS if call is successful.