Ejemplo n.º 1
0
        private static void queryDevicesInGroup(IoTDAClient client)
        {
            ShowDevicesInGroupRequest req = new ShowDevicesInGroupRequest
            {
                GroupId    = "ee1c4b7d-6243-4121-addd-a3ff2f8a675c",
                Marker     = "ffffffffffffffffffffffff",
                InstanceId = "1a7ffc5c-d89c-44dd-8265-b1653d951ce0"
            };

            try
            {
                var resp = client.ShowDevicesInGroup(req);
                Console.WriteLine(resp.HttpStatusCode);
                Console.WriteLine(resp.Page);
                foreach (var SimplifyDevice in resp.Devices)
                {
                    Console.WriteLine(JsonConvert.SerializeObject(SimplifyDevice));
                }
            }
            catch (RequestTimeoutException requestTimeoutException)
            {
                Console.WriteLine(requestTimeoutException.ErrorMessage);
            }
            catch (ServiceResponseException clientRequestException)
            {
                Console.WriteLine(clientRequestException.HttpStatusCode);
                Console.WriteLine(clientRequestException.ErrorCode);
                Console.WriteLine(clientRequestException.ErrorMsg);
            }
            catch (ConnectionException connectionException)
            {
                Console.WriteLine(connectionException.ErrorMessage);
            }
        }