- GOOSE publisher: fixed bug in GOOSE message calculation

pull/90/head
Michael Zillgith 7 years ago
parent 74a9eb5856
commit 57eb6bd455

@ -1,7 +1,7 @@
/* /*
* goose_publisher.c * goose_publisher.c
* *
* Copyright 2013 Michael Zillgith * Copyright 2013-2018 Michael Zillgith
* *
* This file is part of libIEC61850. * This file is part of libIEC61850.
* *
@ -246,18 +246,18 @@ createGoosePayload(GoosePublisher self, LinkedList dataSetValues, uint8_t* buffe
/* Step 1 - calculate length fields */ /* Step 1 - calculate length fields */
uint32_t goosePduLength = 0; uint32_t goosePduLength = 0;
goosePduLength += BerEncoder_determineEncodedStringSize(self->goCBRef); goosePduLength += 1 + BerEncoder_determineEncodedStringSize(self->goCBRef);
uint32_t timeAllowedToLive = self->timeAllowedToLive;
goosePduLength += 2 + BerEncoder_UInt32determineEncodedSize(timeAllowedToLive);
goosePduLength += BerEncoder_determineEncodedStringSize(self->dataSetRef); goosePduLength += BerEncoder_determineEncodedStringSize(self->dataSetRef);
if (self->goID != NULL) if (self->goID != NULL)
goosePduLength += BerEncoder_determineEncodedStringSize(self->goID); goosePduLength += 1 + BerEncoder_determineEncodedStringSize(self->goID);
else else
goosePduLength += BerEncoder_determineEncodedStringSize(self->goCBRef); goosePduLength += 1 + BerEncoder_determineEncodedStringSize(self->goCBRef);
uint32_t timeAllowedToLive = self->timeAllowedToLive;
goosePduLength += 2 + BerEncoder_UInt32determineEncodedSize(timeAllowedToLive);
goosePduLength += 2 + 8; /* for T (UTCTIME) */ goosePduLength += 2 + 8; /* for T (UTCTIME) */

Loading…
Cancel
Save