public static void main(String[] args) throws Exception
	{
		String source = "serial@/dev/ttyUSB" + args[0] + ":115200";
        //String source = "serial@/tmp/sersock" + ":115200";

		PhoenixSource phoenix;

		if (source == null)
			phoenix = BuildSource.makePhoenix(PrintStreamMessenger.err);
		else
			phoenix = BuildSource.makePhoenix(source, PrintStreamMessenger.err);

        // 192.168.0.163
		PCComm comm = new PCComm(new MoteIF(phoenix), "localhost");

		comm.nodeList = new NodeList(10);
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		while (true) {
			System.out.print(">>>");
			String input = br.readLine();
			String[] inputs = input.split(" ");

			if (inputs[0].equals("discover"))
				comm.do_discover();

			else if (inputs[0].equals("print"))
				comm.do_print();

			else if (inputs[0].equals("setname"))
				comm.do_setname(inputs);

			//else if (inputs[0].equals("setagg"))
			//	comm.do_setagg(inputs);

			else if (inputs[0].equals("send"))
				comm.do_send(inputs);

			else if (inputs[0].equals("train"))
				comm.do_train(inputs);

			//else if (inputs[0].equals("setip"))
			//	comm.do_setip(inputs);

			else if (inputs[0].equals("exit"))
				System.exit(0);

			else if (inputs[0].equals(""))
				continue;

			else
				System.out.println("Command not found");
		}
	}