Provides an interface for non-standard CAN sensors.
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_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... | |
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_parseDataBuffer) (dwCANMessage *output, dwSensorPluginSensorHandle_t sensor) |
Processes the data previously passed via the 'dwSensorPlugin_pushData' interface. More... | |
Functions | |
dwStatus | dwSensorCANPlugin_getFunctionTable (dwSensorCANPluginFunctionTable *functions) |
Gets the handle to functions defined in 'dwSensorCANPluginFunctionTable' structure. More... | |
typedef dwStatus(* dwSensorCANPlugin_clearFilter) (dwSensorPluginSensorHandle_t sensor) |
Reset the filter set by 'dwSensorCANPlugin_setFilter' interface.
[in] | sensor | Specifies the sensor. |
Definition at line 49 of file CANPlugin.h.
typedef dwStatus(* dwSensorCANPlugin_parseDataBuffer) (dwCANMessage *output, dwSensorPluginSensorHandle_t sensor) |
Processes the data previously passed via the 'dwSensorPlugin_pushData' interface.
The interpreted memory buffer outputted from this API is owned by the plugin. The plugin shall support multiple buffers in flight via this API.
[out] | output | Pointer to decoded CAN message |
[in] | sensor | Specifies the sensor the data came from. |
Definition at line 129 of file CANPlugin.h.
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
[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. |
Definition at line 113 of file CANPlugin.h.
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.
[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. |
Definition at line 69 of file CANPlugin.h.
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.
[in] | use | Specifies either 'true' or 'false' to enable or disable hardware timestamping. |
[in] | sensor | Specifies the sensor handle. |
Definition at line 91 of file CANPlugin.h.
dwStatus dwSensorCANPlugin_getFunctionTable | ( | dwSensorCANPluginFunctionTable * | functions | ) |
Gets the handle to functions defined in 'dwSensorCANPluginFunctionTable' structure.
[out] | functions | A pointer to the function table |