- IED Server: prevent integrated GOOSE publisher to crash when ethernet socket cannot be created

pull/309/head
Michael Zillgith 5 years ago
parent 23a3b3a371
commit 9e064ab709

@ -58,8 +58,9 @@ goCbEventHandler(MmsGooseControlBlock goCb, int event, void* parameter)
printf(" GoEna: %i\n", MmsGooseControlBlock_getGoEna(goCb));
}
int main(int argc, char** argv) {
int
main(int argc, char** argv)
{
IedServerConfig config = IedServerConfig_create();
iedServer = IedServer_createWithConfig(&iedModel, NULL, config);
@ -152,5 +153,6 @@ int main(int argc, char** argv) {
/* Cleanup - free all resources */
IedServer_destroy(iedServer);
return 0;
} /* main() */

@ -508,6 +508,7 @@ MmsGooseControlBlock_disable(MmsGooseControlBlock self, MmsMapping* mmsMapping)
void
MmsGooseControlBlock_checkAndPublish(MmsGooseControlBlock self, uint64_t currentTime)
{
if (self->publisher) {
if (currentTime >= self->nextPublishTime) {
#if (CONFIG_MMS_THREADLESS_STACK != 1)
@ -540,6 +541,7 @@ MmsGooseControlBlock_checkAndPublish(MmsGooseControlBlock self, uint64_t current
else if ((self->nextPublishTime - currentTime) > ((uint32_t) self->maxTime * 2)) {
self->nextPublishTime = currentTime + self->minTime;
}
}
}
void
@ -551,6 +553,9 @@ MmsGooseControlBlock_setStateChangePending(MmsGooseControlBlock self)
void
MmsGooseControlBlock_publishNewState(MmsGooseControlBlock self)
{
if (self->publisher == false)
return;
if (self->stateChangePending) {
#if (CONFIG_MMS_THREADLESS_STACK != 1)
Semaphore_wait(self->publisherMutex);

Loading…
Cancel
Save