NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release

Detailed Description

Provides an interface for non-standard sensors.

Data Structures

struct  dwSensorPluginProperties
 Structure for generic constants returned by the plugin. More...
 
struct  dwSensorPlugin_firmwareVersion
 
struct  dwSensorPlugin_information
 
struct  dwSensorCommonPluginFunctions
 Function Table exposing common plugin functions. More...
 

Typedefs

typedef dwStatus(* dwSensorPlugin_createHandle) (dwSensorPluginSensorHandle_t *handle, dwSensorPluginProperties *properties, char const *params, dwContextHandle_t ctx)
 Creates a new handle to the sensor managed by the plugin module. More...
 
typedef dwStatus(* dwSensorPlugin_createSensor) (char const *params, dwSALHandle_t sal, dwSensorPluginSensorHandle_t handle)
 Creates and initializes a new sensor managed by the plugin. More...
 
typedef dwStatus(* dwSensorPlugin_pushData) (size_t *lenPushed, uint8_t const *data, size_t const size, dwSensorPluginSensorHandle_t handle)
 Pushes raw data obtained from a previous 'dwSensorPlugin_readRawData' call for decoding. More...
 
typedef dwStatus(* dwSensorPlugin_getSensorInformation) (dwSensorPlugin_information *information, dwSensorPluginSensorHandle_t sensor)
 Gets information of this sensor. More...
 
typedef dwStatus(* dwSensorPlugin_getRawPackets) (uint8_t const *const rawData, size_t *const size, dwSensorPlugin_rawDataLevel level, int32_t groupNum, uint8_t const **const data, dwSensorPluginSensorHandle_t handle)
 Reads RAW data from different level. More...
 
typedef dwStatus(* dwSensorPlugin_getRawPacketsNew) (uint8_t const *const rawData, size_t *const size, dwSensorPlugin_rawDataLevel level, int32_t groupNum, uint8_t const **const data, int32_t *extra1, int32_t *extra2, dwSensorPluginSensorHandle_t handle)
 Reads RAW data from different level. More...
 
typedef dwStatus(* dwSensorPlugin_rawDataReadyForDecode) (size_t *offset, size_t *size, uint8_t const *const data, dwSensorPluginSensorHandle_t ctx)
 API for sensor that raw data and decoded packet are many to one relationship. More...
 

Enumerations

enum  dwSensorPlugin_rawToDecMap {
  DW_SENSORS_RAW_DEC_ONE_TO_ONE = 0,
  DW_SENSORS_RAW_DEC_MANY_TO_ONE = 1,
  DW_SENSORS_RAW_DEC_NOT_SUPPORTED = 2
}
 
enum  dwSensorPlugin_timeDomain {
  DW_SENSORS_PLUGIN_TIME_DOMAIN_HOST = 0,
  DW_SENSORS_PLUGIN_TIME_DOMAIN_TSC = 1,
  DW_SENSORS_PLUGIN_TIME_DOMAIN_PTP = 2,
  DW_SENSORS_PLUGIN_TIME_DOMAIN_UTC = 3,
  DW_SENSORS_PLUGIN_TIME_DOMAIN_UTCTOH = 4,
  DW_SENSORS_PLUGIN_TIME_DOMAIN_MISC = 5,
  DW_SENSORS_PLUGIN_TIME_DOMAIN_COUNT = 6
}
 
enum  dwSensorPlugin_rawDataLevel {
  DW_SENSORS_RAW_DATA_LEVEL_ZERO = 0,
  DW_SENSORS_RAW_DATA_LEVEL_ONE = 1,
  DW_SENSORS_RAW_DATA_LEVEL_TWO = 2,
  DW_SENSORS_RAW_DATA_LEVEL_COUNT = 3
}
 

Typedef Documentation

◆ dwSensorPlugin_createHandle

typedef dwStatus(* dwSensorPlugin_createHandle) (dwSensorPluginSensorHandle_t *handle, dwSensorPluginProperties *properties, char const *params, dwContextHandle_t ctx)

Creates a new handle to the sensor managed by the plugin module.

Parameters
[out]handleA pointer to sensor handle.
[out]propertiesSensor-specific properties & constants returned by the plugin.
[in]paramsSpecifies the parameters for the sensor.
[in]ctxcontext handle.
Returns
DW_INVALID_ARGUMENT - if pointer to the sensor handle is NULL.
DW_SUCCESS

