/// <summary>
        /// Browse by path
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <BrowsePathResponseApiModel> BrowsePathAsync(
            BrowsePathRequestInternalApiModel request)
        {
            kBrowsePathAsync.Inc();
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }
            var result = await _browse.NodeBrowsePathAsync(
                await _twin.GetEndpointAsync(), request.ToServiceModel());

            return(result.ToApiModel());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Convert back to service model
 /// </summary>
 /// <returns></returns>
 public static BrowsePathRequestModel ToServiceModel(
     this BrowsePathRequestInternalApiModel model)
 {
     if (model == null)
     {
         return(null);
     }
     return(new BrowsePathRequestModel {
         NodeIdsOnly = model.NodeIdsOnly,
         NodeId = model.NodeId,
         BrowsePaths = model.BrowsePaths,
         ReadVariableValues = model.ReadVariableValues,
         Header = model.Header.ToServiceModel()
     });
 }
        /// <summary>
        /// Browse by path
        /// </summary>
        /// <param name="endpoint"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <BrowsePathResponseApiModel> BrowsePathAsync(
            EndpointApiModel endpoint, BrowsePathRequestInternalApiModel request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            var result = await _browse.NodeBrowsePathAsync(
                endpoint.ToServiceModel(), request.ToServiceModel());

            return(result.ToApiModel());
        }