hi,
I am working on a TOSSIM application and trying to broadcast a simple
message to neighbors.
Once nodes get the broadcast message they are supposed to reply back to that
message.

In order to achieve above objective, i first tried to run RadioCountToLeds
in TOSSIM which is very similar to my objective (i followed the tutorial in
http://docs.tinyos.net/index.php/TOSSIM#Injecting_Packets too. but the same
result). As mentioned in
http://docs.tinyos.net/index.php/TOSSIM#Injecting_Packets, i used packets.py
python script too.

Following is my output.

*1       DEBUG (0): RadioCountToLedsC: timer fired, counter is 1.
2       DEBUG (0): RadioCountToLedsC: packet sent.
3       Delivering  Message <RadioCountMsg>
4         [counter=0x7]
5        to 0 at  3073726882
6        DEBUG (0): Received packet of length 2.
7        DEBUG (0): LEDS: Led0 on.
8        DEBUG (0): LEDS: Led1 on.
9        DEBUG (0): LEDS: Led2 on.*

Following is my   MilliTimer.fired() method. By looking at the following
code we know that 1st two lines of my output is from this code and it has
worked well. But, as i feel, the rest of the debugging statements are
printed because of the packet sent by the python script, not because of the
broadcasting message.
can anyone tell me is this the way that it's supposed to work?

why do we send a packet in the python script? is there any special reason?

i want to broadcast messages via nodes themselves. Can i do that with TOSSIM
and witout sending packets in python script?



*event void MilliTimer.fired() {
    counter++;
    dbg("RadioCountToLedsC", "RadioCountToLedsC: timer fired, counter is
%hu.\n", counter);
    if (locked) {
      return;
    }
    else {
      radio_count_msg_t* rcm = (radio_count_msg_t*)call
Packet.getPayload(&packet, NULL);
      if (call Packet.maxPayloadLength() < sizeof(radio_count_msg_t)) {
        return;
      }

      rcm->counter = counter;
      if (call AMSend.send(AM_BROADCAST_ADDR, &packet,
sizeof(radio_count_msg_t)) == SUCCESS) {
        dbg("RadioCountToLedsC", "RadioCountToLedsC: packet sent.\n",
counter);
        locked = TRUE;
      }
    }
  }*



I really appreciate any response. I am stuck at this point.
Thanks in advanced.
Lasanthi
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to