Defines sensor management interface layer.
|
| DW_API_PUBLIC dwStatus | dwSensorManager_acquireNextEvent (const dwSensorEvent **ev, dwTime_t timeout_us, dwSensorManagerHandle_t sm) |
| | Called by the application to consume the next available sensor event ready for consumption. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorManager_addCameraSensor (const char *groupName, size_t siblingIndex, dwSensorParams params, uint64_t clientData, dwSensorManagerHandle_t sm) |
| | Adds a camera sensor to the SAL instance. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorManager_addSensor (dwSensorParams params, uint64_t clientData, dwSensorManagerHandle_t sm) |
| | Adds a sensor to the SAL instance. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorManager_getNumSensors (size_t *count, dwSensorType type, dwSensorManagerHandle_t sm) |
| | Gets the number of sensors instantiated for a given sensor type. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorManager_getSensorHandle (dwSensorHandle_t *handle, dwSensorType type, size_t index, dwSensorManagerHandle_t sm) |
| | Gets the sensor handle to the specified sensor. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorManager_initialize (dwSensorManagerHandle_t *sm, size_t poolSize, dwSALHandle_t sal) |
| | Creates and initializes a SensorManager module. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorManager_release (dwSensorManagerHandle_t *sm) |
| | Releases the SensorManager module. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorManager_releaseAcquiredEvent (const dwSensorEvent *ev, dwSensorManagerHandle_t sm) |
| | Releases a previously acquired event back to the pool. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorManager_reset (dwSensorManagerHandle_t sm) |
| | Resets all sensors. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorManager_start (dwSensorManagerHandle_t sm) |
| | Starts all sensors. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorManager_stop (dwSensorManagerHandle_t sm) |
| | Stops all sensors. More...
|
| |
◆ dwSensorEvent
◆ DW_SENSORMANGER_MAX_CAMERAS
| #define DW_SENSORMANGER_MAX_CAMERAS 6U |
◆ dwSensorManagerHandle_t
◆ dwSensorManager_acquireNextEvent()
Called by the application to consume the next available sensor event ready for consumption.
The method will return the oldest available event amonst all sensors.
- Parameters
-
| [out] | ev | A pointer to a pointer of the event to be acquired |
| [in] | timeout_us | time threshold to bail out if no new event is available |
| [in] | sm | SM handle instantiated by the caller |
- Returns
- DW_INVALID_ARGUMENT - pointer to the dwSensorEvent point is null
DW_INVALID_HANDLE - if provided SM handle is invalid.
DW_BUFFER_FULL - all event buffers are currently being used
DW_TIME_OUT - no new event was availble within timeout period
DW_END_OF_STREAM - reached end of camera stream (video only)
DW_SUCCESS
◆ dwSensorManager_addCameraSensor()
Adds a camera sensor to the SAL instance.
All addCameraSensor() calls must be completed before the start() call.
- Parameters
-
| [in] | groupName | Specifies the group name for this camera |
| [in] | siblingIndex | Specifies the sibling id for this camera (GMSL only) |
| [in] | params | Specifies the parameters for sensor creation. |
| [in] | clientData | Client data to be passed w/ each event for this sensor |
| [in] | sm | SM handle instantiated by the caller |
- Returns
- DW_INVALID_HANDLE - if provided SM handle is invalid.
DW_SAL_NO_DRIVER_FOUND - if provided protocol name is unknown.
DW_SAL_SENSOR_ERROR - if a non recoverable error happens during sensor creation. For a virtual sensor which is reading from a file it could be file I/O error.
DW_SUCCESS
- Note
- This method will perform memory allocations
◆ dwSensorManager_addSensor()
Adds a sensor to the SAL instance.
All addSensor() calls must be completed before the start() call.
- Parameters
-
| [in] | params | Specifies the parameters for sensor creation. |
| [in] | clientData | Client data to be passed w/ each event for this sensor |
| [in] | sm | SM handle instantiated by the caller |
- Returns
- DW_INVALID_HANDLE - if provided SM handle is invalid.
DW_SAL_NO_DRIVER_FOUND - if provided protocol name is unknown.
DW_SAL_SENSOR_ERROR - if a non recoverable error happens during sensor creation. For a virtual sensor which is reading from a file it could be file I/O error.
DW_SUCCESS
- Note
- This method will perform memory allocations
◆ dwSensorManager_getNumSensors()
Gets the number of sensors instantiated for a given sensor type.
- Parameters
-
| [out] | count | A pointer to return the number of sensors |
| [in] | type | Type of sensor to return the count for |
| [in] | sm | SM handle instantiated by the caller |
- Returns
- DW_INVALID_ARGUMENT - pointer to the count is null
DW_INVALID_HANDLE - if provided SM handle is invalid.
DW_SUCCESS
◆ dwSensorManager_getSensorHandle()
Gets the sensor handle to the specified sensor.
- Parameters
-
| [in] | handle | Pointer to location where handle shall be returned |
| [in] | type | Type of sensor being requested |
| [in] | index | Index of the sensor |
| [in] | sm | SM handle instantiated by the caller |
- Returns
- DW_INVALID_ARGUMENT - pointer to the count is null
DW_INVALID_HANDLE - if provided SM handle is invalid.
DW_SUCCESS
◆ dwSensorManager_initialize()
Creates and initializes a SensorManager module.
- Parameters
-
| [out] | sm | A pointer to the sm handle will be returned here. |
| [in] | poolSize | Size of the event pool to be allocated |
| [in] | sal | SAL handle instantiated by the caller |
- Returns
- DW_INVALID_ARGUMENT - if pointer to the SM handle is NULL.
DW_INVALID_HANDLE - if provided contex/SAL handle is invalid.
DW_SUCCESS
◆ dwSensorManager_release()
Releases the SensorManager module.
- Parameters
-
| [out] | sm | A pointer to the sm handle will be returned here. |
- Returns
- DW_INVALID_ARGUMENT - if pointer to the SM handle is NULL.
DW_INVALID_HANDLE - if provided contex/SAL handle is invalid.
DW_SUCCESS
◆ dwSensorManager_releaseAcquiredEvent()
Releases a previously acquired event back to the pool.
For certain sensors, this call will also trigger returning the backing buffer back to the DW sensor bufferpools.
- Parameters
-
| [in] | ev | A pointer to the event to be returned |
| [in] | sm | SM handle instantiated by the caller |
- Returns
- DW_INVALID_ARGUMENT - pointer to the event is null
DW_INVALID_HANDLE - if provided SM handle is invalid.
DW_SUCCESS
◆ dwSensorManager_reset()
Resets all sensors.
- Parameters
-
| [in] | sm | SM handle instantiated by the caller |
- Returns
- DW_INVALID_HANDLE - if provided SM handle is invalid.
DW_SUCCESS
◆ dwSensorManager_start()
Starts all sensors.
- Parameters
-
| [in] | sm | SM handle instantiated by the caller |
- Returns
- DW_INVALID_HANDLE - if provided SM handle is invalid.
DW_SUCCESS
◆ dwSensorManager_stop()
Stops all sensors.
- Parameters
-
| [in] | sm | SM handle instantiated by the caller |
- Returns
- DW_INVALID_HANDLE - if provided SM handle is invalid.
DW_SUCCESS