Revision 5c6cb22f src/urt_subscriber.c

View differences:

src/urt_subscriber.c
50 50
 *
51 51
 * @param[in] subscriber  The NRT subscriber to initialize. Must not be NULL.
52 52
 */
53
void urtNrtSubscriberInit (urt_nrtsubscriber_t* subscriber) {return;}
53
void urtNrtSubscriberInit (urt_nrtsubscriber_t* subscriber)
54
{
55
  subscriber->base.topic = NULL;
56
  urtEventListenerInit(subscriber->base.evtListener);
57
  subscriber->base.lastMessage = NULL;
58
  subscriber->base.lastMessageTime = 0;
59
  #if (URT_CFG_PUBSUB_PROFILING)
60
    subscriber->minLatency = URT_DELAY_INFINITE;
61
    subscriber->maxLatency = URT_DELAY_IMMEDIATE;
62
  #endif /* URT_CFG_PUBSUB_PROFILING */
63
  return;
64
}
54 65

  
55 66
/**
56 67
 * @brief  Subscribes the subscriber to a topic.
......
119 130
 *
120 131
 * @param[in] subscriber  The SRT subscriber to initialize. Must not be NULL.
121 132
 */
122
void urtSrtSubscriberInit(urt_srtsubscriber_t* subscriber) {return;}
133
void urtSrtSubscriberInit(urt_srtsubscriber_t* subscriber)
134
{
135
  subscriber->base.topic = NULL;
136
  urtEventListenerInit(subscriber->base.evtListener);
137
  subscriber->base.lastMessage = NULL;
138
  subscriber->base.lastMessageTime = 0;
139
  #if (URT_CFG_PUBSUB_PROFILING)
140
    subscriber->base.sumLatencies = 0;
141
    subscriber->base.numMessagesReceived = 0;
142
    subscriber->usefulnesscb = NULL;
143
    subscriber->cbparams = NULL;
144
    subscriber->minLatency = URT_DELAY_INFINITE;
145
    subscriber->maxLatency = URT_DELAY_IMMEDIATE;
146
  #endif /* URT_CFG_PUBSUB_PROFILING */
147
  return;
148
}
123 149

  
124 150
/**
125 151
 * @brief  Subscribes the subscriber to a topic.
......
196 222
 *
197 223
 * @param[in] subscriber  The SRT subscriber to initialize. Must not be NULL.
198 224
 */
199
void urtFrtSubscriberInit(urt_frtsubscriber_t* subscriber){return URT_STATUS_OK;}
225
void urtFrtSubscriberInit(urt_frtsubscriber_t* subscriber)
226
{
227
  subscriber->base.topic = NULL;
228
  urtEventListenerInit(subscriber->base.evtListener);
229
  subscriber->base.lastMessage = NULL;
230
  subscriber->base.lastMessageTime = 0;
231

  
232
  #if (URT_CFG_PUBSUB_PROFILING)
233
    subscriber->base.sumLatencies = 0;
234
    subscriber->base.numMessagesReceived = 0;
235
  #endif /* URT_CFG_PUBSUB_PROFILING */
236

  
237
  #if (URT_CFG_PUBSUB_QOS_DEADLINECHECKS)
238
    subscriber->deadlineOffset = 0;
239
  #endif /* URT_CFG_PUBSUB_QOS_DEADLINECHECKS */
240

  
241
  #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS)
242
    subscriber->maxJitter = 0;
243
  #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS */
244

  
245
  #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING)
246
    subscriber->minLatency = URT_DELAY_INFINITE;
247
    subscriber->maxLatency = URT_DELAY_IMMEDIATE;
248
  #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING */
249
  return;
250
}
251

  
200 252

  
201 253
/**
202 254
 * @brief  Subscribes the subscriber to a topic.
......
260 312
/**
261 313
 * @brief  Unsubscribes from a subscriber.
262 314
 *
263
 * @param[in] subscriber  The NRT subscriber to be unsubscribed. Must not be NULL.
315
 * @param[in] subscriber  The FRT subscriber to be unsubscribed. Must not be NULL.
264 316
 *
265 317
 * @return  Returns URT_STATUS_OK on sucess.
266 318
 *          Returns URT_STATUS_UNSUBSCRIBE_NOTOPIC if the subscriber is not associated to a topic.
......
273 325
 *
274 326
 * @param[in] subscriber  The HRT subscriber to initialize. Must not be NULL.
275 327
 */
276
void urtHrtSubscriberInit(urt_hrtsubscriber_t* subscriber){return;}
328
void urtHrtSubscriberInit(urt_hrtsubscriber_t* subscriber)
329
{
330
  subscriber->base.topic = NULL;
331
  urtEventListenerInit(subscriber->base.evtListener);
332
  subscriber->base.lastMessage = NULL;
333
  subscriber->base.lastMessageTime = 0;
334

  
335
  #if (URT_CFG_PUBSUB_PROFILING)
336
    subscriber->base.sumLatencies = 0;
337
    subscriber->base.numMessagesReceived = 0;
338
  #endif /* URT_CFG_PUBSUB_PROFILING */
339

  
340
  subscriber->next = NULL;
341

  
342
  #if (URT_CFG_PUBSUB_QOS_DEADLINECHECKS)
343
    subscriber->deadlineOffset = 0;
344
    urtTimerInit(subscriber->qodDeadlineTimer);
345
  #endif /* URT_CFG_PUBSUB_QOS_DEADLINECHECKS */
346

  
347
  #if (URT_CFG_PUBSUB_QOS_RATECHECKS)
348
    subscriber->expectedRate = 0;
349
  #endif /* URT_CFG_PUBSUB_QOS_RATECHECKS */
350

  
351
  #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS)
352
    subscriber->maxJitter = 0;
353
  #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS */
354

  
355
  #if (URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING)
356
    subscriber->minLatency = URT_DELAY_INFINITE;
357
    subscriber->maxLatency = URT_DELAY_IMMEDIATE;
358
  #endif /* URT_CFG_PUBSUB_QOS_JITTERCHECKS || URT_CFG_PUBSUB_PROFILING */
359
  return;
360
}
361

  
277 362

  
278 363
/**
279 364
 * @brief  Subscribes the subscriber to a topic.
280 365
 *
281
 * @param[in] subscriber  The NRT subscriber which shall subscribe to a topic. Must not be NULL.
366
 * @param[in] subscriber  The HRT subscriber which shall subscribe to a topic. Must not be NULL.
282 367
 * @param[in] topic  The topic to subscribe to. Must not be NULL.
283 368
 * @param[in] messages  NULL terminated list of messages to contribute to the topic.
284 369
 *                      Messages must not be associated to another topic.

Also available in: Unified diff