Proactive Safety Framework  1.0
NvPSSCom.h File Reference
#include <stdint.h>
#include "NvPSSErr.h"

Go to the source code of this file.

Classes

struct  NvPSSComPacket
 Structure representing a PSS communication packet. More...
 
struct  NvPSSComDataSrcCallbacks
 Structure for data source callbacks. More...
 
struct  NvPSSComDataSinkCallbacks
 Structure for data sink callbacks. More...
 

Macros

#define MAX_DATA_SIZE   2048
 

Typedefs

typedef struct NvPSSComCtx * NvPSSComCtx_t
 

Enumerations

enum  NvPSSComCmd {
  START_PSS , PSS_RDY , PSS_NOT_RDY , FLOW_RATE ,
  FLOW_RATE_ACK , DATA , DATA_ACK , BAD_DATA ,
  BAD_DATA_ACK , CRC_MISMATCH , PAUSE , PAUSE_ACK ,
  RESUME , RESUME_ACK , BYE , BYE_ACK ,
  BAD_RESPONSE , PING , PING_ACK
}
 

Functions

NvPSSComCtx * NvPSSComCreateContext ()
 Creates a new NvPSSCom context. More...
 
NvPSSComErr NvPSSComDataSrcInit (NvPSSComCtx *ctx, const char *writeChannel, const char *readChannel)
 Initializes the NvPSSCom data source. More...
 
NvPSSComErr NvPSSComDataSinkInit (NvPSSComCtx *ctx, const char *writeChannel, const char *readChannel)
 Initializes the NvPSSCom data sink. More...
 
NvPSSComErr NvPSSDataSrcRegisterCallbacks (NvPSSComCtx *ctx, NvPSSComDataSrcCallbacks *srcCallbacks)
 Registers callbacks for the data source. More...
 
NvPSSComErr NvPSSDataSinkRegisterCallbacks (NvPSSComCtx *ctx, NvPSSComDataSinkCallbacks *sinkCallbacks)
 Registers callbacks for the data sink. More...
 
NvPSSComErr NvPSSComStart (NvPSSComCtx *ctx)
 Starts the PSS communication. More...
 
NvPSSComErr NvPSSComSetFlowRate (NvPSSComCtx *ctx, uint8_t flowRate)
 Sets the flow rate for PSS communication. More...
 
NvPSSComErr NvPSSComPushData (NvPSSComCtx *ctx, NvPSSComPacket *pkt)
 Pushes data to the PSS communication channel. More...
 
NvPSSComErr NvPSSComPause (NvPSSComCtx *ctx)
 Pauses the PSS communication. More...
 
NvPSSComErr NvPSSComResume (NvPSSComCtx *ctx)
 Resumes the PSS communication. More...
 
NvPSSComErr NvPSSComStop (NvPSSComCtx *ctx)
 Stops the PSS communication. More...
 
NvPSSComErr NvPSSComDataSrcExit (NvPSSComCtx *ctx)
 Exits the PSS communication for the data source. More...
 
NvPSSComErr NvPSSComDataSinkExit (NvPSSComCtx *ctx)
 Exits the PSS communication for the data sink. More...
 
void NvPSSComDestroyContext (NvPSSComCtx *ctx)
 Destroys the NvPSSCom context. More...
 

Macro Definition Documentation

◆ MAX_DATA_SIZE

#define MAX_DATA_SIZE   2048

Typedef Documentation

◆ NvPSSComCtx_t

typedef struct NvPSSComCtx* NvPSSComCtx_t

NvPSSComCtx

Enumeration Type Documentation

◆ NvPSSComCmd

Enumerator
START_PSS 

Command to start the data transfer withing PSS data souece and sink.

PSS_RDY 

Command indicating PSS is ready.

PSS_NOT_RDY 

Command indicating PSS is not ready.

FLOW_RATE 

Command to set the flow rate.

FLOW_RATE_ACK 

