DriveWorks SDK Reference
5.4.5418 Release
For Test and Development only

SensorCommonPlugin.h
Go to the documentation of this file.
1 //
3 // Notice
4 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 //
9 // NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10 // information or for any infringement of patents or other rights of third parties that may
11 // result from its use. No license is granted by implication or otherwise under any patent
12 // or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13 // expressly authorized by NVIDIA. Details are subject to change without notice.
14 // This code supersedes and replaces all information previously supplied.
15 // NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16 // components in life support devices or systems without express written approval of
17 // NVIDIA CORPORATION & AFFILIATES.
18 //
19 // SPDX-FileCopyrightText: Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20 // SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21 //
22 // NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23 // property and proprietary rights in and to this material, related
24 // documentation and any modifications thereto. Any use, reproduction,
25 // disclosure or distribution of this material and related documentation
26 // without an express license agreement from NVIDIA CORPORATION or
27 // its affiliates is strictly prohibited.
28 //
30 
38 #ifndef DW_SENSORS_COMMON_PLUGIN_H
39 #define DW_SENSORS_COMMON_PLUGIN_H
40 
41 #include <dw/core/base/Types.h>
43 
44 #include <dw/sensors/Sensors.h>
45 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
72 
74 typedef struct
75 {
77  size_t packetSize;
79 
80 // Holds the sensor firmware version information
81 typedef struct
82 {
83  // Separate the fwVersion string into three pieces.
84  uint64_t versionMajor; // Firmware version major number
85  uint64_t versionMinor; // Firmware version minor number
86  uint64_t versionPatch; // Firmware version patch number
87  char* versionString; // Firmware version string
89 
90 // Holds the sensor information
91 typedef struct
92 {
95 
96 // Enum to indicate which level the raw data to read from
97 typedef enum {
98  DW_SENSORS_RAW_DATA_LEVEL_ZERO = 0, // Raw data same as from readRawData, TP segment in SOME/IP use case
99  DW_SENSORS_RAW_DATA_LEVEL_ONE = 1, // Raw data combined from LEVEL_ZERO raw Data, reassembled pdu(from segments) in SOME/IP use case
100  DW_SENSORS_RAW_DATA_LEVEL_TWO = 2, // Raw data combined from LEVEL_ONE raw Data, combined pdu(from split pdus)
101  DW_SENSORS_RAW_DATA_LEVEL_COUNT = 3 // Count for validating user passed level
103 
116 typedef dwStatus (*dwSensorPlugin_createHandle)(dwSensorPluginSensorHandle_t* handle,
117  dwSensorPluginProperties* properties,
118  const char* params, dwContextHandle_t ctx);
119 
131 typedef dwStatus (*dwSensorPlugin_release)(dwSensorPluginSensorHandle_t handle);
132 
146 typedef dwStatus (*dwSensorPlugin_createSensor)(const char* params, dwSALHandle_t sal, dwSensorPluginSensorHandle_t handle);
147 
160 typedef dwStatus (*dwSensorPlugin_start)(dwSensorPluginSensorHandle_t handle);
161 
171 typedef dwStatus (*dwSensorPlugin_stop)(dwSensorPluginSensorHandle_t handle);
172 
184 typedef dwStatus (*dwSensorPlugin_reset)(dwSensorPluginSensorHandle_t handle);
185 
224 typedef dwStatus (*dwSensorPlugin_readRawData)(const uint8_t** data, size_t* size, dwTime_t* timestamp,
225  dwTime_t timeout_us, dwSensorPluginSensorHandle_t handle);
226 
240 typedef dwStatus (*dwSensorPlugin_returnRawData)(const uint8_t* data, dwSensorPluginSensorHandle_t handle);
241 
262 typedef dwStatus (*dwSensorPlugin_pushData)(size_t* lenPushed, const uint8_t* data, size_t const size, dwSensorPluginSensorHandle_t handle);
263 
273 typedef dwStatus (*dwSensorPlugin_getSensorInformation)(dwSensorPlugin_information* information, dwSensorPluginSensorHandle_t sensor);
274 
297 typedef dwStatus (*dwSensorPlugin_getRawPackets)(uint8_t const* const rawData, size_t* const size,
298  dwSensorPlugin_rawDataLevel level, int32_t groupNum, uint8_t const** const data, dwSensorPluginSensorHandle_t handle);
299 
301 typedef struct
302 {
315 
318 #ifdef __cplusplus
319 }
320 #endif
321 
322 #endif
NVIDIA DriveWorks API: Core Types
dwStatus(* dwSensorPlugin_start)(dwSensorPluginSensorHandle_t handle)
Starts the sensor previously successfully created with &#39;dwSensorPlugin_createSensor&#39; interface...
dwStatus(* dwSensorPlugin_reset)(dwSensorPluginSensorHandle_t handle)
Resets the sensor.
dwSensorPlugin_createSensor createSensor
dwStatus(* dwSensorPlugin_getSensorInformation)(dwSensorPlugin_information *information, dwSensorPluginSensorHandle_t sensor)
Gets information of this sensor.
void * dwSensorPluginSensorHandle_t
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.
dwSensorPlugin_rawDataLevel
dwStatus(* dwSensorPlugin_release)(dwSensorPluginSensorHandle_t handle)
Releases a sensor managed by the plugin module.
dwStatus(* dwSensorPlugin_stop)(dwSensorPluginSensorHandle_t handle)
Stops the sensor.
dwSensorPlugin_createHandle createHandle
dwSensorPlugin_release release
dwStatus(* dwSensorPlugin_createHandle)(dwSensorPluginSensorHandle_t *handle, dwSensorPluginProperties *properties, const char *params, dwContextHandle_t ctx)
Creates a new handle to the sensor managed by the plugin module.
dwStatus
Status definition.
Definition: Status.h:180
NVIDIA DriveWorks API: Sensors
dwSensorPlugin_readRawData readRawData
dwStatus(* dwSensorPlugin_returnRawData)(const uint8_t *data, dwSensorPluginSensorHandle_t handle)
Returns RAW data to sensor as a byte array.
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:82
dwStatus(* dwSensorPlugin_createSensor)(const char *params, dwSALHandle_t sal, dwSensorPluginSensorHandle_t handle)
Creates and initializes a new sensor managed by the plugin.
dwSensorPlugin_pushData pushData
Function Table exposing common plugin functions.
dwSensorPlugin_getRawPackets getRawPackets
dwSensorPlugin_returnRawData returnRawData
struct dwSALObject * dwSALHandle_t
Handle representing the Sensor Abstraction Layer interface.
Definition: Sensors.h:82
dwSensorPlugin_getSensorInformation getSensorInformation
Structure for generic constants returned by the plugin.
dwStatus(* dwSensorPlugin_readRawData)(const uint8_t **data, size_t *size, dwTime_t *timestamp, dwTime_t timeout_us, dwSensorPluginSensorHandle_t handle)
Reads RAW data for one single message from the sensor as byte array.
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:79
NVIDIA DriveWorks API: Core Methods
dwSensorPlugin_firmwareVersion firmware
size_t packetSize
Packet size for each raw data message.
dwStatus(* dwSensorPlugin_pushData)(size_t *lenPushed, const uint8_t *data, size_t const size, dwSensorPluginSensorHandle_t handle)
Pushes raw data obtained from a previous &#39;dwSensorPlugin_readRawData&#39; call for decoding.