open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
pubsub.h
Go to the documentation of this file.
1/** This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 *
5 * Copyright (c) 2017-2018 Fraunhofer IOSB (Author: Andreas Ebner)
6 */
7
8#ifndef UA_PLUGIN_PUBSUB_H_
9#define UA_PLUGIN_PUBSUB_H_
10
11#include <open62541/types.h>
13
15
16#ifdef UA_ENABLE_PUBSUB
17
18
19
22
23struct UA_PubSubChannel;
25
34
37 void *callbackContext,
38 const UA_ByteString *buffer);
39
40/** Interface structure between network plugin and internal implementation */
42 UA_UInt32 publisherId; /* unique identifier */
44 UA_PubSubConnectionConfig *connectionConfig; /* link to parent connection config */
46 void *handle; /* implementation specific data */
47 /*@info for handle: each network implementation should provide an structure
48 * UA_PubSubChannelData[ImplementationName] This structure can be used by the
49 * network implementation to store network implementation specific data.*/
50
51 /* Sending out the content of the buf parameter */
52 UA_StatusCode (*send)(UA_PubSubChannel *channel, UA_ExtensionObject *transportSettings,
53 const UA_ByteString *buf);
54
55 /* Register to an specified message source, e.g. multicast group or topic. Callback is used for mqtt. */
57 void (*callback)(UA_ByteString *encodedBuffer, UA_ByteString *topic));
58
59 /* Remove subscription to an specified message source, e.g. multicast group or topic */
61
62 /* Receive messages. A regist to the message source is needed before. */
64 UA_ExtensionObject *transportSettings,
65 UA_PubSubReceiveCallback receiveCallback,
66 void *receiveCallbackContext,
67 UA_UInt32 timeout);
68
69 /* Closing the connection and implicit free of the channel structures. */
71
72 /* Giving the connection protocoll time to process inbound and outbound traffic. */
74};
75
76
77
78typedef struct {
80 UA_PubSubChannel *(*createPubSubChannel)(UA_PubSubConnectionConfig *connectionConfig);
82
83#endif /* UA_ENABLE_PUBSUB */
84
86
87#endif /* UA_PLUGIN_PUBSUB_H_ */
#define _UA_BEGIN_DECLS
#undef UA_DEBUG_DUMP_PKGS
Definition config.h:89
#define _UA_END_DECLS
Definition config.h:96
UA_StatusCode(* UA_PubSubReceiveCallback)(UA_PubSubChannel *channel, void *callbackContext, const UA_ByteString *buffer)
Definition pubsub.h:36
UA_PubSubChannelState
Definition pubsub.h:26
@ UA_PUBSUB_CHANNEL_RDY
Definition pubsub.h:27
@ UA_PUBSUB_CHANNEL_ERROR
Definition pubsub.h:31
@ UA_PUBSUB_CHANNEL_SUB
Definition pubsub.h:29
@ UA_PUBSUB_CHANNEL_PUB
Definition pubsub.h:28
@ UA_PUBSUB_CHANNEL_PUB_SUB
Definition pubsub.h:30
@ UA_PUBSUB_CHANNEL_CLOSED
Definition pubsub.h:32
Interface structure between network plugin and internal implementation.
Definition pubsub.h:41
UA_UInt32 publisherId
Definition pubsub.h:42
void * handle
Definition pubsub.h:46
UA_SOCKET sockfd
Definition pubsub.h:45
UA_PubSubConnectionConfig * connectionConfig
Definition pubsub.h:44
UA_StatusCode(* close)(UA_PubSubChannel *channel)
Definition pubsub.h:70
UA_StatusCode(* receive)(UA_PubSubChannel *channel, UA_ExtensionObject *transportSettings, UA_PubSubReceiveCallback receiveCallback, void *receiveCallbackContext, UA_UInt32 timeout)
Definition pubsub.h:63
UA_StatusCode(* yield)(UA_PubSubChannel *channel, UA_UInt16 timeout)
Definition pubsub.h:73
UA_StatusCode(* regist)(UA_PubSubChannel *channel, UA_ExtensionObject *transportSettings, void(*callback)(UA_ByteString *encodedBuffer, UA_ByteString *topic))
Definition pubsub.h:56
UA_StatusCode(* unregist)(UA_PubSubChannel *channel, UA_ExtensionObject *transportSettings)
Definition pubsub.h:60
UA_StatusCode(* send)(UA_PubSubChannel *channel, UA_ExtensionObject *transportSettings, const UA_ByteString *buf)
Definition pubsub.h:52
UA_PubSubChannelState state
Definition pubsub.h:43
UA_String transportProfileUri
Definition pubsub.h:79
uint16_t UA_UInt16
Definition types.h:46
uint32_t UA_UInt32
Definition types.h:56
uint32_t UA_StatusCode
Definition types.h:77
#define UA_SOCKET
Definition ua_lwip.h:31