NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/sources/includes/nvds_msgapi.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2018-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
35 #ifndef __NVDS_MSGAPI_H__
36 #define __NVDS_MSGAPI_H__
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 #include <stdint.h>
43 
45 typedef void *NvDsMsgApiHandle;
46 
50 typedef enum {
58 
62 typedef enum {
67 
76 typedef void (*nvds_msgapi_send_cb_t)(void *user_ptr, NvDsMsgApiErrorType completion_flag);
77 
92 typedef void (*nvds_msgapi_subscribe_request_cb_t)(NvDsMsgApiErrorType flag, void *msg, int msg_len, char *topic, void *user_ptr);
93 
104 
117 NvDsMsgApiHandle nvds_msgapi_connect(char *connection_str, nvds_msgapi_connect_cb_t connect_cb, char *config_path);
118 
132 NvDsMsgApiErrorType nvds_msgapi_send(NvDsMsgApiHandle h_ptr, char *topic, const uint8_t *payload, size_t nbuf);
133 
150 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);
151 
163 NvDsMsgApiErrorType nvds_msgapi_subscribe (NvDsMsgApiHandle h_ptr, char ** topics, int num_topics, nvds_msgapi_subscribe_request_cb_t cb, void *user_ctx);
164 
178 
187 
195 char *nvds_msgapi_getversion(void);
196 
203 
221 NvDsMsgApiErrorType nvds_msgapi_connection_signature(char *broker_str, char *cfg, char *output_str, int max_len);
222 
223 #ifdef __cplusplus
224 }
225 #endif
226 
227 #endif
228 
nvds_msgapi_connect_cb_t
void(* nvds_msgapi_connect_cb_t)(NvDsMsgApiHandle h_ptr, NvDsMsgApiEventType ds_evt)
Type definition for a "handle" callback.
Definition: 9.1/sources/includes/nvds_msgapi.h:103
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: 9.1/sources/includes/nvds_msgapi.h:62
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_getversion
char * nvds_msgapi_getversion(void)
Gets the version number of the messaging API interface supported by the protocol adapter.
nvds_msgapi_get_protocol_name
char * nvds_msgapi_get_protocol_name(void)
Gets the name of the protocol used in the adapter.
NVDS_MSGAPI_UNKNOWN_TOPIC
@ NVDS_MSGAPI_UNKNOWN_TOPIC
Definition: 9.1/sources/includes/nvds_msgapi.h:65
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: 9.1/sources/includes/nvds_msgapi.h:54
NvDsMsgApiHandle
void * NvDsMsgApiHandle
Defines the handle used by messaging API functions.
Definition: 9.1/sources/includes/nvds_msgapi.h:45
NVDS_MSGAPI_EVT_SUCCESS
@ NVDS_MSGAPI_EVT_SUCCESS
Specifies that a connection attempt was successful.
Definition: 9.1/sources/includes/nvds_msgapi.h:52
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: 9.1/sources/includes/nvds_msgapi.h:50
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: 9.1/sources/includes/nvds_msgapi.h:63
nvds_msgapi_send_cb_t
void(* nvds_msgapi_send_cb_t)(void *user_ptr, NvDsMsgApiErrorType completion_flag)
Type definition for a "send" callback.
Definition: 9.1/sources/includes/nvds_msgapi.h:76
NVDS_MSGAPI_ERR
@ NVDS_MSGAPI_ERR
Definition: 9.1/sources/includes/nvds_msgapi.h:64
NVDS_MSGAPI_EVT_SERVICE_DOWN
@ NVDS_MSGAPI_EVT_SERVICE_DOWN
Specifies that the remote service is down.
Definition: 9.1/sources/includes/nvds_msgapi.h:56
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: 9.1/sources/includes/nvds_msgapi.h:92