Example #1
0
 public synchronized void send(Message m) {
   try {
     intf.send(MoteIF.TOS_BCAST_ADDR, m);
   } catch (IOException e) {
     e.printStackTrace();
     System.out.println("ERROR: Can't send message");
     System.exit(1);
   }
 }
Example #2
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();
   }
 }
 private void saveResult(String result) {
   if (outputFile != null) {
     try {
       FileWriter fw = new FileWriter(outputFile, true /* append */);
       PrintWriter pw = new PrintWriter(fw);
       pw.println(result);
       pw.close();
       fw.close();
     } catch (IOException e) {
       e.printStackTrace();
     }
   }
 }