public AntiTheftGui() { try { guiInit(); /* Setup communication with the mote and request a messageReceived callback when an AlertMsg is received */ mote = new MoteIF(this); mote.registerListener(new AlertMsg(), this); } catch (Exception e) { e.printStackTrace(); System.exit(2); } }
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); }
private void addMsgType(Message msg) { moteIF.registerListener(msg, this); }