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.
◆ dwSensorCANPluginFunctionTable
struct dwSensorCANPluginFunctionTable |
◆ dwSensorCANPlugin_clearFilter
Reset the filter set by 'dwSensorCANPlugin_setFilter' interface.
- Parameters
-
[in] | sensor | Specifies 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
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] | msg | A pointer to the message to be sent. |
[in] | timeout_us | Specifies the timeout, in microseconds, to wait at most before giving up. |
[in] | sensor | Specifies 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
Specifes a set of CAN IDs to be filtered.
The filter is active if it contains at least one sender ID.
- Parameters
-
[in] | canIDs | A pointer to an array of CAN IDs to be filtered. Any matching CAN ID is used together with the mask to filter. |
[in] | masks | A 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] | numCanIDs | Specifies the number of elements passed in the array. To remove the filter, pass 0. |
[in] | sensor | Specifies 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
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] | use | Specifies either 'true' or 'false' to enable or disable hardware timestamping. |
[in] | sensor | Specifies 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.
◆ dwSensorCANPlugin_getFunctionTable()
Gets the handle to functions defined in 'dwSensorCANPluginFunctionTable' structure.
- Parameters
-
[out] | functions | A pointer to the function table |
- Returns
- DW_INVALID_ARGUMENT - if pointer to the function table is NULL.
DW_SUCCESS