DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Detailed Description

Provides an interface for non-standard CAN sensors.

Note
SW Release Applicability: These APIs are available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

Data Structures

struct  dwSensorCANPluginFunctionTable
 Function Table exposing CAN plugin functions. More...
 

Typedefs

typedef dwStatus(* dwSensorCANPlugin_clearFilter) (dwSensorPluginSensorHandle_t sensor)
 Reset the filter set by 'dwSensorCANPlugin_setFilter' interface. More...
 
typedef dwStatus(* dwSensorCANPlugin_send) (const dwCANMessage *msg, dwTime_t timeout_us, dwSensorPluginSensorHandle_t sensor)
 Sends a message over the CAN bus within a specified timeout. More...
 
typedef dwStatus(* dwSensorCANPlugin_setFilter) (const uint32_t *canIDs, const uint32_t *masks, uint16_t numCanIDs, dwSensorPluginSensorHandle_t sensor)
 Specifes a set of CAN IDs to be filtered. More...
 
typedef dwStatus(* dwSensorCANPlugin_setUseHwTimestamps) (bool use, dwSensorPluginSensorHandle_t sensor)
 Enables or disables hardware timestamp of the CAN messages. More...
 

Functions

dwStatus dwSensorCANPlugin_getFunctionTable (dwSensorCANPluginFunctionTable *functions)
 Gets the handle to functions defined in 'dwSensorCANPluginFunctionTable' structure. More...
 

Data Structure Documentation

◆ dwSensorCANPluginFunctionTable

struct dwSensorCANPluginFunctionTable

Typedef Documentation

◆ dwSensorCANPlugin_clearFilter

typedef dwStatus(* dwSensorCANPlugin_clearFilter) (dwSensorPluginSensorHandle_t sensor)

Reset the filter set by 'dwSensorCANPlugin_setFilter' interface.

Parameters
[in]sensorSpecifies the sensor.
Returns
DW_INVALID_HANDLE - if the sensor handle is NULL or invalid
DW_SUCCESS

Definition at line 69 of file CANPlugin.h.

◆ dwSensorCANPlugin_send

typedef dwStatus(* dwSensorCANPlugin_send) (const dwCANMessage *msg, dwTime_t timeout_us, dwSensorPluginSensorHandle_t sensor)

Sends a message over the CAN bus within a specified timeout.

A message is guaranteed to have been sent when this method returns 'DW_SUCCESS'. The method can block for up-to the specified amount of time if a bus is blocked or previous

See also
dwSensorCAN_readMessage() operation has not yet finished.
Parameters
[in]msgA pointer to the message to be sent.
[in]timeout_usSpecifies the timeout, in microseconds, to wait at most before giving up.
[in]sensorSpecifies a CAN bus sensor to send the message over.
Returns
DW_NOT_SUPPORTED - if the underlying sensor does not support send operation.
DW_INVALID_HANDLE - if given sensor handle is invalid.
DW_INVALID_ARGUMENT - if given arguments are invalid.
DW_TIME_OUT - if operation has timed out.
DW_SAL_SENSOR_ERROR - if there was an i/o or bus error.
DW_NOT_AVAILABLE - if sensor has not been started.
DW_SUCCESS
Note
Send operation using can.virtual is a no-op and returns always DW_SUCCESS

Definition at line 133 of file CANPlugin.h.

◆ dwSensorCANPlugin_setFilter

typedef dwStatus(* dwSensorCANPlugin_setFilter) (const uint32_t *canIDs, const uint32_t *masks, uint16_t numCanIDs, dwSensorPluginSensorHandle_t sensor)

Specifes a set of CAN IDs to be filtered.

The filter is active if it contains at least one sender ID.

Parameters
[in]canIDsA pointer to an array of CAN IDs to be filtered. Any matching CAN ID is used together with the mask to filter.
[in]masksA pointer to an array of filter masks to be applied. A mask is applied together with the ID as 'id & mask'. If mask is set to NULL, a default mask of '1FFFFFFF' is used.
[in]numCanIDsSpecifies the number of elements passed in the array. To remove the filter, pass 0.
[in]sensorSpecifies the sensor handle.
Returns
DW_NOT_SUPPORTED - if the underlying sensor does not support filter operation.
DW_INVALID_HANDLE - if given sensor handle is invalid.
DW_INVALID_ARGUMENT - if given arguments are invalid.
DW_SAL_SENSOR_ERROR - if there was a sensor error, i.e., filter cannot be set.
DW_SUCCESS

Definition at line 89 of file CANPlugin.h.

◆ dwSensorCANPlugin_setUseHwTimestamps

typedef dwStatus(* dwSensorCANPlugin_setUseHwTimestamps) (bool use, dwSensorPluginSensorHandle_t sensor)

Enables or disables hardware timestamp of the CAN messages.

Hardware timestamps are used per default when supported by the sensor. If HW timestamps are not supported, SW timestamps are used per default. HW timestamps can be turned off if the default behavior is not working properly with the current hardware stack.

Note
The effect takes place on the next (re)start of the sensor.
Parameters
[in]useSpecifies either 'true' or 'false' to enable or disable hardware timestamping.
[in]sensorSpecifies the sensor handle.
Attention
If the same physical CAN device/interface is shared by multiple sensors, setting HW timestamping affects timestamping of all sensors sharing the same device.
Note
If using AurixCAN as a driver, hardware timestamps are used as timestamped by Aurix.
Returns
DW_NOT_SUPPORTED - if the underlying sensor does not support hardware timestamps.
DW_INVALID_HANDLE - if given sensor handle is invalid
DW_INVALID_ARGUMENT - if given arguments are invalid
DW_SUCCESS

Definition at line 111 of file CANPlugin.h.

Function Documentation

◆ dwSensorCANPlugin_getFunctionTable()

dwStatus dwSensorCANPlugin_getFunctionTable ( dwSensorCANPluginFunctionTable functions)

Gets the handle to functions defined in 'dwSensorCANPluginFunctionTable' structure.

Parameters
[out]functionsA pointer to the function table
Returns
DW_INVALID_ARGUMENT - if pointer to the function table is NULL.
DW_SUCCESS