Proactive Safety Framework  1.0
NvPSD.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11 */
12 
13 #ifndef NVPSD_H
14 #define NVPSD_H
15 
16 #include "pss_protocol.h"
17 
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
28 typedef enum NvPSDErr
29 {
34 
35 typedef enum NvPSDEndpoint_t
36 {
40 
46 typedef struct NvPSDCallbacks
47 {
55 
56 
60 typedef struct NvPSDCtx* NvPSDCtx_t ;
61 
67 NvPSDCtx* NvPSDCreateContext();
68 
69 
83 NvPSDErr NvPSDInitialize(NvPSDCtx* ctx, const char* writeChannel, const char* readChannel,
84  const char* criticalWriteChannel, const char* criticalReadChannel,
85  NvPSDEndpoint endpoint);
86 
97 NvPSDErr NvPSDRegisterCallbacks(NvPSDCtx* ctx, NvPSDCallbacks* callbacks);
98 
108 NvPSDErr NvPSDStart(NvPSDCtx* ctx);
109 
110 /*
111  * @brief Receive a DecisionRequest and send a DecisionResponse.
112  * @description This function is used by PSD to receive a DecisionRequest, process it, and send back a DecisionResponse.
113  *
114  * @param[in] ctx Pointer to the NvPSD context.
115  * @param[in] request A const reference to a DecisionRequest as input.
116  * @param[in] response A non-const reference to a DecisionResponse to store the result.
117  *
118  * @return NvPSDErr Return an error code indicating whether the processing and communication were successful.
119  */
120 NvPSDErr NvPSDProcessDecisionRequest(NvPSDCtx* ctx, const DecisionRequest* request, DecisionResponse* response);
121 
129 NvPSDErr NvPSDStop(NvPSDCtx* ctx);
130 
138 NvPSDErr NvPSDExit(NvPSDCtx* ctx);
139 
145 void NvPSDDestroyContext(NvPSDCtx* ctx);
146 
147 // Functions for exchanging heartbeat messages
148 // Functions to update Configuration Data
149 
150 #ifdef __cplusplus
151 }
152 #endif
153 
154 #endif
NvPSDErr NvPSDRegisterCallbacks(NvPSDCtx *ctx, NvPSDCallbacks *callbacks)
Registers callbacks PSD.
NvPSDErr
Enumeration of PSD error codes.
Definition: NvPSD.h:29
@ NVPSD_NO_RSP
Definition: NvPSD.h:32
@ NVPSD_FAIL
Definition: NvPSD.h:31
@ NVPSD_SUCCESS
Definition: NvPSD.h:30
NvPSDErr NvPSDExit(NvPSDCtx *ctx)
Exits NvPSD.
NvPSDCtx * NvPSDCreateContext()
Creates a new NvPSD context.
NvPSDErr NvPSDInitialize(NvPSDCtx *ctx, const char *writeChannel, const char *readChannel, const char *criticalWriteChannel, const char *criticalReadChannel, NvPSDEndpoint endpoint)
Initializes NvPSD.
NvPSDEndpoint
Definition: NvPSD.h:36
@ NVPSD_CLIENT
Definition: NvPSD.h:38
@ NVPSD_PSS
Definition: NvPSD.h:37
NvPSDErr NvPSDStart(NvPSDCtx *ctx)
Starts the PSD communication.
void NvPSDDestroyContext(NvPSDCtx *ctx)
Destroys the NvPSD context.
NvPSDErr NvPSDProcessDecisionRequest(NvPSDCtx *ctx, const DecisionRequest *request, DecisionResponse *response)
struct NvPSDCtx * NvPSDCtx_t
Definition: NvPSD.h:60
NvPSDErr NvPSDStop(NvPSDCtx *ctx)
Stops the PSD communication.
Structure for decision request.
Definition: pss_protocol.h:197
Structure for decision response.
Definition: pss_protocol.h:208
Structure for PSD callbacks.
Definition: NvPSD.h:47
NvPSDErr(* notifyShutdownRequest)(void)
Definition: NvPSD.h:53
NvPSDErr(* processDecisionRequest)(const DecisionRequest *request, DecisionResponse *response)
Definition: NvPSD.h:49
NvPSDErr(* publishDecisionResponse)(const DecisionResponse *response)
Definition: NvPSD.h:51