[Tinyos-help] Can I use PacketAcknowledgments in TinyOS Testbed ? (It works well in Tossim, but doesn't work in Testbed).

DAE HEE KIM dahkim77 at gmail.com
Sun Feb 3 15:13:22 PST 2008


Hi.

PacketAcknowledgements worked very well in Tossim. However, in motes. it
doesn't work.
Do I have to change some other parameter in order to use
PacketAcknowledgement in motes ?

Following is my snippet that I added PacketAcknowledgements in
BlinkToRadio..

  /***************************
   * Send Packet
   **************************/
  // send data when timer expires
  event void Timer0.fired()
  {
    counter++;

    if (!busy) {

      // create new packet
      BlinkToRadioMsg *btrpkt = (BlinkToRadioMsg*)(call Packet.getPayload(&pkt,
NULL));

      // insert data into packet
      btrpkt->nodeid  = TOS_NODE_ID;
      btrpkt->counter = counter;

      // send packet (broadcast)

      call Acks.requestAck(&pkt);
      if (call AMSend.send(AM_BROADCAST_ADDR, &pkt, sizeof(BlinkToRadioMsg))
== SUCCESS) {
        dbg("BlinkToRadioC","Send %d packet\n", counter);
        busy = TRUE;

        // send success : Blink
        call Leds.led0Toggle();
      }
    }
  }

  // finish sending
  event void AMSend.sendDone(message_t *msg, error_t error) {
    if (&pkt == msg) {
      if (call Acks.wasAcked(msg)) {
        call Leds.led2Toggle();
      }
      else {
        call Leds.led1Toggle();    <-- led1 toggles which means not acked.
      }
      busy = FALSE;
    }
  }

Thanks in advance


-- 
DaeHee Kim (Danny)
Department of Computer Science, State University of NewYork at Binghamton.
Cell Phone : 1-607-321-9574
Address : 13-A Andrea Dr, Vestal, NY, 13850
email-address : dkim11 at binghamton.edu, dahkim77 at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20080203/4f98c145/attachment.html


More information about the Tinyos-help mailing list