diff --git a/src/iec61850/client/client_report_control.c b/src/iec61850/client/client_report_control.c index e126d570..6affd50e 100644 --- a/src/iec61850/client/client_report_control.c +++ b/src/iec61850/client/client_report_control.c @@ -808,8 +808,9 @@ writeVariableHandler(uint32_t invokeId, void* parameter, MmsError mmsError, MmsD handler(param->originalInvokeId, call->callbackParameter, err); releaseWriteCall(self, call, param); - } + goto exit_function; + } param->currentItemId = LinkedList_getNext(param->currentItemId); @@ -829,6 +830,7 @@ writeVariableHandler(uint32_t invokeId, void* parameter, MmsError mmsError, MmsD MmsConnection_writeVariableAsync(self->connection, &(call->invokeId), &writeError, param->domainId, itemId, value, writeVariableHandler, self); if (writeError != MMS_ERROR_NONE) { + handler(param->originalInvokeId, call->callbackParameter, iedConnection_mapMmsErrorToIedError(writeError)); releaseWriteCall(self, call, param); @@ -839,6 +841,10 @@ writeVariableHandler(uint32_t invokeId, void* parameter, MmsError mmsError, MmsD if (DEBUG_IED_CLIENT) printf("IED_CLIENT: internal error - no matching outstanding call!\n"); } + +exit_function: + + return; } uint32_t diff --git a/src/iec61850/client/ied_connection.c b/src/iec61850/client/ied_connection.c index 807037be..b49a1fe7 100644 --- a/src/iec61850/client/ied_connection.c +++ b/src/iec61850/client/ied_connection.c @@ -105,6 +105,9 @@ iedConnection_mapMmsErrorToIedError(MmsError mmsError) case MMS_ERROR_DEFINITION_OBJECT_UNDEFINED: return IED_ERROR_OBJECT_UNDEFINED; + case MMS_ERROR_ACCESS_TEMPORARILY_UNAVAILABLE: + return IED_ERROR_TEMPORARILY_UNAVAILABLE; + default: return IED_ERROR_UNKNOWN; }