Skip to content

Commit

Permalink
- fixed - IedConnection_setRCBValuesAsync crashes when RCB is already…
Browse files Browse the repository at this point in the history
… reserved by other client (LIB61850-382)
  • Loading branch information
mzillgith committed Jan 20, 2023
1 parent 9b977e2 commit 8dae8c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/iec61850/client/client_report_control.c
Expand Up @@ -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);

Expand All @@ -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);
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/iec61850/client/ied_connection.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8dae8c1

Please sign in to comment.