]> rtime.felk.cvut.cz Git - orte.git/blob - orte/liborte/ORTEPublicationTimer.c
0e84516521c60645982ddf5018a491fb7613d95f
[orte.git] / orte / liborte / ORTEPublicationTimer.c
1 /*
2  *  $Id: ORTEPublicationTimer.c,v 0.0.0.1 2003/12/15
3  *
4  *  DEBUG:  section 32                  Publication Timer
5  *  AUTHOR: Petr Smolik                 petr.smolik@wo.cz
6  *
7  *  ORTE - OCERA Real-Time Ethernet     http://www.ocera.org/
8  *  --------------------------------------------------------------------
9  *
10  *  This program is free software; you can redistribute it and/or modify
11  *  it under the terms of the GNU General Public License as published by
12  *  the Free Software Foundation; either version 2 of the License, or
13  *  (at your option) any later version.
14  *  
15  *  This program is distributed in the hope that it will be useful,
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *  GNU General Public License for more details.
19  *  
20  */ 
21
22 #include "orte_all.h"
23
24 /*****************************************************************************/
25 int
26 PublicationCallBackTimer(ORTEDomain *d,void *vcstWriter) {
27   CSTWriter        *cstWriter=(CSTWriter*)vcstWriter;
28   ORTEPublProp     *pp;
29   ORTESendInfo     info;  
30   
31   pp=(ORTEPublProp*)cstWriter->objectEntryOID->attributes;
32   CSTWriterTryDestroyBestEffortIssue(cstWriter);
33
34   if (cstWriter->csChangesCounter<pp->sendQueueSize) {
35     info.status=NEED_DATA;
36     info.topic=pp->topic;
37     info.type=pp->typeName;
38     info.senderGUID=cstWriter->objectEntryOID->guid;
39     cstWriter->objectEntryOID->sendCallBack(&info,
40                           cstWriter->objectEntryOID->instance,
41                           cstWriter->objectEntryOID->callBackParam);
42     ORTEPublicationSendLocked(cstWriter,NULL);
43   }
44
45   eventAdd(d,
46       cstWriter->objectEntryOID->objectEntryAID,
47       &cstWriter->objectEntryOID->sendCallBackDelayTimer,
48       0,   
49       "PublicationCallBackTimer",
50       PublicationCallBackTimer,
51       &cstWriter->lock,
52       cstWriter,
53       &cstWriter->objectEntryOID->sendCallBackDelay);               
54   return 0;
55 }