-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommunicationEndpoint.h
101 lines (82 loc) · 3.01 KB
/
CommunicationEndpoint.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#ifndef ELASTIC_AI_RUNTIME_C_COMMUNICATION_ENDPOINT_H
#define ELASTIC_AI_RUNTIME_C_COMMUNICATION_ENDPOINT_H
#include "Posting.h"
#include "Subscriber.h"
#include <stdint.h>
/*!
* A MQTT-Broker implementation needs to implements these functions.
*/
/*! Sets the Domain of the Broker
*
* @param brokerDomain Domain of the Broker
*/
void communicationEndpointSetBrokerDomain(char *brokerDomain);
/*! Returns the Domain of the Broker
*
* @return Domain of the Broker
*/
char *communicationEndpointGetBrokerDomain();
/*! Sets the identifier of the clients and the user identifier with the corresponding password
*
* @param clientId Identifier of the Client
* @param userId User Identifier
* @param password Password correlating with the user identifier
*/
uint8_t communicationEndpointSetUserConfiguration(char *clientId, char *userId, char *password);
/*! Returns the identifier of the client
*
* @return Identifier of the Client
*/
char *communicationEndpointGetClientId();
/*! Publishes the Posting, including the Domain and Device identification in the topic
*
* @param posting Posting to be published
*/
void communicationEndpointPublish(posting_t posting);
/*! Publishes the Posting, adding the Domain in the topic
*
* @param posting Posting to be published
*/
void communicationEndpointPublishRemote(posting_t posting);
/*! Publishes the Posting as it is
*
* @param posting Posting to be published
*/
void communicationEndpointPublishRaw(posting_t posting);
/*! Subscribes to the topic adding the Domain and device identification
*
* @param topic Topic to subscribe
* @param subscriber Function to be called when message is published to topic
*/
void communicationEndpointSubscribe(char *topic, subscriber_t subscriber);
/*! Subscribes to the topic adding the Domain
*
* @param topic Topic to subscribe
* @param subscriber Function to be called when message is published to topic
*/
void communicationEndpointSubscribeRemote(char *topic, subscriber_t subscriber);
/*! Subscribes to the topic as it is
*
* @param topic Topic to subscribe
* @param subscriber Function to be called when message is published to topic
*/
void communicationEndpointSubscribeRaw(char *topic, subscriber_t subscriber);
/*! Unsubscribes to the topic adding the Domain and device identification
*
* @param topic Topic to unsubscribe
* @param subscriber Function to be called when message is published to topic
*/
void communicationEndpointUnsubscribe(char *topic, subscriber_t subscriber);
/*! Unsubscribes to the topic adding the Domain
*
* @param topic Topic to unsubscribe
* @param subscriber Function to be called when message is published to topic
*/
void communicationEndpointUnsubscribeRemote(char *topic, subscriber_t subscriber);
/*! Unsubscribes to the topic as it is
*
* @param topic Topic to unsubscribe
* @param subscriber Function to be called when message is published to topic
*/
void communicationEndpointUnsubscribeRaw(char *topic, subscriber_t subscriber);
#endif /* ELASTIC_AI_RUNTIME_C_COMMUNICATION_ENDPOINT_H */