]> rtime.felk.cvut.cz Git - orte.git/blobdiff - orte/liborte/ORTEPublicationTimer.c
orte 0.3.2 release
[orte.git] / orte / liborte / ORTEPublicationTimer.c
index b135f19eabdef7580a49773436ef074626787183..957d834301263f6f6b9ca7c53b467ac7ab52f2ed 100644 (file)
@@ -2,9 +2,19 @@
  *  $Id: ORTEPublicationTimer.c,v 0.0.0.1 2003/12/15
  *
  *  DEBUG:  section 32                  Publication Timer
- *  AUTHOR: Petr Smolik                 petr.smolik@wo.cz
  *
- *  ORTE - OCERA Real-Time Ethernet     http://www.ocera.org/
+ *  -------------------------------------------------------------------  
+ *                                ORTE                                 
+ *                      Open Real-Time Ethernet                       
+ *                                                                    
+ *                      Copyright (C) 2001-2006                       
+ *  Department of Control Engineering FEE CTU Prague, Czech Republic  
+ *                      http://dce.felk.cvut.cz                       
+ *                      http://www.ocera.org                          
+ *                                                                    
+ *  Author:             Petr Smolik    petr.smolik@wo.cz             
+ *  Advisor:            Pavel Pisa                                   
+ *  Project Responsible: Zdenek Hanzalek                              
  *  --------------------------------------------------------------------
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -29,17 +39,19 @@ PublicationCallBackTimer(ORTEDomain *d,void *vcstWriter) {
   ORTESendInfo     info;  
   
   pp=(ORTEPublProp*)cstWriter->objectEntryOID->attributes;
-  info.status=NEED_DATA;
-  info.topic=pp->topic;
-  info.type=pp->typeName;
-  info.senderGUID=cstWriter->objectEntryOID->guid;
-  cstWriter->objectEntryOID->sendCallBack(&info,
-                          cstWriter->objectEntryOID->instance,
-                          cstWriter->objectEntryOID->callBackParam);
   CSTWriterTryDestroyBestEffortIssue(cstWriter);
+
   if (cstWriter->csChangesCounter<pp->sendQueueSize) {
-    ORTEPublicationSendLocked(cstWriter);
+    info.status=NEED_DATA;
+    info.topic=(char*)pp->topic;
+    info.type=(char*)pp->typeName;
+    info.senderGUID=cstWriter->objectEntryOID->guid;
+    cstWriter->objectEntryOID->sendCallBack(&info,
+                          cstWriter->objectEntryOID->instance,
+                          cstWriter->objectEntryOID->callBackParam);
+    ORTEPublicationSendLocked(cstWriter,NULL);
   }
+
   eventAdd(d,
       cstWriter->objectEntryOID->objectEntryAID,
       &cstWriter->objectEntryOID->sendCallBackDelayTimer,