X-Git-Url: https://rtime.felk.cvut.cz/gitweb/orte.git/blobdiff_plain/e80a6f5e0540d9e10ee957240e6f5b3faaa54021..44b53e7b789fa481a19db83e52cb3f15f0d90e85:/orte/liborte/ORTEPublicationTimer.c diff --git a/orte/liborte/ORTEPublicationTimer.c b/orte/liborte/ORTEPublicationTimer.c index d024276..45b7da6 100644 --- a/orte/liborte/ORTEPublicationTimer.c +++ b/orte/liborte/ORTEPublicationTimer.c @@ -3,63 +3,64 @@ * * DEBUG: section 32 Publication Timer * - * ------------------------------------------------------------------- - * 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@smoliku.cz - * Advisor: Pavel Pisa - * Project Responsible: Zdenek Hanzalek + * ------------------------------------------------------------------- + * 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@smoliku.cz + * Advisor: Pavel Pisa + * Project Responsible: Zdenek Hanzalek * -------------------------------------------------------------------- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - */ + * + */ #include "orte_all.h" /*****************************************************************************/ int -PublicationCallBackTimer(ORTEDomain *d,void *vcstWriter) { - CSTWriter *cstWriter=(CSTWriter*)vcstWriter; +PublicationCallBackTimer(ORTEDomain *d, void *vcstWriter) +{ + CSTWriter *cstWriter = (CSTWriter *)vcstWriter; ORTEPublProp *pp; - ORTESendInfo info; - - pp=(ORTEPublProp*)cstWriter->objectEntryOID->attributes; + ORTESendInfo info; + + pp = (ORTEPublProp *)cstWriter->objectEntryOID->attributes; CSTWriterTryDestroyBestEffortIssue(cstWriter); - if (cstWriter->csChangesCountersendQueueSize) { - info.status=NEED_DATA; - info.topic=(char*)pp->topic; - info.type=(char*)pp->typeName; - info.senderGUID=cstWriter->objectEntryOID->guid; + if (cstWriter->csChangesCounter < pp->sendQueueSize) { + 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); + cstWriter->objectEntryOID->instance, + cstWriter->objectEntryOID->callBackParam); + ORTEPublicationSendLocked(cstWriter, NULL); } eventAdd(d, - cstWriter->objectEntryOID->objectEntryAID, - &cstWriter->objectEntryOID->sendCallBackDelayTimer, - 0, - "PublicationCallBackTimer", - PublicationCallBackTimer, - &cstWriter->lock, - cstWriter, - &cstWriter->objectEntryOID->sendCallBackDelay); + cstWriter->objectEntryOID->objectEntryAID, + &cstWriter->objectEntryOID->sendCallBackDelayTimer, + 0, + "PublicationCallBackTimer", + PublicationCallBackTimer, + &cstWriter->lock, + cstWriter, + &cstWriter->objectEntryOID->sendCallBackDelay); return 0; }