Beispiel #1
0
 void setupDrip(Message msg, int msgSize) {
   trickle = new Timer();
   trickleTask = new DripSender();
   dripMsg = new DripMsg(DripMsg.DEFAULT_MESSAGE_SIZE + msgSize);
   dripMsg.dataSet(msg.dataGet(), 0, dripMsg.offset_data(0), msgSize);
   sendCount = 0;
 }
Beispiel #2
0
  Message buildAddrMsg(int dest, Message msg, int msgSize) {
    AddressMsg addrMsg = new AddressMsg(AddressMsg.DEFAULT_MESSAGE_SIZE + msgSize);
    String moteid = Env.getenv("MOTEID");
    int source = 0xFFFF;

    if (moteid != null) {
      source = Integer.parseInt(moteid);
    }

    addrMsg.dataSet(msg.dataGet(), 0, addrMsg.offset_data(0), msgSize);

    addrMsg.set_dest(dest);
    addrMsg.set_source(source);

    return addrMsg;
  }