Opc.Ua.Server.NodeSource.Read C# (CSharp) Method

Read() public method

public Read ( IOperationContext context, uint attributeId, DataValue value ) : ServiceResult
context IOperationContext
attributeId uint
value DataValue
return ServiceResult
        public ServiceResult Read(IOperationContext context, uint attributeId, DataValue value)
        {
            lock (DataLock)
            {
                if (!SupportsAttribute(attributeId))
                {
                    return StatusCodes.BadAttributeIdInvalid;
                }

                ServiceResult result = ReadAttribute(context, attributeId, value);

                if (ServiceResult.IsBad(result))
                {
                    value.Value = null;
                }
                
                if (result != null)
                {
                    value.StatusCode = result.StatusCode;
                }

                return null;
            }
        }