public ServiceResult Write(uint attributeId, DataValue value)
{
if (!SupportsAttribute(attributeId))
{
return StatusCodes.BadAttributeIdInvalid;
}
// check for read only attributes.
switch (attributeId)
{
case Attributes.NodeId:
case Attributes.NodeClass:
{
return StatusCodes.BadNotWritable;
}
}
// check data type.
if (attributeId != Attributes.Value)
{
if (Attributes.GetDataTypeId(attributeId) != TypeInfo.GetDataTypeId(value))
{
return StatusCodes.BadTypeMismatch;
}
}
return Write(attributeId, value.Value);
}
#endregion