123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- #ifndef UA_PLUGIN_PUBSUB_H_
- #define UA_PLUGIN_PUBSUB_H_
- #include "ua_server_pubsub.h"
- _UA_BEGIN_DECLS
- #ifdef UA_ENABLE_PUBSUB
- typedef enum {
- UA_PUBSUB_CHANNEL_RDY,
- UA_PUBSUB_CHANNEL_PUB,
- UA_PUBSUB_CHANNEL_SUB,
- UA_PUBSUB_CHANNEL_PUB_SUB,
- UA_PUBSUB_CHANNEL_ERROR,
- UA_PUBSUB_CHANNEL_CLOSED
- } UA_PubSubChannelState;
- struct UA_PubSubChannel;
- typedef struct UA_PubSubChannel UA_PubSubChannel;
- struct UA_PubSubChannel {
- UA_UInt32 publisherId;
- UA_PubSubChannelState state;
- UA_PubSubConnectionConfig *connectionConfig;
- UA_SOCKET sockfd;
- void *handle;
-
-
- UA_StatusCode (*send)(UA_PubSubChannel *channel, UA_ExtensionObject *transportSettings,
- const UA_ByteString *buf);
-
- UA_StatusCode (*regist)(UA_PubSubChannel * channel, UA_ExtensionObject *transportSettings);
-
- UA_StatusCode (*unregist)(UA_PubSubChannel * channel, UA_ExtensionObject *transportSettings);
-
- UA_StatusCode (*receive)(UA_PubSubChannel * channel, UA_ByteString *,
- UA_ExtensionObject *transportSettings, UA_UInt32 timeout);
-
- UA_StatusCode (*close)(UA_PubSubChannel *channel);
- };
- typedef struct {
- UA_String transportProfileUri;
- UA_PubSubChannel * (*createPubSubChannel)(UA_PubSubConnectionConfig *connectionConfig);
- } UA_PubSubTransportLayer;
- UA_StatusCode
- UA_ServerConfig_addPubSubTransportLayer(UA_ServerConfig *config,
- UA_PubSubTransportLayer *pubsubTransportLayer);
- #endif
- _UA_END_DECLS
- #endif
|