NVIDIA DeepStream SDK API Reference

7.1 Release
nvds_msgapi.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2018-2020 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 
30 #ifndef __NVDS_MSGAPI_H__
31 #define __NVDS_MSGAPI_H__
32 
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #endif
37 #include <stdint.h>
38 
40 typedef void *NvDsMsgApiHandle;
41 
45 typedef enum {
53 
57 typedef enum {
62 
71 typedef void (*nvds_msgapi_send_cb_t)(void *user_ptr, NvDsMsgApiErrorType completion_flag);
72 
87 typedef void (*nvds_msgapi_subscribe_request_cb_t)(NvDsMsgApiErrorType flag, void *msg, int msg_len, char *topic, void *user_ptr);
88 
99 
112 NvDsMsgApiHandle nvds_msgapi_connect(char *connection_str, nvds_msgapi_connect_cb_t connect_cb, char *config_path);
113 
127 NvDsMsgApiErrorType nvds_msgapi_send(NvDsMsgApiHandle h_ptr, char *topic, const uint8_t *payload, size_t nbuf);
128 
145 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);
146 
158 NvDsMsgApiErrorType nvds_msgapi_subscribe (NvDsMsgApiHandle h_ptr, char ** topics, int num_topics, nvds_msgapi_subscribe_request_cb_t cb, void *user_ctx);
159 
173 
182 
190 char *nvds_msgapi_getversion(void);
191 
198 
216 NvDsMsgApiErrorType nvds_msgapi_connection_signature(char *broker_str, char *cfg, char *output_str, int max_len);
217 
218 #ifdef __cplusplus
219 }
220 #endif
221 
222 #endif
223 
nvds_msgapi_connect_cb_t
void(* nvds_msgapi_connect_cb_t)(NvDsMsgApiHandle h_ptr, NvDsMsgApiEventType ds_evt)
Type definition for a "handle" callback.
Definition: nvds_msgapi.h:98
nvds_msgapi_send_async
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.
nvds_msgapi_connection_signature
NvDsMsgApiErrorType nvds_msgapi_connection_signature(char *broker_str, char *cfg, char *output_str, int max_len)
Fetch the connection signature by parsing broker_connection string and cfg file.
NvDsMsgApiErrorType
NvDsMsgApiErrorType
Defines completion codes for operations in the messaging API.
Definition: nvds_msgapi.h:57
nvds_msgapi_disconnect
NvDsMsgApiErrorType nvds_msgapi_disconnect(NvDsMsgApiHandle h_ptr)
Terminates a connection.
nvds_msgapi_connect
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.
NVDS_MSGAPI_UNKNOWN_TOPIC
@ NVDS_MSGAPI_UNKNOWN_TOPIC
Definition: nvds_msgapi.h:60
nvds_msgapi_get_protocol_name
char * nvds_msgapi_get_protocol_name(void)
Gets the name of the protocol used in the adapter.
nvds_msgapi_do_work
void nvds_msgapi_do_work(NvDsMsgApiHandle h_ptr)
Calls into the adapter to allow for execution of undnerlying protocol logic.
NVDS_MSGAPI_EVT_DISCONNECT
@ NVDS_MSGAPI_EVT_DISCONNECT
Specifies disconnection of a connection handle.
Definition: nvds_msgapi.h:49
NvDsMsgApiHandle
void * NvDsMsgApiHandle
Defines the handle used by messaging API functions.
Definition: nvds_msgapi.h:40
NVDS_MSGAPI_EVT_SUCCESS
@ NVDS_MSGAPI_EVT_SUCCESS
Specifies that a connection attempt was successful.
Definition: nvds_msgapi.h:47
nvds_msgapi_subscribe
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)
NvDsMsgApiEventType
NvDsMsgApiEventType
Defines events associated with connections to remote entities.
Definition: nvds_msgapi.h:45
nvds_msgapi_getversion
char * nvds_msgapi_getversion(void)
Gets the version number of the messaging API interface supported by the protocol adapter.
nvds_msgapi_send
NvDsMsgApiErrorType nvds_msgapi_send(NvDsMsgApiHandle h_ptr, char *topic, const uint8_t *payload, size_t nbuf)
Sends a message synchronously over a connection.
NVDS_MSGAPI_OK
@ NVDS_MSGAPI_OK
Definition: nvds_msgapi.h:58
nvds_msgapi_send_cb_t
void(* nvds_msgapi_send_cb_t)(void *user_ptr, NvDsMsgApiErrorType completion_flag)
Type definition for a "send" callback.
Definition: nvds_msgapi.h:71
NVDS_MSGAPI_ERR
@ NVDS_MSGAPI_ERR
Definition: nvds_msgapi.h:59
NVDS_MSGAPI_EVT_SERVICE_DOWN
@ NVDS_MSGAPI_EVT_SERVICE_DOWN
Specifies that the remote service is down.
Definition: nvds_msgapi.h:51
nvds_msgapi_subscribe_request_cb_t
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