Exemplo n.º 1
0
 private void send(Message m) {
   try {
     moteIF.send(MoteIF.TOS_BCAST_ADDR, m);
   } catch (IOException e) {
     e.printStackTrace();
     System.out.println("ERROR: Can't send message");
     System.exit(1);
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
Exemplo n.º 2
0
  public Drip(int id) {

    log.info("Started id=" + id);
    try {
      moteIF = new MoteIF();
      moteIF.registerListener(new DripMsg(), this);
    } catch (Exception e) {
      System.out.println("ERROR: Couldn't contact serial forwarder.");
      System.exit(1);
    }

    this.id = id;
  }
Exemplo n.º 3
0
  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);
  }
Exemplo n.º 4
0
 public DrainConnector(int p_spAddr, MoteIF p_moteIF) {
   spAddr = p_spAddr;
   moteIF = p_moteIF;
   moteIF.registerListener(new DrainMsg(), this);
   log.info("Started myAddr = " + spAddr + ", listening for DrainMsg");
 }
Exemplo n.º 5
0
 private void addMsgType(Message msg) {
   moteIF.registerListener(msg, this);
 }