Skip to navigation

pss_daemon.h

View as Markdown

The client API of libnvpssd_interface: register with the SEI daemon, send heartbeats, report safety events and trust verdicts, and terminate.

Part of the SEI client interface. Generated from the header published in safety-core/, release 1.3-26.07.5. The development packages install it in /opt/nvidia/psf/include.

#include "pss_daemon.h"

Functions

NvPSSRegisterPSSClient

NvPSSDErr NvPSSRegisterPSSClient(uint32_t *clientId, uint8_t clientType);

NvPSSRegisterPSSClientInstance

NvPSSDErr NvPSSRegisterPSSClientInstance(uint32_t *clientId, uint8_t clientType, uint8_t instanceId);

NvPSSTerminatePSSClient

NvPSSDErr NvPSSTerminatePSSClient(const uint32_t clientId);

NvPSSReportSafetyEvent

NvPSSDErr NvPSSReportSafetyEvent(const uint32_t clientId, const SafetyEvent *event);

Report a safety event.

Clients use this function to report safety events to the PSS daemon when they detect potential hazards.

ParameterDescription
clientIdThe ID of the client reporting the event.
eventA SafetyEvent structure containing details about the detected safety event.

Returns: NVPSSD_SUCCESS if the daemon accepted the event (REPORT_ACCEPTED), NVPSSD_FAIL otherwise. The specific rejection reason (one of the REPORT_REJECTED_* codes) is logged server-side.

NvPSSSendHeartbeat

NvPSSDErr NvPSSSendHeartbeat(const uint32_t clientId, const uint8_t clientType);

Types

PSDRegistrationMsg_t

struct PSDRegistrationMsg_t

Registration message structure for PSD socket communication.

This structure is used for event type registration between PSS Daemon and PSD clients DecisionRequest/DecisionResponse are sent directly without wrapping

FieldDeclarationDescription
msgTypeuint32_t msgType
clientIduint32_t clientId
eventTypesCountuint32_t eventTypesCount
eventTypesEventType eventTypes[10]

NvPSSDToPSDResp_t

struct NvPSSDToPSDResp_t

Response structure for PSD socket communication.

This structure is used by PSS Daemon to respond to PSD client requests.

FieldDeclarationDescription
clientIduint32_t clientId
statusuint32_t status

NvPSSDStatus_t

enum NvPSSDStatus_t
ValueInitializerDescription
NVPSSD_SUCCESS0
NVPSSD_FAIL

Type aliases

NameDefinitionDescription
NvPSSDErrtypedef enum NvPSSDStatus_t NvPSSDErr
PSDRegistrationMsgtypedef struct PSDRegistrationMsg_t PSDRegistrationMsgRegistration message structure for PSD socket communication. This structure is used for event type registration between PSS Daemon and PSD clients DecisionRequest/DecisionResponse are sent directly without wrapping
NvPSSDToPSDResptypedef struct NvPSSDToPSDResp_t NvPSSDToPSDRespResponse structure for PSD socket communication. This structure is used by PSS Daemon to respond to PSD client requests.

Macros

MacroValueDescription
NVPSS_DAEMON_DEFAULT_CONF"/opt/nvidia/psf/bin/nvpss.conf"Default configuration file for nvpss_daemon. Overridable with conf. Defined here rather than inline at the read site so the usage text, the default and any future packaging reference are one string. The override exists because a path with no override made the daemon unrunnable in a test fixture without editing an installed system file.
PSS_DAEMON_SOCKET_PATH"/run/nvpsf/nvpssd_to_psd"
PSS_DAEMON_RPC_SOCKET_PATH"/run/nvpsf/nvpssd"
MAX_PSD_CLIENTS32
REGISTER_PSD_CLIENT100
REGISTER_EVENT_TYPES101
UNREGISTER_PSD_CLIENT102
PSS_MDX_INSTANCE_MAX8U
REGISTER_ACCEPTED1 /* Registration successful */
REGISTER_REJECTED_DUPLICATE_TYPE2 /* Another active client of the same type exists */
REGISTER_REJECTED_INVALID_TYPE3 /* clientType not one of the valid CLIENT_* constants */
REGISTER_REJECTED_INVALID_INSTANCE4 /* instance id above PSS_MDX_INSTANCE_MAX, or non-zero for a client type other than CLIENT_MDX */
TERMINATE_ACCEPTED1 /* Client termination completed successfully */
REPORT_ACCEPTED1 /* Event accepted and forwarded to fusion / routing */
REPORT_REJECTED_CLIENTID_MISMATCH2 /* fusionMetadata.clientID does not match the RPC-assigned client id */
REPORT_REJECTED_UNAUTHORIZED3 /* Heartbeat fault, payload too small, or unauthorized client type */
REPORT_REJECTED_LOW_CONFIDENCE4 /* confidenceLevel below configured acceptance threshold */
REPORT_REJECTED_VALIDATION_FAILED5 /* CRC, schema, or field-range validation failed */
REPORT_REJECTED_UNRESOLVED_SENSOR6 /* Per-sensor event whose sensor identity could not be resolved: fusionMetadata.pipelineID == 0. Distinct from VALIDATION_FAILED so a client can tell a configuration error from a corrupt message. */
HEARTBEAT_ACK1 /* PSS daemon acknowledges SEND_HEARTBEAT */
HB_MSG0x7E
HB_INTERVAL_MS5000 /* Nominal period between SEND_HEARTBEAT (clients + gateway PSS-HB thread). */
HB_STALE_GRACE_MS1500 /* Slack above HB_INTERVAL_MS so jitter/scheduling does not false-stale before next HB */
HB_TIMEOUT_MS(HB_INTERVAL_MS + HB_STALE_GRACE_MS) /* Stale if no SEND_HEARTBEAT within this window */
CLIENT_MDX1
CLIENT_SAFETY_MONITOR2
CLIENT_PSD_GATEWAY3
CLIENT_PERCEPTION_MONITOR4