예제 #1
0
        public static void ShowAsyncConnection()
        {
            Console.WriteLine("Getting the async connections...");

            try {
                var devList    = connectSvc.GetDeviceList();
                var asyncConns = new List <DeviceInfo>();

                for (int i = 0; i < devList.Count; i++)
                {
                    if (devList[i].AutoReconnect)
                    {
                        asyncConns.Add(devList[i]);
                    }
                }

                Console.WriteLine();
                Console.WriteLine("***** Async Connections: {0}", asyncConns.Count);
                for (int i = 0; i < asyncConns.Count; i++)
                {
                    Console.WriteLine(asyncConns[i]);
                }

                Console.WriteLine();
            } catch (Exception e) {
                Console.WriteLine("Cannot get the async connections: {0}", e);
            }
        }
예제 #2
0
        public uint TestConnect()
        {
            var devList = connectSvc.GetDeviceList();

            Console.WriteLine("Device list before connection: {0}" + Environment.NewLine, devList);

            var connectInfo = new ConnectInfo {
                IPAddr = DEVICE_ADDR, Port = DEVICE_PORT, UseSSL = USE_SSL
            };
            var devID = connectSvc.Connect(connectInfo);

            devList = connectSvc.GetDeviceList();

            Console.WriteLine("Device list after connection: {0}" + Environment.NewLine, devList);

            return(devID);
        }
예제 #3
0
        public static int GetDeviceList()
        {
            Console.WriteLine("Getting the devices managed by the gateway...");

            try {
                var devList = connectSvc.GetDeviceList();

                Console.WriteLine();
                Console.WriteLine("***** Managed Devices: {0}", devList.Count);
                for (int i = 0; i < devList.Count; i++)
                {
                    Console.WriteLine(devList[i]);
                }

                Console.WriteLine();

                return(devList.Count);
            } catch (Exception e) {
                Console.WriteLine("Cannot get device list: {0}", e);
                return(0);
            }
        }