NVIDIA DeepStream SDK API Reference

4.0.1 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups

Detailed Description

This API provides means for sending messages to the cloud using various protocols like Kafka, MQTT, and AMQP.

Typedefs

typedef void * NvDsMsgApiHandle
 Defines the handle to be used with all methods in the NvDS_MsgApi interface. More...
 
typedef void(* nvds_msgapi_send_cb_t )(void *user_ptr, NvDsMsgApiErrorType completion_flag)
 Type definition for send method callback. More...
 
typedef void(* nvds_msgapi_connect_cb_t )(NvDsMsgApiHandle h_ptr, NvDsMsgApiEventType ds_evt)
 Type definition for handle method callback registered during connect. More...
 

Enumerations

enum  NvDsMsgApiEventType {
  NVDS_MSGAPI_EVT_DISCONNECT,
  NVDS_MSGAPI_EVT_SERVICE_DOWN
}
 Defines various events associated with connections to remote entities. More...
 
enum  NvDsMsgApiErrorType {
  NVDS_MSGAPI_OK,
  NVDS_MSGAPI_ERR,
  NVDS_MSGAPI_UNKNOWN_TOPIC
}
 Defines completion status for operations in the NvDS_MsgApi interface. More...
 

Functions

NvDsMsgApiHandle nvds_msgapi_connect (char *connection_str, nvds_msgapi_connect_cb_t connect_cb, char *config_path)
 Connects to a remote agent by calling into protocol adapter. More...
 
NvDsMsgApiErrorType nvds_msgapi_send (NvDsMsgApiHandle h_ptr, char *topic, const uint8_t *payload, size_t nbuf)
 Send message over connection synchronously based on blocking semantics. More...
 
NvDsMsgApiErrorType nvds_msgapi_send_async (NvDsMsgApiHandle h_ptr, char *topic, const uint8_t *payload, size_t nbuf, nvds_msgapi_send_cb_t send_callback, void *user_ptr)
 Send message over connection asynchronously based on non-blocking semantics. More...
 
void nvds_msgapi_do_work (NvDsMsgApiHandle h_ptr)
 Calls into the adapter to allow for execution of undnerlying protocol logic. More...
 
NvDsMsgApiErrorType nvds_msgapi_disconnect (NvDsMsgApiHandle h_ptr)
 Terminates existing connection. More...
 
char * nvds_msgapi_getversion (void)
 Current version of NvDS_MsgApi interface supported by protocol adapter. More...
 

Typedef Documentation

typedef void(* nvds_msgapi_connect_cb_t)(NvDsMsgApiHandle h_ptr, NvDsMsgApiEventType ds_evt)

Type definition for handle method callback registered during connect.

using which events corresponding to connection are delivered

Parameters
[in]h_ptrHandle corresponding to event
[in]ds_evtEvent type based on enum

Definition at line 82 of file nvds_msgapi.h.

typedef void(* nvds_msgapi_send_cb_t)(void *user_ptr, NvDsMsgApiErrorType completion_flag)

Type definition for send method callback.

Parameters
[in]user_ptrPointer passed during async_send for context
[in]completion_flagCompletion status of send operation.

Definition at line 73 of file nvds_msgapi.h.

typedef void* NvDsMsgApiHandle

Defines the handle to be used with all methods in the NvDS_MsgApi interface.

Definition at line 46 of file nvds_msgapi.h.

Enumeration Type Documentation

Defines completion status for operations in the NvDS_MsgApi interface.

Enumerator
NVDS_MSGAPI_OK 
NVDS_MSGAPI_ERR 
NVDS_MSGAPI_UNKNOWN_TOPIC 

Definition at line 61 of file nvds_msgapi.h.

Defines various events associated with connections to remote entities.

Enumerator
NVDS_MSGAPI_EVT_DISCONNECT 

disconnection of connection handle

NVDS_MSGAPI_EVT_SERVICE_DOWN 

remote service is down

Definition at line 51 of file nvds_msgapi.h.

Function Documentation

NvDsMsgApiHandle nvds_msgapi_connect ( char *  connection_str,
nvds_msgapi_connect_cb_t  connect_cb,
char *  config_path 
)

Connects to a remote agent by calling into protocol adapter.

Parameters
[in]connection_strA connection string with format "url;port;topic".
[in]connect_cbA pointer to a callback function for events associated with the connection.
[in]config_pathPathname of a configuration file passed to the protocol adapter.
Returns
A connection handle.
NvDsMsgApiErrorType nvds_msgapi_disconnect ( NvDsMsgApiHandle  h_ptr)

Terminates existing connection.

Parameters
[in]h_ptrconnection handle
Returns
Result of termination
void nvds_msgapi_do_work ( NvDsMsgApiHandle  h_ptr)

Calls into the adapter to allow for execution of undnerlying protocol logic.

As part of this routine, adapter should service outstanding incoming and outgoing. It can also perform periodic housekeeping tasks such s sending heartbeats. The method makes client control when the protocol logic gets executed. It should be called periodically by the client, as required by the adapter.

Parameters
[in]h_ptrconnection handle
char* nvds_msgapi_getversion ( void  )

Current version of NvDS_MsgApi interface supported by protocol adapter.

Returns
The version of the interface supported by the adapter based on MAJOR.MINOR format.
NvDsMsgApiErrorType nvds_msgapi_send ( NvDsMsgApiHandle  h_ptr,
char *  topic,
const uint8_t *  payload,
size_t  nbuf 
)

Send message over connection synchronously based on blocking semantics.

Parameters
[in]h_ptrconnection handle
[in]topictopic to which send message
[in]payloadmessage data
[in]nbufnumber of bytes of data to send
Returns
Completion status of send operation
NvDsMsgApiErrorType nvds_msgapi_send_async ( NvDsMsgApiHandle  h_ptr,
char *  topic,
const uint8_t *  payload,
size_t  nbuf,
nvds_msgapi_send_cb_t  send_callback,
void *  user_ptr 
)

Send message over connection asynchronously based on non-blocking semantics.

Parameters
[in]h_ptrconnection handle
[in]topictopic to which send message
[in]payloadmessage data
[in]nbufnumber of bytes of data to send
[in]send_callbackcallback to be invoked when operation complets
[in]user_ptrpointer to pass to callback for context
Returns
Completion status of send operation