From 3a248a4f203b4c126cd3439694abb30ba8e8dc40 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Fri, 6 Mar 2020 00:00:13 +0100 Subject: [PATCH] - IEC 61850 server: fixed control handling to comply with test case sCtl11 --- src/iec61850/server/mms_mapping/control.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/iec61850/server/mms_mapping/control.c b/src/iec61850/server/mms_mapping/control.c index 9838af2c..fff74880 100644 --- a/src/iec61850/server/mms_mapping/control.c +++ b/src/iec61850/server/mms_mapping/control.c @@ -1447,12 +1447,8 @@ Control_writeAccessControlObject(MmsMapping* self, MmsDomain* domain, char* vari if (state != STATE_UNSELECTED) { indication = DATA_ACCESS_ERROR_TEMPORARILY_UNAVAILABLE; - if (connection != controlObject->mmsConnection) - ControlObject_sendLastApplError(controlObject, connection, "SBOw", CONTROL_ERROR_NO_ERROR, - ADD_CAUSE_LOCKED_BY_OTHER_CLIENT, ctlNum, origin, true); - else - ControlObject_sendLastApplError(controlObject, connection, "SBOw", CONTROL_ERROR_NO_ERROR, - ADD_CAUSE_OBJECT_ALREADY_SELECTED, ctlNum, origin, true); + ControlObject_sendLastApplError(controlObject, connection, "SBOw", CONTROL_ERROR_NO_ERROR, + ADD_CAUSE_OBJECT_ALREADY_SELECTED, ctlNum, origin, true); if (DEBUG_IED_SERVER) printf("IED_SERVER: SBOw - select failed!\n"); @@ -1557,6 +1553,10 @@ Control_writeAccessControlObject(MmsMapping* self, MmsDomain* domain, char* vari indication = DATA_ACCESS_ERROR_TEMPORARILY_UNAVAILABLE; if (DEBUG_IED_SERVER) printf("IED_SERVER: Oper - operate from wrong client connection!\n"); + + ControlObject_sendLastApplError(controlObject, connection, "Oper", CONTROL_ERROR_NO_ERROR, + ADD_CAUSE_LOCKED_BY_OTHER_CLIENT, ctlNum, origin, true); + goto free_and_return; }