Exemplo n.º 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>());
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public async Task <ValueWriteResultModel> NodeValueWriteAsync(
            string endpoint, ValueWriteRequestModel request)
        {
            var result = await _client.NodeValueWriteAsync(endpoint,
                                                           Map <ValueWriteRequestApiModel>(request));

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

            return(result.ToServiceModel());
        }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 7
0
 /// <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()
     });
 }
Exemplo n.º 8
0
 /// <inheritdoc/>
 public Task <ValueWriteResultModel> NodeValueWriteAsync(string endpointId,
                                                         ValueWriteRequestModel request)
 {
     return(_nodes.NodeValueWriteAsync(Endpoint, request));
 }