|
|
|
@ -335,10 +335,14 @@ MmsGooseControlBlock_disable(MmsGooseControlBlock self)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MmsGooseControlBlock_checkAndPublish(MmsGooseControlBlock self, uint64_t currentTime)
|
|
|
|
|
MmsGooseControlBlock_checkAndPublish(MmsGooseControlBlock self, uint64_t currentTime, MmsMapping* mapping)
|
|
|
|
|
{
|
|
|
|
|
if (currentTime >= self->nextPublishTime) {
|
|
|
|
|
|
|
|
|
|
IedServer_lockDataModel(mapping->iedServer);
|
|
|
|
|
|
|
|
|
|
if (currentTime >= self->nextPublishTime) {
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_THREADLESS_STACK != 1)
|
|
|
|
|
Semaphore_wait(self->publisherMutex);
|
|
|
|
|
#endif
|
|
|
|
@ -348,6 +352,8 @@ MmsGooseControlBlock_checkAndPublish(MmsGooseControlBlock self, uint64_t current
|
|
|
|
|
if (self->retransmissionsLeft > 0) {
|
|
|
|
|
self->nextPublishTime = currentTime + self->minTime;
|
|
|
|
|
|
|
|
|
|
if (self->retransmissionsLeft > 0) {
|
|
|
|
|
self->nextPublishTime = currentTime + self->minTime;
|
|
|
|
|
|
|
|
|
|
if (self->retransmissionsLeft > 1)
|
|
|
|
|
GoosePublisher_setTimeAllowedToLive(self->publisher, self->minTime * 3);
|
|
|
|
@ -366,10 +372,15 @@ MmsGooseControlBlock_checkAndPublish(MmsGooseControlBlock self, uint64_t current
|
|
|
|
|
Semaphore_post(self->publisherMutex);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IedServer_unlockDataModel(mapping->iedServer);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if ((self->nextPublishTime - currentTime) > ((uint32_t) self->maxTime * 2)) {
|
|
|
|
|
self->nextPublishTime = currentTime + self->minTime;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MmsGooseControlBlock_setStateChangePending(MmsGooseControlBlock self)
|
|
|
|
|