[Tinyos-help] Calculate the number of packets in TOSBase

Xyza Ong xyzacutie at yahoo.com
Wed Feb 14 21:03:25 PST 2007


Hello guys,

I am quite new in TinyOS so I would like to ask a few questions. 
I have a specific application that broadcast packets into the radio.
I have uploaded the application in one mote and TOSbase was uploaded in the base mote.

I used mica2 and mib510 as mote and programming board respectively. I have tested the application using java net.tinyos.tools.Listen and java net.tinyos.sf.SerialForwarder -comm and packets were displayed successfully.

My goal now is to count and display the number of packets transmitted to the receiver mote. I am currently studying TOSbase and my question is, is this radioCount the number of packets received by TOSbase or not?

 event TOS_MsgPtr UARTTokenReceive.receive(TOS_MsgPtr Msg, uint8_t Token) {
    processUartPacket(Msg, TRUE, Token);
    return Msg;
  }

  void processUartPacket(TOS_MsgPtr Msg, bool wantsAck, uint8_t Token) {
    bool reflectToken = FALSE;

    dbg(DBG_USR1, "TOSBase received UART token packet.\n");

    if (radioCount < RADIO_QUEUE_LEN) {
      reflectToken = TRUE;

      memcpy(&radioQueueBufs[radioIn], Msg, sizeof(TOS_Msg));

      radioCount++;
      
      if( ++radioIn >= RADIO_QUEUE_LEN ) radioIn = 0;
      
      if (!radioBusy) {
    if (post RadioSendTask()) {
      radioBusy = TRUE;
    }
      }
    } else {
      dropBlink();
    }

    if (wantsAck && reflectToken) {
      call UARTTokenReceive.ReflectToken(Token);
    }
  }

Or do you have any suggestions where I could count and display on the PC screen the number of packets received or simply the success ratio of the transmission or packet delivery ratio?

Thanks in advance.


Regards,
xyza
 
 	 
---------------------------------
Looking for earth-friendly autos? 
 Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070214/e23f7ec7/attachment.html


More information about the Tinyos-help mailing list