/* * ImondConnectionTest.cs - Test program for ImoncLib.ImondConnection * * Copyright (c) 2012 - Christian Schwinn - christianschwinn@quadrant1.net * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ using System; using System.Collections.Generic; using System.Text; using ImoncLib; namespace ImoncLibTest { class ImondConnectionTest { static void Main(string[] args) { ImondConnection ic = new ImondConnection(); int nrOfCircuits = ic.connectWithoutPassword("192.168.6.1", 5000); Console.WriteLine("Available Circuits:"); for (int i = 0; i < nrOfCircuits; i++) { Console.WriteLine(ic.getCircuitName(i)); } while (ic.isConnected) { string[] downAndUpRate = ic.getDownAndUpRate(0, "|").Split('|'); string ip = ic.getIPAddress(0); string onlineTime = ic.getOnlineTime(0); int cpuLoad = ic.getCPULoad(); string upTime = ic.getUpTime(); Console.WriteLine("down: " + downAndUpRate[0] + " | up: " + downAndUpRate[1] + " | online: " + onlineTime + " | ip: " + ip + " | cpu: " + cpuLoad + "% | uptime: " + upTime); System.Threading.Thread.Sleep(1500); } } } }