diff --git a/src/iec61850/client/ied_connection.c b/src/iec61850/client/ied_connection.c index bc8e9ff6..d64fc595 100644 --- a/src/iec61850/client/ied_connection.c +++ b/src/iec61850/client/ied_connection.c @@ -1,7 +1,7 @@ /* * ied_connection.c * - * Copyright 2013-2022 Michael Zillgith + * Copyright 2013-2023 Michael Zillgith * * This file is part of libIEC61850. * @@ -108,6 +108,9 @@ iedConnection_mapMmsErrorToIedError(MmsError mmsError) case MMS_ERROR_ACCESS_TEMPORARILY_UNAVAILABLE: return IED_ERROR_TEMPORARILY_UNAVAILABLE; + case MMS_ERROR_SERVICE_OBJECT_CONSTRAINT_CONFLICT: + return IED_ERROR_OBJECT_CONSTRAINT_CONFLICT; + default: return IED_ERROR_UNKNOWN; } diff --git a/src/iec61850/common/iec61850_common.c b/src/iec61850/common/iec61850_common.c index fa9a13c0..2ba1d3f7 100644 --- a/src/iec61850/common/iec61850_common.c +++ b/src/iec61850/common/iec61850_common.c @@ -768,7 +768,6 @@ MmsMapping_ObjectReferenceToVariableAccessSpec(char* objectReference) return accessSpec; } - static int getNumberOfDigits(int value) { diff --git a/src/iec61850/inc/iec61850_client.h b/src/iec61850/inc/iec61850_client.h index 1326c1e7..5e53efe2 100644 --- a/src/iec61850/inc/iec61850_client.h +++ b/src/iec61850/inc/iec61850_client.h @@ -162,6 +162,9 @@ typedef enum { /** Received an invalid response message from the server */ IED_ERROR_MALFORMED_MESSAGE = 34, + /** Service was not executed because required resource is still in use */ + IED_ERROR_OBJECT_CONSTRAINT_CONFLICT = 35, + /** Service not implemented */ IED_ERROR_SERVICE_NOT_IMPLEMENTED = 98, diff --git a/src/mms/iso_mms/client/mms_client_connection.c b/src/mms/iso_mms/client/mms_client_connection.c index a9763c08..6f743b0b 100644 --- a/src/mms/iso_mms/client/mms_client_connection.c +++ b/src/mms/iso_mms/client/mms_client_connection.c @@ -436,7 +436,17 @@ convertServiceErrorToMmsError(MmsServiceError serviceError) break; case 4: /* class: service */ - mmsError = MMS_ERROR_SERVICE_OTHER; + + switch (serviceError.errorCode) + { + case 5: + mmsError = MMS_ERROR_SERVICE_OBJECT_CONSTRAINT_CONFLICT; + break; + + default: + mmsError = MMS_ERROR_SERVICE_OTHER; + break; + } break; case 5: /* class: service-preempt */