diff --git a/examples/server_example3/server_example3.c b/examples/server_example3/server_example3.c index 0953e409..2dfa2fc0 100644 --- a/examples/server_example3/server_example3.c +++ b/examples/server_example3/server_example3.c @@ -79,6 +79,7 @@ connectionHandler (IedServer self, ClientConnection connection, bool connected, int main(int argc, char** argv) { + printf("Using libIEC61850 version %s\n", LibIEC61850_getVersionString()); iedServer = IedServer_create(&iedModel); diff --git a/src/iec61850/common/iec61850_common.c b/src/iec61850/common/iec61850_common.c index eb7dc848..f21644f1 100644 --- a/src/iec61850/common/iec61850_common.c +++ b/src/iec61850/common/iec61850_common.c @@ -343,3 +343,9 @@ Timestamp_getTimeInMs(Timestamp* self) return (uint64_t) msVal; } + +char* +LibIEC61850_getVersionString() +{ + return CONFIG_DEFAULT_MMS_REVISION; +} diff --git a/src/iec61850/inc/iec61850_common.h b/src/iec61850/inc/iec61850_common.h index 51564f5a..795fce37 100644 --- a/src/iec61850/inc/iec61850_common.h +++ b/src/iec61850/inc/iec61850_common.h @@ -354,6 +354,14 @@ Timestamp_setTimeInSeconds(Timestamp* self, uint32_t secondsSinceEpoch); void Timestamp_setTimeInMilliseconds(Timestamp* self, uint64_t millisSinceEpoch); +/** + * \brief Get the version of the library as string + * + * \return the version of the library (e.g. "0.8.3") + */ +char* +LibIEC61850_getVersionString(void); + /** @} */ diff --git a/src/iec61850/server/model/config_file_parser.c b/src/iec61850/server/model/config_file_parser.c index 3a1d173c..b4186f56 100644 --- a/src/iec61850/server/model/config_file_parser.c +++ b/src/iec61850/server/model/config_file_parser.c @@ -235,7 +235,9 @@ ConfigFileParser_createModelFromConfigFile(FileHandle fileHandle) indendation = 4; } +#if (CONFIG_IEC61850_SETTING_GROUPS == 1) else if (StringUtils_startsWith((char*) lineBuffer, "SG")) { + if (strcmp(currentLN->name, "LLN0") != 0) goto exit_error; @@ -249,6 +251,8 @@ ConfigFileParser_createModelFromConfigFile(FileHandle fileHandle) SettingGroupControlBlock_create(currentLN, actSG, numOfSGs); } +#endif /* (CONFIG_IEC61850_SETTING_GROUPS == 1) */ + else goto exit_error; diff --git a/src/vs/libiec61850-wo-goose.def b/src/vs/libiec61850-wo-goose.def index a531d9ab..2ba1daf6 100644 --- a/src/vs/libiec61850-wo-goose.def +++ b/src/vs/libiec61850-wo-goose.def @@ -471,3 +471,4 @@ EXPORTS ClientReport_getConfRev ClientReport_hasBufOvfl ClientReport_hasDataReference + LibIEC61850_getVersionString diff --git a/src/vs/libiec61850.def b/src/vs/libiec61850.def index 2fc47403..3f30dcee 100644 --- a/src/vs/libiec61850.def +++ b/src/vs/libiec61850.def @@ -495,3 +495,5 @@ EXPORTS ClientReport_getConfRev ClientReport_hasBufOvfl ClientReport_hasDataReference + LibIEC61850_getVersionString +