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
    Interpreter.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) 2016-2023 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
    46#ifndef DW_SENSORS_CANBUS_INTERPRETER_H_
    47#define DW_SENSORS_CANBUS_INTERPRETER_H_
    48
    49#include <dw/core/base/Config.h>
    51
    54
    56#define DW_SENSORS_CAN_INTERPRETER_MESSAGE_MAX_SIGNALS 128
    57
    59#define DW_SENSORS_CAN_INTERPRETER_MAX_MESSAGE_NAME_LEN 32
    60
    62#define DW_SENSORS_CAN_INTERPRETER_MAX_SIGNAL_NAME_LEN 32
    63
    64#ifdef __cplusplus
    65extern "C" {
    66#endif
    67
    69typedef struct dwCANInterpreterObject* dwCANInterpreterHandle_t;
    70
    73typedef void (*dwCANInterpreterAddMessageFunc_t)(const dwCANMessage* msg, void* userData);
    74
    77typedef uint32_t (*dwCANInterpreterGetNumAvailableFunc_t)(void* userData);
    78
    82typedef bool (*dwCANInterpreterGetSignalInfoFunc_t)(const char8_t** name, dwTrivialDataType* type,
    83 dwCANVehicleData* data,
    84 uint32_t idx, void* userData);
    85
    88typedef bool (*dwCANInterpreterGetDataf32Func_t)(float32_t* value, dwTime_t* timestamp_us, uint32_t idx, void* userData);
    89
    92typedef bool (*dwCANInterpreterGetDataf64Func_t)(float64_t* value, dwTime_t* timestamp_us, uint32_t idx, void* userData);
    93
    96typedef bool (*dwCANInterpreterGetDatai32Func_t)(int32_t* value, dwTime_t* timestamp_us, uint32_t idx, void* userData);
    97
    100{
    113
    115
    139 void* userData, dwContextHandle_t context);
    140
    168 const char8_t* inputDBC,
    170
    190 const char8_t* dbc,
    192
    211
    212// ------------ encoding
    234 const dwCANMessage* msg,
    235 dwCANInterpreterHandle_t interpreter);
    236
    258dwStatus dwCANInterpreter_getSignalNameInMessage(const char8_t** name, uint32_t idx,
    259 const dwCANMessage* msg,
    260 dwCANInterpreterHandle_t interpreter);
    261
    282
    301 dwCANInterpreterHandle_t interpreter);
    302
    326dwStatus dwCANInterpreter_encodef32(float32_t value, const char8_t* signal,
    327 dwCANMessage* msg,
    328 dwCANInterpreterHandle_t interpreter);
    329
    340dwStatus dwCANInterpreter_encodef64(float64_t value, const char8_t* signal,
    341 dwCANMessage* msg,
    342 dwCANInterpreterHandle_t interpreter);
    343
    354dwStatus dwCANInterpreter_encodei32(int32_t value, const char8_t* signal,
    355 dwCANMessage* msg,
    356 dwCANInterpreterHandle_t interpreter);
    357
    358// ----------------- consumption
    377 dwCANInterpreterHandle_t interpreter);
    378
    397
    421 dwCANInterpreterHandle_t interpreter);
    422
    439dwStatus dwCANInterpreter_getSignalName(const char8_t** name, uint32_t idx,
    440 dwCANInterpreterHandle_t interpreter);
    441
    460 dwCANInterpreterHandle_t interpreter);
    461
    480 dwCANInterpreterHandle_t interpreter);
    481
    506dwStatus dwCANInterpreter_getf32(float32_t* value, dwTime_t* timestamp_us, uint32_t idx, dwCANInterpreterHandle_t interpreter);
    507
    518dwStatus dwCANInterpreter_getf64(float64_t* value, dwTime_t* timestamp_us, uint32_t idx, dwCANInterpreterHandle_t interpreter);
    519
    530dwStatus dwCANInterpreter_geti32(int32_t* value, dwTime_t* timestamp_us, uint32_t idx, dwCANInterpreterHandle_t interpreter);
    531
    532#ifdef __cplusplus
    533}
    534#endif
    536#endif // DW_SENSORS_CANBUS_INTERPRETER_H_
    Holds a CAN package.
    Definition: CANTypes.h:108
    NVIDIA DriveWorks API: CAN
    dwStatus
    Status definition.
    Definition: ErrorDefs.h:44
    NVIDIA DriveWorks API: Vehicle Data
    NVIDIA DriveWorks API: Core Exports
    float float32_t
    Specifies POD types.
    Definition: BasicTypes.h:59
    int64_t dwTime_t
    Specifies a timestamp unit, in microseconds.
    Definition: BasicTypes.h:65
    double float64_t
    Definition: BasicTypes.h:60
    struct dwContextObject * dwContextHandle_t
    Context handle.
    Definition: Context.h:85
    #define DW_API_PUBLIC
    Definition: Exports.h:56
    dwTrivialDataType
    Specifies a type indicator of the underlying trivial data type.
    Definition: TypesExtra.h:58
    dwCANInterpreterGetSignalInfoFunc_t getSignalInfo
    getSignalInfo callback function.
    Definition: Interpreter.h:106
    dwCANInterpreterAddMessageFunc_t addMessage
    addMessage callback function.
    Definition: Interpreter.h:102
    dwCANInterpreterGetDatai32Func_t getDatai32
    getDatai32 callback function.
    Definition: Interpreter.h:112
    dwCANInterpreterGetDataf32Func_t getDataf32
    getDataf32 callback function.
    Definition: Interpreter.h:108
    dwCANInterpreterGetNumAvailableFunc_t getNumAvailableSignals
    getNumAvailableSignals callback function.
    Definition: Interpreter.h:104
    dwCANInterpreterGetDataf64Func_t getDataf64
    getDataf64 callback function.
    Definition: Interpreter.h:110
    DW_API_PUBLIC dwStatus dwCANInterpreter_buildFromDBCString(dwCANInterpreterHandle_t *interpreter, const char8_t *dbc, dwContextHandle_t ctx)
    Creates a CAN data interpreter based on DBC file format and initializes the interpreter from a string...
    DW_API_PUBLIC dwStatus dwCANInterpreter_encodei32(int32_t value, const char8_t *signal, dwCANMessage *msg, dwCANInterpreterHandle_t interpreter)
    Same as dwCANInterpreter_encodef32, but for int32 types.
    DW_API_PUBLIC dwStatus dwCANInterpreter_createMessage(dwCANMessage *msg, uint32_t id, dwCANInterpreterHandle_t interpreter)
    Initializes an empty CAN message an interpreter can encoded signals into.
    uint32_t(* dwCANInterpreterGetNumAvailableFunc_t)(void *userData)
    Gets the number of signals available to be retrieved.
    Definition: Interpreter.h:77
    DW_API_PUBLIC dwStatus dwCANInterpreter_encodef32(float32_t value, const char8_t *signal, dwCANMessage *msg, dwCANInterpreterHandle_t interpreter)
    Encodes a value for a signal into a given message.
    DW_API_PUBLIC dwStatus dwCANInterpreter_getSignalName(const char8_t **name, uint32_t idx, dwCANInterpreterHandle_t interpreter)
    Gets the name of a signal available for consumption by the application as a string.
    DW_API_PUBLIC dwStatus dwCANInterpreter_getSignalRange(float64_t *minimum, float64_t *maximum, uint32_t idx, dwCANInterpreterHandle_t interpreter)
    Returns the range of validity of data for a signal available for consumption by the application.
    DW_API_PUBLIC dwStatus dwCANInterpreter_getSignalNameInMessage(const char8_t **name, uint32_t idx, const dwCANMessage *msg, dwCANInterpreterHandle_t interpreter)
    Gets the name of a signal that the CAN interpreter can encode in the currently active encoded message...
    bool(* dwCANInterpreterGetDatai32Func_t)(int32_t *value, dwTime_t *timestamp_us, uint32_t idx, void *userData)
    Returns false if no int32 data is available, true otherwise For the user-function expected behavior s...
    Definition: Interpreter.h:96
    DW_API_PUBLIC dwStatus dwCANInterpreter_encodef64(float64_t value, const char8_t *signal, dwCANMessage *msg, dwCANInterpreterHandle_t interpreter)
    Same as dwCANInterpreter_encodef32, but for float64 types.
    void(* dwCANInterpreterAddMessageFunc_t)(const dwCANMessage *msg, void *userData)
    Pushes new messages to the interpreter.
    Definition: Interpreter.h:73
    DW_API_PUBLIC dwStatus dwCANInterpreter_buildFromDBC(dwCANInterpreterHandle_t *interpreter, const char8_t *inputDBC, dwContextHandle_t ctx)
    Creates a CAN data interpreter based on DBC file format.
    bool(* dwCANInterpreterGetDataf64Func_t)(float64_t *value, dwTime_t *timestamp_us, uint32_t idx, void *userData)
    Returns false if no float64 data is available, true otherwise For the user-function expected behavior...
    Definition: Interpreter.h:92
    DW_API_PUBLIC dwStatus dwCANInterpreter_consume(const dwCANMessage *msg, dwCANInterpreterHandle_t interpreter)
    Pushes a new message to the interpreter.
    DW_API_PUBLIC dwStatus dwCANInterpreter_createMessageFromName(dwCANMessage *msg, const char8_t *msgName, dwCANInterpreterHandle_t interpreter)
    Initializes an empty can message an interpreter can encoded signals into.
    DW_API_PUBLIC dwStatus dwCANInterpreter_getf64(float64_t *value, dwTime_t *timestamp_us, uint32_t idx, dwCANInterpreterHandle_t interpreter)
    Same as dwCANInterpreter_getf32, but for float64 types.
    DW_API_PUBLIC dwStatus dwCANInterpreter_geti32(int32_t *value, dwTime_t *timestamp_us, uint32_t idx, dwCANInterpreterHandle_t interpreter)
    Same as dwCANInterpreter_getf32, but for int32 types.
    struct dwCANInterpreterObject * dwCANInterpreterHandle_t
    CAN message interpreter handle.
    Definition: Interpreter.h:69
    DW_API_PUBLIC dwStatus dwCANInterpreter_buildFromCallbacks(dwCANInterpreterHandle_t *interpreter, dwCANInterpreterInterface callbacks, void *userData, dwContextHandle_t context)
    Creates a CAN data interpreter based on user provided callbacks.
    DW_API_PUBLIC dwStatus dwCANInterpreter_getNumberSignalsInMessage(uint32_t *num, const dwCANMessage *msg, dwCANInterpreterHandle_t interpreter)
    Gets the number of signals a CAN interpreter can encode into the provided message.
    DW_API_PUBLIC dwStatus dwCANInterpreter_getNumberSignals(uint32_t *num, dwCANInterpreterHandle_t interpreter)
    Gets the number of signals decoded and available for consumption by the application side.
    DW_API_PUBLIC dwStatus dwCANInterpreter_getSignalType(dwTrivialDataType *type, uint32_t idx, dwCANInterpreterHandle_t interpreter)
    Returns the type of the value of a signal available for consumption by the application.
    DW_API_PUBLIC dwStatus dwCANInterpreter_release(dwCANInterpreterHandle_t interpreter)
    Closes previously opened interpreter.
    bool(* dwCANInterpreterGetDataf32Func_t)(float32_t *value, dwTime_t *timestamp_us, uint32_t idx, void *userData)
    Returns false if no float32 data is available, true otherwise For the user-function expected behavior...
    Definition: Interpreter.h:88
    DW_API_PUBLIC dwStatus dwCANInterpreter_getf32(float32_t *value, dwTime_t *timestamp_us, uint32_t idx, dwCANInterpreterHandle_t interpreter)
    Gets a 'float32_t' value from the available values.
    DW_API_PUBLIC dwStatus dwCANInterpreter_getDataSignalIndex(uint32_t *idx, dwCANVehicleData data, dwCANInterpreterHandle_t interpreter)
    Gets the index of a signal of the last consumed message that corresponds to a certain predefined data...
    bool(* dwCANInterpreterGetSignalInfoFunc_t)(const char8_t **name, dwTrivialDataType *type, dwCANVehicleData *data, uint32_t idx, void *userData)
    Gets the name and type of a signal; the callback must return false if the query fails,...
    Definition: Interpreter.h:82
    Interface for callback based CAN data interpreter.
    Definition: Interpreter.h:100
    dwCANVehicleData
    A set of enumeration constants representing the default data signals.
    Definition: VehicleData.h:66
    人人超碰97caoporen国产