urtware / src / urt_subscriber.c @ cd21e832
History | View | Annotate | Download (8.269 KB)
1 | 1fb06240 | skenneweg | /*
|
---|---|---|---|
2 | µRtWare is a lightweight publish/subscribe middleware for real-time
|
||
3 | applications. It was developed as part of the software habitat for the
|
||
4 | Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
|
||
5 | |||
6 | Copyright (C) 2018..2020 Thomas Schöpping et al.
|
||
7 | |||
8 | This program is free software: you can redistribute it and/or modify
|
||
9 | it under the terms of the GNU General Public License as published by
|
||
10 | the Free Software Foundation, either version 3 of the License, or
|
||
11 | (at your option) any later version.
|
||
12 | |||
13 | This program is distributed in the hope that it will be useful,
|
||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
16 | GNU General Public License for more details.
|
||
17 | |||
18 | You should have received a copy of the GNU General Public License
|
||
19 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
20 | */
|
||
21 | |||
22 | 7d9678db | skenneweg | #include <urtware.h> |
23 | |||
24 | 1fb06240 | skenneweg | /******************************************************************************/
|
25 | /* LOCAL DEFINITIONS */
|
||
26 | /******************************************************************************/
|
||
27 | |||
28 | /******************************************************************************/
|
||
29 | /* EXPORTED VARIABLES */
|
||
30 | /******************************************************************************/
|
||
31 | |||
32 | /******************************************************************************/
|
||
33 | /* LOCAL TYPES */
|
||
34 | /******************************************************************************/
|
||
35 | |||
36 | /******************************************************************************/
|
||
37 | /* LOCAL VARIABLES */
|
||
38 | /******************************************************************************/
|
||
39 | |||
40 | /******************************************************************************/
|
||
41 | /* LOCAL FUNCTIONS */
|
||
42 | /******************************************************************************/
|
||
43 | |||
44 | /******************************************************************************/
|
||
45 | /* EXPORTED FUNCTIONS */
|
||
46 | /******************************************************************************/
|
||
47 | |||
48 | 7d9678db | skenneweg | /**
|
49 | * @brief Initialize the nrt Subscriber.
|
||
50 | *
|
||
51 | * @param[in] subscriber Subscriber to initalize.
|
||
52 | */
|
||
53 | void urtNrtSubscriberInit (urt_nrtsubscriber_t* subscriber) {return;} |
||
54 | 1fb06240 | skenneweg | |
55 | 7d9678db | skenneweg | /**
|
56 | * @brief .
|
||
57 | *
|
||
58 | * @param[in] subscriber Subscriber to .
|
||
59 | * @param[in] topic .
|
||
60 | * @param[in] messages .
|
||
61 | *
|
||
62 | * @return A status value.
|
||
63 | */
|
||
64 | 1fb06240 | skenneweg | urt_status_t urtNrtSubscriberSubscribe (urt_nrtsubscriber_t* subscriber, urt_topic_t* topic, urt_message_t* messages) { |
65 | 7d9678db | skenneweg | return URT_STATUS_OK;
|
66 | 1fb06240 | skenneweg | } |
67 | |||
68 | 7d9678db | skenneweg | /**
|
69 | * @brief .
|
||
70 | *
|
||
71 | * @param[in] subscriber .
|
||
72 | * @param[in] payload .
|
||
73 | * @param[in] bytes .
|
||
74 | * @param[in] latency .
|
||
75 | *
|
||
76 | * @return A status value.
|
||
77 | */
|
||
78 | 1fb06240 | skenneweg | urt_status_t urtNrtSubscriberFetchNextMessage (urt_nrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency) {
|
79 | 7d9678db | skenneweg | return URT_STATUS_OK;
|
80 | 1fb06240 | skenneweg | } |
81 | |||
82 | 7d9678db | skenneweg | /**
|
83 | * @brief .
|
||
84 | *
|
||
85 | * @param[in] subscriber .
|
||
86 | * @param[in] payload .
|
||
87 | * @param[in] bytes .
|
||
88 | * @param[in] latency .
|
||
89 | *
|
||
90 | * @return A status value.
|
||
91 | */
|
||
92 | 1fb06240 | skenneweg | urt_status_t urtNrtSubscriberFetchLatestMessage (urt_nrtsubscriber_t* subscriber, void* payload, size_t bytes, urt_delay_t* latency) {
|
93 | 7d9678db | skenneweg | return URT_STATUS_OK;
|
94 | 1fb06240 | skenneweg | } |
95 | |||
96 | 7d9678db | skenneweg | /**
|
97 | * @brief .
|
||
98 | *
|
||
99 | * @param[in] subscriber
|
||
100 | *
|
||
101 | * @return A status value.
|
||
102 | */
|
||
103 | 1fb06240 | skenneweg | urt_status_t urtNrtSubscriberUnsubscribe (urt_nrtsubscriber_t* subscriber) { |
104 | 7d9678db | skenneweg | return URT_STATUS_OK;
|
105 | 1fb06240 | skenneweg | } |
106 | |||
107 | 7d9678db | skenneweg | |
108 | /**
|
||
109 | * @brief .
|
||
110 | *
|
||
111 | * @param[in] subscriber .
|
||
112 | */
|
||
113 | void urtSrtSubscriberInit(urt_srtsubscriber_t* subscriber) {return;} |
||
114 | |||
115 | /**
|
||
116 | * @brief .
|
||
117 | *
|
||
118 | * @param[in] subscriber .
|
||
119 | * @param[in] topic .
|
||
120 | * @param[in] message .
|
||
121 | * @param[in] usefulnesscb .
|
||
122 | * @param[in] cbparams .
|
||
123 | *
|
||
124 | * @return A status value.
|
||
125 | */
|
||
126 | urt_status_t urtSrtSubscriberSubscribe(urt_srtsubscriber_t* subscriber, urt_topic_t* topic, |
||
127 | urt_message_t* message, urt_srtusefulnessfunc_t* usefulnesscb, void* cbparams) {return URT_STATUS_OK;} |
||
128 | |||
129 | /**
|
||
130 | * @brief .
|
||
131 | *
|
||
132 | * @param[in] subscriber .
|
||
133 | * @param[in] payload .
|
||
134 | * @param[in] latency .
|
||
135 | *
|
||
136 | * @return A status value.
|
||
137 | */
|
||
138 | urt_status_t urtSrtSubscriberFetchNextMessage(urt_srtsubscriber_t* subscriber, void* payload,
|
||
139 | size_t bytes, urt_delay_t* latency){return URT_STATUS_OK;}
|
||
140 | |||
141 | /**
|
||
142 | * @brief .
|
||
143 | *
|
||
144 | * @param[in] subscriber .
|
||
145 | * @param[in] payload .
|
||
146 | * @param[in] bytes .
|
||
147 | * @param[in] latency .
|
||
148 | *
|
||
149 | * @return A status value.
|
||
150 | */
|
||
151 | urt_status_t urtSrtSubscriberFetchLatestMessage(urt_srtsubscriber_t* subscriber, void* payload,
|
||
152 | size_t bytes, urt_delay_t* latency){return URT_STATUS_OK;}
|
||
153 | |||
154 | /**
|
||
155 | * @brief .
|
||
156 | *
|
||
157 | * @param[in] subscriber .
|
||
158 | * @param[in] latency .
|
||
159 | *
|
||
160 | * @return A status value.
|
||
161 | */
|
||
162 | urt_status_t urtSrtSubscriberCalculateUsefulness(urt_srtsubscriber_t* subscriber, urt_delay_t latency){return URT_STATUS_OK;}
|
||
163 | |||
164 | /**
|
||
165 | * @brief .
|
||
166 | *
|
||
167 | * @param[in] subscriber .
|
||
168 | *
|
||
169 | * @return A status value.
|
||
170 | */
|
||
171 | urt_status_t urtSrtSubscriberUnsubscribe(urt_srtsubscriber_t* subscriber){return URT_STATUS_OK;}
|
||
172 | |||
173 | |||
174 | /**
|
||
175 | * @brief .
|
||
176 | *
|
||
177 | * @param[in] subscriber .
|
||
178 | *
|
||
179 | * @return A status value.
|
||
180 | */
|
||
181 | void urtFrtSubscriberInit(urt_frtsubscriber_t* subscriber){return URT_STATUS_OK;} |
||
182 | |||
183 | /**
|
||
184 | * @brief .
|
||
185 | *
|
||
186 | * @param[in] subscriber .
|
||
187 | * @param[in] topic .
|
||
188 | * @param[in] messages .
|
||
189 | * @param[in] deadline .
|
||
190 | * @param[in] jitter .
|
||
191 | *
|
||
192 | * @return A status value.
|
||
193 | */
|
||
194 | urt_status_t urtFrtSubscriberSubscribe(urt_frtsubscriber_t* subscriber, urt_topic_t* topic, |
||
195 | urt_message_t* messages, urt_delay_t deadline, urt_delay_t jitter){return URT_STATUS_OK;}
|
||
196 | |||
197 | /**
|
||
198 | * @brief .
|
||
199 | *
|
||
200 | * @param[in] subscriber .
|
||
201 | * @param[in] payload .
|
||
202 | * @param[in] bytes .
|
||
203 | * @param[in] latency .
|
||
204 | *
|
||
205 | * @return A status value.
|
||
206 | */
|
||
207 | urt_status_t urtFrtSubscriberFetchNextMessage(urt_frtsubscriber_t* subscriber, void* payload,
|
||
208 | size_t bytes, urt_delay_t* latency){return URT_STATUS_OK;}
|
||
209 | |||
210 | /**
|
||
211 | * @brief .
|
||
212 | *
|
||
213 | * @param[in] subscriber .
|
||
214 | * @param[in] payload .
|
||
215 | * @param[in] bytes .
|
||
216 | * @param[in] latency .
|
||
217 | *
|
||
218 | * @return A status value.
|
||
219 | */
|
||
220 | urt_status_t urtFrtSubscriberFetchLatestMessage(urt_frtsubscriber_t* subscriber, void* payload,
|
||
221 | size_t bytes, urt_delay_t* latency){return URT_STATUS_OK;}
|
||
222 | |||
223 | /**
|
||
224 | * @brief .
|
||
225 | *
|
||
226 | * @param[in] subscriber .
|
||
227 | * @param[in] latency .
|
||
228 | *
|
||
229 | * @return A status value.
|
||
230 | */
|
||
231 | bool urtFrtSubscriberCalculateValidity(urt_frtsubscriber_t* subscriber, urt_delay_t latency){return true;} |
||
232 | |||
233 | /**
|
||
234 | * @brief .
|
||
235 | *
|
||
236 | * @param[in] subscriber .
|
||
237 | *
|
||
238 | * @return A status value.
|
||
239 | */
|
||
240 | urt_status_t urtFrtSubscriberUnsubscribe(urt_frtsubscriber_t* subscriber){return URT_STATUS_OK;}
|
||
241 | |||
242 | |||
243 | /**
|
||
244 | * @brief .
|
||
245 | *
|
||
246 | * @param[in] subscriber .
|
||
247 | */
|
||
248 | void urtHrtSubscriberInit(urt_hrtsubscriber_t* subscriber){return;} |
||
249 | |||
250 | /**
|
||
251 | * @brief .
|
||
252 | *
|
||
253 | * @param[in] subscriber .
|
||
254 | * @param[in] topic .
|
||
255 | * @param[in] message .
|
||
256 | * @param[in] deadline .
|
||
257 | * @param[in] rate .
|
||
258 | * @param[in] jitter .
|
||
259 | *
|
||
260 | * @return A status value.
|
||
261 | */
|
||
262 | urt_status_t urtHrtSubscriberSubscribe(urt_hrtsubscriber_t* subscriber, urt_topic_t* topic, |
||
263 | urt_message_t* message, urt_delay_t deadline, urt_delay_t rate, urt_delay_t jitter){return URT_STATUS_OK;}
|
||
264 | |||
265 | |||
266 | /**
|
||
267 | * @brief .
|
||
268 | *
|
||
269 | * @param[in] subscriber .
|
||
270 | * @param[in] payload .
|
||
271 | * @param[in] bytes .
|
||
272 | * @param[in] latency .
|
||
273 | *
|
||
274 | * @return A status value.
|
||
275 | */
|
||
276 | urt_status_t urtHrtSubscriberFetchNextMessage(urt_hrtsubscriber_t* subscriber, void* payload,
|
||
277 | size_t bytes, urt_delay_t* latency){return URT_STATUS_OK;}
|
||
278 | |||
279 | |||
280 | /**
|
||
281 | * @brief .
|
||
282 | *
|
||
283 | * @param[in] subscriber .
|
||
284 | * @param[in] payload .
|
||
285 | * @param[in] bytes .
|
||
286 | * @param[in] latency .
|
||
287 | *
|
||
288 | * @return A status value.
|
||
289 | */
|
||
290 | urt_status_t urtHrtSubscriberFetchLatestMessage(urt_hrtsubscriber_t* subscriber, void* payload,
|
||
291 | size_t bytes, urt_delay_t* latency){return URT_STATUS_OK;}
|
||
292 | |||
293 | /**
|
||
294 | * @brief .
|
||
295 | *
|
||
296 | * @param[in] subscriber .
|
||
297 | *
|
||
298 | * @return A status value.
|
||
299 | */
|
||
300 | urt_status_t urtHrtSubscriberUnsubscribe(urt_hrtsubscriber_t* subscriber){return URT_STATUS_OK;} |