NVIDIA DeepStream SDK API Reference

5.0 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvds_msgapi.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2020 NVIDIA Corporation. All rights reserved.
3  *
4  * NVIDIA Corporation and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA Corporation is strictly prohibited.
9  *
10  */
11 
29 #ifndef __NVDS_MSGAPI_H__
30 #define __NVDS_MSGAPI_H__
31 
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36 #include <stdint.h>
37 
39 typedef void *NvDsMsgApiHandle;
40 
44 typedef enum {
52 
56 typedef enum {
61 
70 typedef void (*nvds_msgapi_send_cb_t)(void *user_ptr, NvDsMsgApiErrorType completion_flag);
71 
87 typedef void (*nvds_msgapi_subscribe_request_cb_t)(NvDsMsgApiErrorType flag, void *msg, int msg_len, char *topic, void *user_ptr);
88 
98 typedef void (*nvds_msgapi_connect_cb_t)(NvDsMsgApiHandle h_ptr, NvDsMsgApiEventType ds_evt);
99 
111 NvDsMsgApiHandle nvds_msgapi_connect(char *connection_str, nvds_msgapi_connect_cb_t connect_cb, char *config_path);
112 
126 NvDsMsgApiErrorType nvds_msgapi_send(NvDsMsgApiHandle h_ptr, char *topic, const uint8_t *payload, size_t nbuf);
127 
144 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);
145 
157 NvDsMsgApiErrorType nvds_msgapi_subscribe (NvDsMsgApiHandle h_ptr, char ** topics, int num_topics, nvds_msgapi_subscribe_request_cb_t cb, void *user_ctx);
158 
171 void nvds_msgapi_do_work(NvDsMsgApiHandle h_ptr);
172 
180 NvDsMsgApiErrorType nvds_msgapi_disconnect(NvDsMsgApiHandle h_ptr);
181 
189 char *nvds_msgapi_getversion(void);
190 
191 #ifdef __cplusplus
192 }
193 #endif
194 
195 #endif
196 
NvDsMsgApiErrorType nvds_msgapi_send(NvDsMsgApiHandle h_ptr, char *topic, const uint8_t *payload, size_t nbuf)
Sends a message synchronously over a connection.
NvDsMsgApiErrorType
Defines completion codes for operations in the messaging API.
Definition: nvds_msgapi.h:56
char * nvds_msgapi_getversion(void)
Gets the version number of the messaging API interface supported by the protocol adapter.
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 a protocol adapter.
Specifies disconnection of a connection handle.
Definition: nvds_msgapi.h:48
void(* nvds_msgapi_connect_cb_t)(NvDsMsgApiHandle h_ptr, NvDsMsgApiEventType ds_evt)
Type definition for a "handle" callback.
Definition: nvds_msgapi.h:98
NvDsMsgApiErrorType nvds_msgapi_subscribe(NvDsMsgApiHandle h_ptr, char **topics, int num_topics, nvds_msgapi_subscribe_request_cb_t cb, void *user_ctx)
Subscribe to a remote entity for receiving messages on a particular topic(s)
void(* nvds_msgapi_subscribe_request_cb_t)(NvDsMsgApiErrorType flag, void *msg, int msg_len, char *topic, void *user_ptr)
Type definition for callback registered during subscribe.
Definition: nvds_msgapi.h:87
void nvds_msgapi_do_work(NvDsMsgApiHandle h_ptr)
Calls into the adapter to allow for execution of undnerlying protocol logic.
void * NvDsMsgApiHandle
Defines the handle used by messaging API functions.
Definition: nvds_msgapi.h:39
NvDsMsgApiErrorType nvds_msgapi_disconnect(NvDsMsgApiHandle h_ptr)
Terminates a connection.
void(* nvds_msgapi_send_cb_t)(void *user_ptr, NvDsMsgApiErrorType completion_flag)
Type definition for a "send" callback.
Definition: nvds_msgapi.h:70
Specifies that a connection attempt was Successful.
Definition: nvds_msgapi.h:46
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)
Sends message asynchronously over a connection.
NvDsMsgApiEventType
Defines events associated with connections to remote entities.
Definition: nvds_msgapi.h:44
Specifies that the remote service is down.
Definition: nvds_msgapi.h:50