public static void main(String[] args) throws Exception { String source = null; if (args.length == 2) { if (!args[0].equals("-comm")) { usage(); System.exit(1); } source = args[1]; } else if (args.length != 0) { usage(); System.exit(1); } PhoenixSource phoenix; if (source == null) { phoenix = BuildSource.makePhoenix(PrintStreamMessenger.err); } else { phoenix = BuildSource.makePhoenix(source, PrintStreamMessenger.err); } MoteIF mif = new MoteIF(phoenix); TestSerial serial = new TestSerial(mif); serial.sendPackets(); }
public MsgReader(String source) throws Exception { if (source != null) { moteIF = new MoteIF(BuildSource.makePhoenix(source, PrintStreamMessenger.err)); } else { moteIF = new MoteIF(BuildSource.makePhoenix(PrintStreamMessenger.err)); } client = new RestClient(); }
public RadioSignalMeter(String motePort, String outputFile) { this.motePort = motePort; this.outputFile = outputFile; PhoenixSource phoenixLocal = null; if (motePort == null) { phoenixLocal = BuildSource.makePhoenix(PrintStreamMessenger.err); } else { phoenixLocal = BuildSource.makePhoenix(motePort, PrintStreamMessenger.err); } moteIF = new MoteIF(phoenixLocal); moteIF.registerListener(new RadioSignalResultsMsg(), this); }
public static void main(String[] args) throws Exception { String source = ""; if (args.length == 2) { if (!args[0].equals("-comm")) { usage(); System.exit(1); } source = args[1]; } else { usage(); System.exit(1); } PhoenixSource phoenix; if (source == null) { phoenix = BuildSource.makePhoenix(PrintStreamMessenger.err); } else { phoenix = BuildSource.makePhoenix(source, PrintStreamMessenger.err); } System.out.print(phoenix); MoteIF mif = new MoteIF(phoenix); PrintfClient client = new PrintfClient(mif); }