Acknowledgment for flow rate command.

DATA 

Command to send data.

DATA_ACK 

Acknowledgment for data command.

BAD_DATA 

Command indicating bad data received.

BAD_DATA_ACK 

Acknowledgment for bad data command.

CRC_MISMATCH 

Command indicating a CRC mismatch.

PAUSE 

Command to pause the operation.

PAUSE_ACK 

Acknowledgment for pause command.

RESUME 

Command to resume the operation.

RESUME_ACK 

Acknowledgment for resume command.

BYE 

Command to terminate the session.

BYE_ACK 

Acknowledgment for bye command.

BAD_RESPONSE 

Command indicating a bad response.

PING 

Command to ping the receiver.

PING_ACK 

Acknowledgment for ping command.

27 {
28  START_PSS,
29  PSS_RDY,
30  PSS_NOT_RDY,
31  FLOW_RATE,
33  DATA,
34  DATA_ACK,
35  BAD_DATA,
36  BAD_DATA_ACK,
37  CRC_MISMATCH,
38  PAUSE,
39  PAUSE_ACK,
40  RESUME,
41  RESUME_ACK,
42  BYE,
43  BYE_ACK,
44  BAD_RESPONSE,
45  PING,
46  PING_ACK
47 } NvPSSComCmd;
NvPSSComCmd
Definition: NvPSSCom.h:27
@ BAD_RESPONSE
Definition: NvPSSCom.h:44
@ PAUSE_ACK
Definition: NvPSSCom.h:39
@ CRC_MISMATCH
Definition: NvPSSCom.h:37
@ PSS_RDY
Definition: NvPSSCom.h:29
@ BYE
Definition: NvPSSCom.h:42
@ START_PSS
Definition: NvPSSCom.h:28
@ FLOW_RATE_ACK
Definition: NvPSSCom.h:32
@ BYE_ACK
Definition: NvPSSCom.h:43
@ PING
Definition: NvPSSCom.h:45
@ RESUME
Definition: NvPSSCom.h:40
@ FLOW_RATE
Definition: NvPSSCom.h:31
@ PSS_NOT_RDY
Definition: NvPSSCom.h:30
@ PAUSE
Definition: NvPSSCom.h:38
@ BAD_DATA
Definition: NvPSSCom.h:35
@ DATA
Definition: NvPSSCom.h:33
@ DATA_ACK
Definition: NvPSSCom.h:34
@ PING_ACK
Definition: NvPSSCom.h:46
@ RESUME_ACK
Definition: NvPSSCom.h:41
@ BAD_DATA_ACK
Definition: NvPSSCom.h:36

Function Documentation

◆ NvPSSComCreateContext()

NvPSSComCtx* NvPSSComCreateContext ( )

Creates a new NvPSSCom context.

Returns
NvPSSComCtx* Pointer to the newly created NvPSSCom context.

◆ NvPSSComDataSinkExit()

NvPSSComErr NvPSSComDataSinkExit ( NvPSSComCtx *  ctx)

Exits the PSS communication for the data sink.

Parameters
ctxPointer to the NvPSSCom context.
Returns
NvPSSComErr Returns an error code indicating the success or failure of the operation.

◆ NvPSSComDataSinkInit()

NvPSSComErr NvPSSComDataSinkInit ( NvPSSComCtx *  ctx,
const char *  writeChannel,
const char *  readChannel 
)

Initializes the NvPSSCom data sink.

This function initializes the data sink for PSS communication using the specified write and read channels.

Parameters
[in]ctxPointer to the NvPSSCom context.
[in]writeChannelName of the channel used for writing data.
[in]readChannelName of the channel used for reading data.
Returns
NvPSSComErr Returns an error code indicating the success or failure of the initialization.

◆ NvPSSComDataSrcExit()

NvPSSComErr NvPSSComDataSrcExit ( NvPSSComCtx *  ctx)

