Loading [MathJax]/extensions/tex2jax.js
  • <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>

  • DriveWorks SDK Reference
    5.20.37 Release
    For Test and Development only

    All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
    SensorCommonPlugin.h
    Go to the documentation of this file.
    1
    2//
    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-2024 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
    45
    67#ifdef __cplusplus
    68extern "C" {
    69#endif
    70
    73
    74// Enum to indicate the relationship between raw and decoded data for a custom sensor
    75typedef enum {
    83
    84// Enum to define Time Domain
    85typedef enum {
    94
    96typedef struct
    97{
    99 size_t packetSize;
    103
    104// Holds the sensor firmware version information
    105typedef struct
    106{
    107 // Separate the fwVersion string into three pieces.
    108 uint64_t versionMajor; // Firmware version major number
    109 uint64_t versionMinor; // Firmware version minor number
    110 uint64_t versionPatch; // Firmware version patch number
    111 char* versionString; // Firmware version string
    113
    114// Holds the sensor information
    115typedef struct
    116{
    119
    120// Enum to indicate which level the raw data to read from
    121typedef enum {
    122 DW_SENSORS_RAW_DATA_LEVEL_ZERO = 0, // Raw data same as from readRawData, TP segment in SOME/IP use case
    123 DW_SENSORS_RAW_DATA_LEVEL_ONE = 1, // Raw data combined from LEVEL_ZERO raw Data, reassembled pdu(from segments) in SOME/IP use case
    124 DW_SENSORS_RAW_DATA_LEVEL_TWO = 2, // Raw data combined from LEVEL_ONE raw Data, combined pdu(from split pdus)
    125 DW_SENSORS_RAW_DATA_LEVEL_COUNT = 3 // Count for validating user passed level
    127
    141 dwSensorPluginProperties* properties,
    142 char const* params, dwContextHandle_t ctx);
    143
    156
    171
    185
    196
    209
    248typedef dwStatus (*dwSensorPlugin_readRawData)(uint8_t const** data, size_t* size, dwTime_t* timestamp,
    249 dwTime_t timeout_us, dwSensorPluginSensorHandle_t handle);
    250
    265
    286typedef dwStatus (*dwSensorPlugin_pushData)(size_t* lenPushed, uint8_t const* data, size_t const size, dwSensorPluginSensorHandle_t handle);
    287
    298
    322DW_DEPRECATED("dwSensorPlugin_getRawPackets is deprecated and will be removed in next major release. Please use dwSensorPlugin_getRawPackets instead")
    323typedef dwStatus (*dwSensorPlugin_getRawPackets)(uint8_t const* const rawData, size_t* const size,
    324 dwSensorPlugin_rawDataLevel level, int32_t groupNum, uint8_t const** const data, dwSensorPluginSensorHandle_t handle);
    325
    352typedef dwStatus (*dwSensorPlugin_getRawPacketsNew)(uint8_t const* const rawData, size_t* const size,
    353 dwSensorPlugin_rawDataLevel level, int32_t groupNum, uint8_t const** const data, int32_t* extra1, int32_t* extra2, dwSensorPluginSensorHandle_t handle);
    368typedef dwStatus (*dwSensorPlugin_rawDataReadyForDecode)(size_t* offset, size_t* size, uint8_t const* const data, dwSensorPluginSensorHandle_t ctx);
    369
    371typedef struct
    372{
    383#pragma GCC diagnostic push
    384#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
    386#pragma GCC diagnostic pop
    391
    394#ifdef __cplusplus
    395}
    396#endif
    397
    398#endif
    NVIDIA DriveWorks API: Core Methods
    dwStatus
    Status definition.
    Definition: ErrorDefs.h:44
    NVIDIA DriveWorks API: SensorTypes
    NVIDIA DriveWorks API: Core Types
    int64_t dwTime_t
    Specifies a timestamp unit, in microseconds.
    Definition: BasicTypes.h:65
    struct dwContextObject * dwContextHandle_t
    Context handle.
    Definition: Context.h:85
    #define DW_DEPRECATED(msg)
    Definition: Exports.h:68
    size_t packetSize
    Packet size for each raw data message.
    dwSensorPlugin_returnRawData returnRawData
    dwSensorPlugin_rawToDecMap rawToDec
    Indicate the relationship between raw data and decoded packet.
    dwSensorPlugin_getRawPacketsNew getRawPacketsNew
    dwSensorPlugin_firmwareVersion firmware
    dwSensorPlugin_pushData pushData
    dwSensorPlugin_getSensorInformation getSensorInformation
    dwSensorPlugin_createHandle createHandle
    dwSensorPlugin_release release
    dwSensorPlugin_rawDataReadyForDecode rawDataReadyForDecode
    Funciton pointer used to check if raw data is ready for decode.
    dwSensorPlugin_readRawData readRawData
    dwSensorPlugin_createSensor createSensor
    dwSensorPlugin_getRawPackets getRawPackets
    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.
    dwStatus(* dwSensorPlugin_createSensor)(char const *params, dwSALHandle_t sal, dwSensorPluginSensorHandle_t handle)
    Creates and initializes a new sensor managed by the plugin.
    dwStatus(* dwSensorPlugin_readRawData)(uint8_t const **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.
    dwStatus(* dwSensorPlugin_stop)(dwSensorPluginSensorHandle_t handle)
    Stops the sensor.
    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.
    dwSensorPlugin_rawToDecMap
    dwStatus(* dwSensorPlugin_release)(dwSensorPluginSensorHandle_t handle)
    Releases a sensor managed by the plugin module.
    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.
    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.
    dwStatus(* dwSensorPlugin_start)(dwSensorPluginSensorHandle_t handle)
    Starts the sensor previously successfully created with 'dwSensorPlugin_createSensor' interface.
    void * dwSensorPluginSensorHandle_t
    Plugin handle. Used in plugin public interfaces.
    dwStatus(* dwSensorPlugin_getSensorInformation)(dwSensorPlugin_information *information, dwSensorPluginSensorHandle_t sensor)
    Gets information of this sensor.
    dwSensorPlugin_timeDomain
    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.
    dwSensorPlugin_rawDataLevel
    dwStatus(* dwSensorPlugin_reset)(dwSensorPluginSensorHandle_t handle)
    Resets the sensor.
    dwStatus(* dwSensorPlugin_returnRawData)(uint8_t const *data, dwSensorPluginSensorHandle_t handle)
    Returns RAW data to sensor as a byte array.
    @ DW_SENSORS_RAW_DEC_NOT_SUPPORTED
    Not supported.
    @ DW_SENSORS_RAW_DEC_MANY_TO_ONE
    N-1(N>1) map between raw data and decoded packet.
    @ DW_SENSORS_RAW_DEC_ONE_TO_ONE
    1-1 map between raw data and decoded packet
    @ DW_SENSORS_PLUGIN_TIME_DOMAIN_PTP
    Precision Time Protocol.
    @ DW_SENSORS_PLUGIN_TIME_DOMAIN_UTC
    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)
    @ DW_SENSORS_PLUGIN_TIME_DOMAIN_HOST
    Host Clock, as given by DW TimeSource.
    @ DW_SENSORS_PLUGIN_TIME_DOMAIN_UTCTOH
    Top of Hour in Coordinated Universal Time.
    @ DW_SENSORS_PLUGIN_TIME_DOMAIN_TSC
    Tegra Timestamp System Counter.
    @ DW_SENSORS_RAW_DATA_LEVEL_TWO
    @ DW_SENSORS_RAW_DATA_LEVEL_ZERO
    @ DW_SENSORS_RAW_DATA_LEVEL_ONE
    @ DW_SENSORS_RAW_DATA_LEVEL_COUNT
    Function Table exposing common plugin functions.
    Structure for generic constants returned by the plugin.
    struct dwSALObject * dwSALHandle_t
    Handle representing the Sensor Abstraction Layer interface.
    Definition: SensorTypes.h:72
    人人超碰97caoporen国产