From 2585aab5166a888dd18a329c5e7e5facdcf5d9fb Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Sat, 1 Sep 2018 11:14:22 +0200 Subject: [PATCH] - cleanup examples makefiles - fixed bug in MMS mapping read handler --- examples/CMakeLists.txt | 1 + examples/Makefile | 5 ++--- src/iec61850/server/mms_mapping/mms_mapping.c | 18 ++++++++++-------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 153ee606..31552c2f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -20,6 +20,7 @@ add_subdirectory(iec61850_client_example4) add_subdirectory(iec61850_client_example5) add_subdirectory(iec61850_client_example_reporting) add_subdirectory(iec61850_client_example_log) +add_subdirectory(iec61850_client_example_array) if(NOT WIN32) add_subdirectory(iec61850_client_example_files) diff --git a/examples/Makefile b/examples/Makefile index 6bf1c8f9..a6d6d5d9 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,11 +1,11 @@ EXAMPLE_DIRS = iec61850_client_example1 EXAMPLE_DIRS += iec61850_client_example2 -EXAMPLE_DIRS += iec61850_client_example3 EXAMPLE_DIRS += iec61850_client_example4 EXAMPLE_DIRS += iec61850_client_example5 EXAMPLE_DIRS += iec61850_client_example_reporting -EXAMPLE_DIRS += iec61850_client_example_log +EXAMPLE_DIRS += iec61850_client_example_array +EXAMPLE_DIRS += iec61850_client_example_control EXAMPLE_DIRS += server_example_simple EXAMPLE_DIRS += server_example_basic_io EXAMPLE_DIRS += server_example_password_auth @@ -18,7 +18,6 @@ EXAMPLE_DIRS += server_example_complex_array EXAMPLE_DIRS += server_example_61400_25 EXAMPLE_DIRS += server_example_threadless EXAMPLE_DIRS += server_example_setting_groups -EXAMPLE_DIRS += server_example_logging EXAMPLE_DIRS += server_example_files EXAMPLE_DIRS += server_example_substitution EXAMPLE_DIRS += goose_subscriber diff --git a/src/iec61850/server/mms_mapping/mms_mapping.c b/src/iec61850/server/mms_mapping/mms_mapping.c index 1572ce73..b8d7ee8e 100644 --- a/src/iec61850/server/mms_mapping/mms_mapping.c +++ b/src/iec61850/server/mms_mapping/mms_mapping.c @@ -1,7 +1,7 @@ /* * mms_mapping.c * - * Copyright 2013-2017 Michael Zillgith + * Copyright 2013-2018 Michael Zillgith * * This file is part of libIEC61850. * @@ -2447,15 +2447,17 @@ mmsReadAccessHandler (void* parameter, MmsDomain* domain, char* variableId, MmsS #if (CONFIG_IEC61850_SETTING_GROUPS == 1) - if (isFunctionalConstraintSE(separator)) { - SettingGroup* sg = getSettingGroupByMmsDomain(self, domain); + if (separator) { + if (isFunctionalConstraintSE(separator)) { + SettingGroup* sg = getSettingGroupByMmsDomain(self, domain); - if (sg != NULL) { - if (sg->sgcb->editSG == 0) - return DATA_ACCESS_ERROR_TEMPORARILY_UNAVAILABLE; + if (sg != NULL) { + if (sg->sgcb->editSG == 0) + return DATA_ACCESS_ERROR_TEMPORARILY_UNAVAILABLE; + } + else + return DATA_ACCESS_ERROR_OBJECT_NONE_EXISTENT; } - else - return DATA_ACCESS_ERROR_OBJECT_NONE_EXISTENT; } #endif /* (CONFIG_IEC61850_SETTING_GROUPS == 1) */