Definition at line 120 of file SensorCommonPlugin.h.

◆ dwSensorPlugin_createSensor

typedef dwStatus(* dwSensorPlugin_createSensor) (char const *params, dwSALHandle_t sal, dwSensorPluginSensorHandle_t handle)

Creates and initializes a new sensor managed by the plugin.

The created sensor will be released using the 'dwSensorPlugin_releaseSensor' interface.

Parameters
[in]paramsSpecifies the parameters for sensor creation.
[in]salSAL handle.
[in]handleA sensor handle previously created w/ the 'dwSensorPlugin_createHandle' interface.
Returns
DW_INVALID_HANDLE - if the sensor handle is NULL or invalid
DW_SAL_SENSOR_ERROR - if a non recoverable error happens during sensor creation.
DW_SUCCESS

Definition at line 137 of file SensorCommonPlugin.h.

◆ dwSensorPlugin_getRawPackets

typedef dwStatus(* dwSensorPlugin_getRawPackets) (uint8_t const *const rawData, size_t *const size, dwSensorPlugin_rawDataLevel level, int32_t groupNum, uint8_t const **const data, dwSensorPluginSensorHandle_t handle)

Reads RAW data from different level.

Parameters
[in]rawDataA pointer to the pointer to data that is populated with the RAW data.
[out]sizeA pointer to the size of the data array.
[in]levelSpecify which raw data level to be read from.
[in]groupNumAdditonal param to specify the group to read from since there may be different groups of data per level, for example, we can pass service ID(soda/ssi) to specify the service group to read from for a LEVEL_TWO raw data, if -1 passed, the data from all the group will be returned
[out]dataA pointer to the size of the data array.
[in]handleSpecifies the sensor handle to read from.
Returns
DW_INVALID_HANDLE - if the sensor handle is NULL or invalid
DW_NOT_SUPPORTED - if sensor does not implement this functionality.
DW_NOT_READY - if sensor cannot generate a combine raw packet for a sepcific level.
DW_CALL_NOT_ALLOWED - if sensor cannot execute the call, for example, due to decoding data.
DW_INVALID_ARGUMENT - if one of the given arguments is invalid.
DW_TIME_OUT - if the requested timed out.
DW_SAL_SENSOR_ERROR - if there was an unrecoverable i/o error.
DW_SUCCESS

Definition at line 196 of file SensorCommonPlugin.h.

◆ dwSensorPlugin_getRawPacketsNew

typedef dwStatus(* dwSensorPlugin_getRawPacketsNew) (uint8_t const *const rawData, size_t *const size, dwSensorPlugin_rawDataLevel level, int32_t groupNum, uint8_t const **const data, int32_t *extra1, int32_t *extra2, dwSensorPluginSensorHandle_t handle)

Reads RAW data from different level.

Parameters
[in]rawDataA pointer to the pointer to data that is populated with the RAW data.
[out]sizeA pointer to the size of the data array.
[in]levelSpecify which raw data level to be read from.
[in]groupNumAdditonal param to specify the group to read from since there may be different groups of data per level, for example, we can pass service ID(soda/ssi) to specify the service group to read from for a LEVEL_TWO raw data, if -1 passed, the data from all the group will be returned
[out]dataA pointer to the size of the data array.
[out]extra1used to return extra info to client, for example soda/ssi ID.
[out]extra2used to return extra info to client, for example someip intance ID which used to sort the split PDU.
[in]handleSpecifies the sensor handle to read from.
Returns
DW_INVALID_HANDLE - if the sensor handle is NULL or invalid
DW_NOT_SUPPORTED - if sensor does not implement this functionality.
DW_NOT_READY - if sensor cannot generate a combine raw packet for a sepcific level.
DW_CALL_NOT_ALLOWED - if sensor cannot execute the call, for example, due to decoding data.
DW_INVALID_ARGUMENT - if one of the given arguments is invalid.
DW_TIME_OUT - if the requested timed out.
DW_SAL_SENSOR_ERROR - if there was an unrecoverable i/o error.
DW_SUCCESS

Definition at line 225 of file SensorCommonPlugin.h.

◆ dwSensorPlugin_getSensorInformation

