Exemple #1
0
        /// <inheritdoc/>
        public async Task <ValueWriteResultModel> NodeValueWriteAsync(
            EndpointApiModel endpoint, ValueWriteRequestModel request)
        {
            var result = await _client.NodeValueWriteAsync(endpoint,
                                                           request.Map <ValueWriteRequestApiModel>());

            return(result.Map <ValueWriteResultModel>());
        }
        /// <inheritdoc/>
        public async Task <ValueWriteResultModel> NodeValueWriteAsync(
            string endpoint, ValueWriteRequestModel request)
        {
            var result = await _client.NodeValueWriteAsync(endpoint,
                                                           Map <ValueWriteRequestApiModel>(request));

            return(Map <ValueWriteResultModel>(result));
        }
Exemple #3
0
        /// <inheritdoc/>
        public async Task <ValueWriteResultModel> NodeValueWriteAsync(
            string endpoint, ValueWriteRequestModel request)
        {
            var result = await _client.NodeValueWriteAsync(endpoint,
                                                           request.ToApiModel());

            return(result.ToServiceModel());
        }
Exemple #4
0
 /// <inheritdoc/>
 public async Task <ValueWriteResultModel> NodeValueWriteAsync(string endpointId,
                                                               ValueWriteRequestModel request)
 {
     if (request == null)
     {
         throw new ArgumentNullException(nameof(request));
     }
     if (request.Value == null)
     {
         throw new ArgumentNullException(nameof(request.Value));
     }
     return(await CallServiceOnTwin <ValueWriteRequestModel, ValueWriteResultModel>(
                "ValueWrite_V2", endpointId, request));
 }
Exemple #5
0
 /// <summary>
 /// Create from service model
 /// </summary>
 /// <param name="model"></param>
 public ValueWriteRequestApiModel(ValueWriteRequestModel model)
 {
     if (model == null)
     {
         throw new ArgumentNullException(nameof(model));
     }
     NodeId     = model.NodeId;
     BrowsePath = model.BrowsePath;
     DataType   = model.DataType;
     IndexRange = model.IndexRange;
     Value      = model.Value;
     Header     = model.Header == null ? null :
                  new RequestHeaderApiModel(model.Header);
 }
 /// <inheritdoc/>
 public async Task <ValueWriteResultModel> NodeValueWriteAsync(
     EndpointRegistrationModel registration, ValueWriteRequestModel request)
 {
     if (request == null)
     {
         throw new ArgumentNullException(nameof(request));
     }
     if (request.Value == null)
     {
         throw new ArgumentNullException(nameof(request.Value));
     }
     return(await CallServiceOnSupervisor <ValueWriteRequestModel, ValueWriteResultModel>(
                "ValueWrite_V2", registration, request));
 }
 /// <summary>
 /// Create from service model
 /// </summary>
 /// <param name="model"></param>
 public static ValueWriteRequestApiModel ToApiModel(
     this ValueWriteRequestModel model)
 {
     if (model == null)
     {
         return(null);
     }
     return(new ValueWriteRequestApiModel {
         NodeId = model.NodeId,
         BrowsePath = model.BrowsePath,
         DataType = model.DataType,
         IndexRange = model.IndexRange,
         Value = model.Value,
         Header = model.Header.ToApiModel()
     });
 }
 /// <inheritdoc/>
 public Task <ValueWriteResultModel> NodeValueWriteAsync(string endpointId,
                                                         ValueWriteRequestModel request)
 {
     return(_nodes.NodeValueWriteAsync(Endpoint, request));
 }