Ejemplo n.º 1
0
        private async Task <bool> CreatePointAsync(string webID, string pointName)
        {
            var jsonObject = new
            {
                Name       = pointName,
                PointClass = "classic",
                PointType  = "Float32"
            };
            string jsonString = JsonConvert.SerializeObject(jsonObject);

            HttpResponseMessage responseCreatePoint = await _piWebClient.CreatePoint(webID, jsonString);

            if (responseCreatePoint.StatusCode == HttpStatusCode.Created || responseCreatePoint.Content.ToString().Contains("-10550"))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }