|
|
|
@ -548,9 +548,11 @@ getSettingGroupBySGCB(MmsMapping* self, SettingGroupControlBlock* sgcb)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
unselectSettingGroup(SettingGroup* settingGroup)
|
|
|
|
|
unselectEditSettingGroup(SettingGroup* settingGroup)
|
|
|
|
|
{
|
|
|
|
|
if (DEBUG_IED_SERVER)
|
|
|
|
|
printf("IED_SERVER: Unselect setting group\n");
|
|
|
|
|
|
|
|
|
|
settingGroup->sgcb->editSG = 0;
|
|
|
|
|
settingGroup->editingClient = NULL;
|
|
|
|
|
MmsValue* editSg = MmsValue_getElement(settingGroup->sgcbMmsValues, 2);
|
|
|
|
@ -568,7 +570,7 @@ unselectAllSettingGroups(MmsMapping* self, MmsServerConnection serverCon)
|
|
|
|
|
SettingGroup* settingGroup = (SettingGroup*) LinkedList_getData(settingGroupElement);
|
|
|
|
|
|
|
|
|
|
if (settingGroup->editingClient == (ClientConnection) serverCon)
|
|
|
|
|
unselectSettingGroup(settingGroup);
|
|
|
|
|
unselectEditSettingGroup(settingGroup);
|
|
|
|
|
|
|
|
|
|
settingGroupElement = LinkedList_getNext(settingGroupElement);
|
|
|
|
|
}
|
|
|
|
@ -584,7 +586,7 @@ MmsMapping_checkForSettingGroupReservationTimeouts(MmsMapping* self, uint64_t cu
|
|
|
|
|
|
|
|
|
|
if (settingGroup->sgcb->editSG != 0)
|
|
|
|
|
if (currentTime >= settingGroup->reservationTimeout)
|
|
|
|
|
unselectSettingGroup(settingGroup);
|
|
|
|
|
unselectEditSettingGroup(settingGroup);
|
|
|
|
|
|
|
|
|
|
settingGroupElement = LinkedList_getNext(settingGroupElement);
|
|
|
|
|
}
|
|
|
|
@ -1712,8 +1714,10 @@ mmsWriteHandler(void* parameter, MmsDomain* domain,
|
|
|
|
|
if (sg != NULL) {
|
|
|
|
|
uint32_t val = MmsValue_toUint32(value);
|
|
|
|
|
|
|
|
|
|
if ((val == 0) && (sg->editingClient == (ClientConnection) connection)) {
|
|
|
|
|
unselectSettingGroup(sg);
|
|
|
|
|
if (sg->editingClient == (ClientConnection) connection) {
|
|
|
|
|
|
|
|
|
|
if (val == 0) {
|
|
|
|
|
unselectEditSettingGroup(sg);
|
|
|
|
|
return DATA_ACCESS_ERROR_SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1743,11 +1747,13 @@ mmsWriteHandler(void* parameter, MmsDomain* domain,
|
|
|
|
|
else
|
|
|
|
|
return DATA_ACCESS_ERROR_OBJECT_ACCESS_DENIED;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return DATA_ACCESS_ERROR_OBJECT_VALUE_INVALID;
|
|
|
|
|
}
|
|
|
|
|
else /* Edit SG was set by other client */
|
|
|
|
|
return DATA_ACCESS_ERROR_TEMPORARILY_UNAVAILABLE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp(nameId, "CnfEdit") == 0) {
|
|
|
|
|
SettingGroup* sg = getSettingGroupByMmsDomain(self, domain);
|
|
|
|
@ -1762,7 +1768,7 @@ mmsWriteHandler(void* parameter, MmsDomain* domain,
|
|
|
|
|
sg->editSgConfirmedHandler(sg->editSgConfirmedHandlerParameter, sg->sgcb,
|
|
|
|
|
sg->sgcb->editSG);
|
|
|
|
|
|
|
|
|
|
unselectSettingGroup(sg);
|
|
|
|
|
unselectEditSettingGroup(sg);
|
|
|
|
|
|
|
|
|
|
return DATA_ACCESS_ERROR_SUCCESS;
|
|
|
|
|
}
|
|
|
|
|