diff --git a/config/stack_config.h b/config/stack_config.h index 1c8ac382..c5c9fd1a 100644 --- a/config/stack_config.h +++ b/config/stack_config.h @@ -17,7 +17,7 @@ #define DEBUG_COTP 0 #define DEBUG_ISO_SERVER 0 #define DEBUG_ISO_CLIENT 0 -#define DEBUG_IED_SERVER 1 +#define DEBUG_IED_SERVER 0 #define DEBUG_IED_CLIENT 0 #define DEBUG_MMS_CLIENT 0 #define DEBUG_MMS_SERVER 0 diff --git a/src/iec61850/client/client_control.c b/src/iec61850/client/client_control.c index 9c71ad3d..41b67ccc 100644 --- a/src/iec61850/client/client_control.c +++ b/src/iec61850/client/client_control.c @@ -371,7 +371,12 @@ ControlObjectClient_operate(ControlObjectClient self, MmsValue* ctlVal, uint64_t MmsValue* origin = createOriginValue(self); MmsValue_setElement(operParameters, index++, origin); - self->ctlNum++; + if (!((self->ctlModel == CONTROL_MODEL_SBO_NORMAL) || + (self->ctlModel == CONTROL_MODEL_SBO_ENHANCED))) + { + self->ctlNum++; + } + MmsValue* ctlNum = MmsValue_newUnsignedFromUint32(self->ctlNum); MmsValue_setElement(operParameters, index++, ctlNum); @@ -471,7 +476,9 @@ ControlObjectClient_selectWithValue(ControlObjectClient self, MmsValue* ctlVal) MmsValue* origin = createOriginValue(self); MmsValue_setElement(selValParameters, index++, origin); - MmsValue* ctlNum = MmsValue_newUnsignedFromUint32(self->ctlNum + 1); + self->ctlNum++; + + MmsValue* ctlNum = MmsValue_newUnsignedFromUint32(self->ctlNum); MmsValue_setElement(selValParameters, index++, ctlNum); @@ -536,6 +543,8 @@ ControlObjectClient_select(ControlObjectClient self) bool selected = false; + self->ctlNum++; + if (value == NULL) { if (DEBUG_IED_CLIENT) printf("IED_CLIENT: select: read SBO failed!\n");