Hi,
Hope that someone could help me with the following:
I would like to do the following:
1- Mote1 sends a packet every 1sec to Mote2
2- I want Mote2 to add some filed to the received packet and then
forwards it directlly to another mote.

I want to know if it is ok to invoke sendNow() from Receive event???
.......................
void sendNow(){
   if (!busy) {
     if (call AMSend.send(0,ptr, sizeof(BlinkToRadioMsg)) == SUCCESS) {
       call Leds.led2Toggle();
       busy = TRUE;
     } }}

event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len){
    message_t *tmp= ptr;
    ptr = msg;
   if (len == sizeof(BlinkToRadioMsg)) {
       BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)payload;
       btrpkt->tnow= call Timer0.getNow();
       sendNow();
      }
       return tmp;
      }
I am not sure about sendNow() inside the receive event! Is it ok to
place it inside the event Receive?
what do you think??
thanks for any help
 Sara
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to