Exits the PSS communication for the data source.

Parameters
ctxPointer to the NvPSSCom context.
Returns
NvPSSComErr Returns an error code indicating the success or failure of the operation.

◆ NvPSSComDataSrcInit()

NvPSSComErr NvPSSComDataSrcInit ( NvPSSComCtx *  ctx,
const char *  writeChannel,
const char *  readChannel 
)

Initializes the NvPSSCom data source.

This function initializes the data source for PSS communication using the specified write and read channels.

Parameters
[in]ctxPointer to the NvPSSCom context.
[in]writeChannelName of the channel used for writing data.
[in]readChannelName of the channel used for reading data.
Returns
NvPSSComErr Returns an error code indicating the success or failure of the initialization.

◆ NvPSSComDestroyContext()

void NvPSSComDestroyContext ( NvPSSComCtx *  ctx)

Destroys the NvPSSCom context.

Parameters
ctxPointer to the NvPSSCom context to be destroyed.

◆ NvPSSComPause()

NvPSSComErr NvPSSComPause ( NvPSSComCtx *  ctx)

Pauses the PSS communication.

Parameters
ctxPointer to the NvPSSCom context.
Returns
NvPSSComErr Returns an error code indicating the success or failure of the operation.

◆ NvPSSComPushData()

NvPSSComErr NvPSSComPushData ( NvPSSComCtx *  ctx,
NvPSSComPacket pkt 
)

Pushes data to the PSS communication channel.

Parameters
ctxPointer to the NvPSSCom context.
pktPointer to the NvPSSComPacket containing the data to be pushed.
Returns
NvPSSComErr Returns an error code indicating the success or failure of the operation.

◆ NvPSSComResume()

NvPSSComErr NvPSSComResume ( NvPSSComCtx *  ctx)

Resumes the PSS communication.

Parameters
ctxPointer to the NvPSSCom context.
Returns
NvPSSComErr Returns an error code indicating the success or failure of the operation.

◆ NvPSSComSetFlowRate()

NvPSSComErr NvPSSComSetFlowRate ( NvPSSComCtx *  ctx,
uint8_t  flowRate 
)

Sets the flow rate for PSS communication.

Parameters
ctxPointer to the NvPSSCom context.
flowRateThe flow rate to be set.
Returns
NvPSSComErr Returns an error code indicating the success or failure of the operation.

◆ NvPSSComStart()

NvPSSComErr NvPSSComStart ( NvPSSComCtx *  ctx)

Starts the PSS communication.

Function to initiate the PSS communication process.

Returns
NvPSSComErr Returns an error code indicating the success or failure of the operation.

◆ NvPSSComStop()

NvPSSComErr NvPSSComStop ( NvPSSComCtx *  ctx)

Stops the PSS communication.

Parameters
ctxPointer to the NvPSSCom context.
Returns
NvPSSComErr Returns an error code indicating the success or failure of the operation.

◆ NvPSSDataSinkRegisterCallbacks()

NvPSSComErr NvPSSDataSinkRegisterCallbacks ( NvPSSComCtx *  ctx,
NvPSSComDataSinkCallbacks sinkCallbacks 
)

Registers callbacks for the data sink.

Function to register the specified callbacks for the data sink.

Parameters
[in]sinkCallbacksPointer to the structure containing the callbacks to register.
Returns
NvPSSComErr Returns an error code indicating the success or failure of the callabck registration.

◆ NvPSSDataSrcRegisterCallbacks()

NvPSSComErr NvPSSDataSrcRegisterCallbacks ( NvPSSComCtx *  ctx,
NvPSSComDataSrcCallbacks srcCallbacks 
)

Registers callbacks for the data source.

Function to register the specified callbacks for the data source.

Parameters
[in]srcCallbacksPointer to the structure containing the callbacks to register.
Returns
NvPSSComErr Returns an error code indicating the success or failure of the registration.