When write-property to object-name property in example objects, no need to write the duplicate name again.
This commit is contained in:
@@ -1522,15 +1522,14 @@ bool Device_Write_Property_Local(
|
|||||||
&object_type, &object_instance)) {
|
&object_type, &object_instance)) {
|
||||||
if ((object_type == wp_data->object_type) &&
|
if ((object_type == wp_data->object_type) &&
|
||||||
(object_instance == wp_data->object_instance)) {
|
(object_instance == wp_data->object_instance)) {
|
||||||
/* okay to set my name as the same name */
|
/* writing same name to same object */
|
||||||
status = true;
|
status = true;
|
||||||
} else {
|
} else {
|
||||||
status = false;
|
status = false;
|
||||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||||
wp_data->error_code = ERROR_CODE_DUPLICATE_NAME;
|
wp_data->error_code = ERROR_CODE_DUPLICATE_NAME;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
if (status) {
|
|
||||||
Device_Set_Object_Name(&value.type.Character_String);
|
Device_Set_Object_Name(&value.type.Character_String);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -653,6 +653,7 @@ bool Multistate_Input_Write_Property(
|
|||||||
&object_type, &object_instance)) {
|
&object_type, &object_instance)) {
|
||||||
if ((object_type == wp_data->object_type) &&
|
if ((object_type == wp_data->object_type) &&
|
||||||
(object_instance == wp_data->object_instance)) {
|
(object_instance == wp_data->object_instance)) {
|
||||||
|
/* writing same name to same object */
|
||||||
status = true;
|
status = true;
|
||||||
} else {
|
} else {
|
||||||
status = false;
|
status = false;
|
||||||
@@ -660,9 +661,6 @@ bool Multistate_Input_Write_Property(
|
|||||||
wp_data->error_code = ERROR_CODE_DUPLICATE_NAME;
|
wp_data->error_code = ERROR_CODE_DUPLICATE_NAME;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
status = true;
|
|
||||||
}
|
|
||||||
if (status) {
|
|
||||||
status = Multistate_Input_Object_Name_Write(
|
status = Multistate_Input_Object_Name_Write(
|
||||||
wp_data->object_instance,
|
wp_data->object_instance,
|
||||||
&value.type.Character_String,
|
&value.type.Character_String,
|
||||||
|
|||||||
Reference in New Issue
Block a user