typedef dwStatus(* dwSensorPlugin_getSensorInformation) (dwSensorPlugin_information *information, dwSensorPluginSensorHandle_t sensor)

Gets information of this sensor.

Parameters
[out]informationInformation struct for this sensor.
[in]sensorSpecifies the sensor to which the constants are related.
Returns
DW_FAILURE, DW_SUCCESS

Definition at line 170 of file SensorCommonPlugin.h.

◆ dwSensorPlugin_pushData

typedef dwStatus(* dwSensorPlugin_pushData) (size_t *lenPushed, uint8_t const *data, size_t const size, dwSensorPluginSensorHandle_t handle)

Pushes raw data obtained from a previous 'dwSensorPlugin_readRawData' call for decoding.

Depending on the sensor implementation, actual decoding may happen synchronously on this call, or on a subsequently 'dwSensorPlugin_pushData' call when enough raw data has been received.

Parameters
[out]lenPushedA pointer to the amount of data that was successfully pushed to the plugin
[in]dataA pointer to data that was populated with the RAW data.
[in]sizeSize of the data to be pushed
[in]handleSpecifies the sensor the data came from.
Returns
DW_INVALID_HANDLE - if the sensor handle is NULL or invalid
DW_CALL_NOT_ALLOWED - if sensor cannot execute the call, for example, due to decoding data.
DW_NOT_SUPPORTED - if sensor does not implement this functionality.
DW_INVALID_ARGUMENT - if given data pointer is invalid.
DW_SUCCESS
Note
CAN sensor plugins do not need to provide this method, as decoding happens by DriveWorks sensor layer. The corresponding entry in 'dwSensorCommonPluginFunctions' can be null.

Definition at line 159 of file SensorCommonPlugin.h.

◆ dwSensorPlugin_rawDataReadyForDecode

typedef dwStatus(* dwSensorPlugin_rawDataReadyForDecode) (size_t *offset, size_t *size, uint8_t const *const data, dwSensorPluginSensorHandle_t ctx)

API for sensor that raw data and decoded packet are many to one relationship.

Push raw data segments to sensor plugin and check if the raw data is ready for decode.

Parameters
[out]offsetfor a packet
[out]sizefor a complete packet
[in]dataraw TP segment data.
[in]ctxcontext handle.
Returns
DW_INVALID_ARGUMENT - if pointer to the sensor handle is NULL.
DW_NOT_READY - if sensor cannot generate a combine raw packet.
DW_SUCCESS

Definition at line 241 of file SensorCommonPlugin.h.

Enumeration Type Documentation

◆ dwSensorPlugin_rawDataLevel

Enumerator
DW_SENSORS_RAW_DATA_LEVEL_ZERO 
DW_SENSORS_RAW_DATA_LEVEL_ONE 
DW_SENSORS_RAW_DATA_LEVEL_TWO 
DW_SENSORS_RAW_DATA_LEVEL_COUNT 

Definition at line 101 of file SensorCommonPlugin.h.

◆ dwSensorPlugin_rawToDecMap

Enumerator
DW_SENSORS_RAW_DEC_ONE_TO_ONE 

1-1 map between raw data and decoded packet

DW_SENSORS_RAW_DEC_MANY_TO_ONE 

N-1(N>1) map between raw data and decoded packet.

DW_SENSORS_RAW_DEC_NOT_SUPPORTED 

Not supported.

Definition at line 55 of file SensorCommonPlugin.h.

◆ dwSensorPlugin_timeDomain

Enumerator
DW_SENSORS_PLUGIN_TIME_DOMAIN_HOST 

Host Clock, as given by DW TimeSource.

DW_SENSORS_PLUGIN_TIME_DOMAIN_TSC 

Tegra Timestamp System Counter.

DW_SENSORS_PLUGIN_TIME_DOMAIN_PTP 

Precision Time Protocol.

DW_SENSORS_PLUGIN_TIME_DOMAIN_UTC 

Coordinated Universal Time.

DW_SENSORS_PLUGIN_TIME_DOMAIN_UTCTOH 

Top of Hour in Coordinated Universal Time.

DW_SENSORS_PLUGIN_TIME_DOMAIN_MISC 

Any other timestamp.

DW_SENSORS_PLUGIN_TIME_DOMAIN_COUNT 

Number of time domains in this enum (leave at end)

Definition at line 65 of file SensorCommonPlugin.h.