コード例 #1
0
        public override Task<ApiResult> UpdateDatapoint(DatapointMessage request, ServerCallContext context)
        {
            var nodeId = new NodeId(2, request.Identifier);

            if (!_serverApplication.HasDatapoint(nodeId))
            {
                return Task.FromResult(new ApiResult() { ResultCode = ResultCode.Error, Message = "Datapoint does not exist" });
            }

            _serverApplication.UpdateDatapoint(nodeId, request.Value);

            return Task.FromResult(new ApiResult() { ResultCode = ResultCode.Success, Message = "Datapoint has been updated" });
        }