- fixed - SV publisher encoding problem when svID or datset length > 127 bytes (LIB61850-315)(#382)

pull/383/head
Michael Zillgith 3 years ago
parent 377d708f4e
commit 19f7066c38

@ -320,11 +320,14 @@ SVPublisher_ASDU_getEncodedSize(SVPublisher_ASDU self)
int encodedSize = 0; int encodedSize = 0;
/* svID */ /* svID */
encodedSize += ( 2 + strlen(self->svID) ); int svIdLen = strlen(self->svID);
encodedSize += (1 + BerEncoder_determineLengthSize(svIdLen) + svIdLen);
/* datset */ /* datset */
if (self->datset != NULL) if (self->datset != NULL) {
encodedSize += ( 2 + strlen(self->datset) ); int datSetLen = strlen(self->datset);
encodedSize += (1 + BerEncoder_determineLengthSize(datSetLen) + datSetLen);
}
/* smpCnt */ /* smpCnt */
encodedSize += 4; encodedSize += 4;

Loading…
Cancel
Save