- GOOSE subscriber: restore old behavior when data set array is provided by user

pull/331/head
Michael Zillgith 4 years ago
parent 1b2d194694
commit 8578344e85

@ -9,6 +9,7 @@
#include "goose_receiver.h"
#include "goose_subscriber.h"
#include "hal_thread.h"
#include "linked_list.h"
#include <stdlib.h>
#include <stdio.h>
@ -16,12 +17,13 @@
static int running = 1;
void sigint_handler(int signalId)
static void
sigint_handler(int signalId)
{
running = 0;
}
void
static void
gooseListener(GooseSubscriber subscriber, void* parameter)
{
printf("GOOSE event:\n");

@ -760,11 +760,13 @@ parseGoosePayload(GooseReceiver self, uint8_t* buffer, int apduLength)
matchingSubscriber->ndsCom = ndsCom;
matchingSubscriber->simulation = simulation;
if (matchingSubscriber->dataSetValuesSelfAllocated) {
/* when confRev changed replaced old data set */
if ((matchingSubscriber->dataSetValues != NULL) && (matchingSubscriber->confRev != confRev)) {
MmsValue_delete(matchingSubscriber->dataSetValues);
matchingSubscriber->dataSetValues = NULL;
}
}
matchingSubscriber->confRev = confRev;

@ -47,8 +47,10 @@ GooseSubscriber_create(char* goCbRef, MmsValue* dataSetValues)
self->timestamp = MmsValue_newUtcTime(0);
self->dataSetValues = dataSetValues;
if (dataSetValues != NULL)
if (dataSetValues)
self->dataSetValuesSelfAllocated = false;
else
self->dataSetValuesSelfAllocated = true;
memset(self->dstMac, 0xFF, 6);
self->dstMacSet = false;

Loading…
Cancel
Save