Defines the Data sensor methods.
◆ dwDataPacket
| Data Fields |
|
const void * |
data |
Pointer to the transfering data.
|
|
uint32_t |
size |
Data size in bytes.
|
|
uint64_t |
timestamp |
Packet timestamp.
|
◆ dwSensorData_readPacket()
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] | packet | A pointer to a pointer read from the sensor. The struct contains timestamp, size and a pointer to transfered data chunk. |
| [in] | timeout_us | Specifies the timeout in microseconds. Special values: DW_TIMEOUT_INFINITE - to wait infinitly. Zero - means polling of internal queue. |
| [in] | sensor | Specifies 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()
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] | packet | A pointer to the packet previously read from the sensor to be returned to the pool. |
| [in] | sensor | Specifies 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.
◆ DW_DATA_SENSOR_MAX_MEMORY_CHUNK_SIZE
| const uint32_t DW_DATA_SENSOR_MAX_MEMORY_CHUNK_SIZE = 4096 |
|
static |