From 7cb69c983aaa6d81786eac6d45509fa59ba017a6 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Fri, 3 May 2019 12:06:18 +0200 Subject: [PATCH] - additionally allow comma and space as separators in ap-titles used in API functions --- src/iec61850/server/impl/ied_server.c | 1 - src/mms/asn1/ber_encoder.c | 14 +++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/iec61850/server/impl/ied_server.c b/src/iec61850/server/impl/ied_server.c index 748fee1e..4c452e3e 100644 --- a/src/iec61850/server/impl/ied_server.c +++ b/src/iec61850/server/impl/ied_server.c @@ -1158,7 +1158,6 @@ IedServer_updateBooleanAttributeValue(IedServer self, DataAttribute* dataAttribu bool currentValue = MmsValue_getBoolean(dataAttribute->mmsValue); if (currentValue == value) { - checkForUpdateTrigger(self, dataAttribute); } else { diff --git a/src/mms/asn1/ber_encoder.c b/src/mms/asn1/ber_encoder.c index ea80128d..9110e355 100644 --- a/src/mms/asn1/ber_encoder.c +++ b/src/mms/asn1/ber_encoder.c @@ -400,8 +400,20 @@ BerEncoder_encodeOIDToBuffer(const char* oidString, uint8_t* buffer, int maxBufL int x = atoi(oidString); + char sepChar = '.'; + const char* separator = strchr(oidString, '.'); + if (separator == NULL) { + sepChar = ','; + separator = strchr(oidString, ','); + } + + if (separator == NULL) { + sepChar = ' '; + separator = strchr(oidString, ','); + } + if (separator == NULL) return 0; int y = atoi(separator + 1); @@ -416,7 +428,7 @@ BerEncoder_encodeOIDToBuffer(const char* oidString, uint8_t* buffer, int maxBufL encodedBytes++; while (1) { - separator = strchr(separator + 1, '.'); + separator = strchr(separator + 1, sepChar); if (separator == NULL) break;