- GOOSE publisher: fixed problem with overflow of stNum and sqNum (see #199)

pull/202/head
Michael Zillgith 6 years ago
parent 88fce24b83
commit 7d1a552cde

@ -159,6 +159,11 @@ GoosePublisher_increaseStNum(GoosePublisher self)
MmsValue_setUtcTimeMs(self->timestamp, currentTime);
self->stNum++;
/* check for overflow */
if (self->stNum == 0)
self->stNum = 1;
self->sqNum = 0;
return currentTime;
@ -387,11 +392,14 @@ GoosePublisher_publish(GoosePublisher self, LinkedList dataSet)
int32_t payloadLength = createGoosePayload(self, dataSet, buffer, maxPayloadSize);
self->sqNum++;
if (payloadLength == -1)
return -1;
self->sqNum++;
if (self->sqNum == 0)
self->sqNum = 1;
int lengthIndex = self->lengthField;
size_t gooseLength = payloadLength + 8;

Loading…
Cancel
Save