hi everyone;
i am trying to write a tinyos application for my final project. i have problem 
about tasks. i call consecutively two tasks that sends data over rf, in 
ReadyTimer.fired() function, but only the first task runs. The second 
firstHelloTask does not run.
Thanks four your help...
   
task void sendHelloTask()
{
      if(((HelloMsg *)helloMsg.data)-> index < PATHSIZE)
      {
               ((HelloMsg *)helloMsg.data)->path[((HelloMsg *)helloMsg.data)-> 
index] = TOS_LOCAL_ADDRESS;
               ((HelloMsg *)helloMsg.data)-> index++;
              call SendHelloMsg.send(parent, sizeof(HelloMsg), &helloMsg);  
     }
 }
 task void firstHelloTask()
   {
        atomic{
             ((HelloMsg *)helloMsg.data)-> index = 0;
        }
         post sendHelloTask(); 
   }
   
   task void sendCostTask()
 {
      ProjectMsg *costMsgPtr = (ProjectMsg *)sendCostMsg.data;
      atomic 
      {
           costMsgPtr->cost = cost;
           costMsgPtr->action = PARENT_REPLY;
           costMsgPtr->source = TOS_LOCAL_ADDRESS;
      }
       call Send.send(TOS_BCAST_ADDR, sizeof(ProjectMsg), &sendCostMsg);  
 }
   event result_t ReadyTimer.fired()
   {
        post sendCostTask();
        post firstHelloTask();
        call ADCTimer.start(TIMER_REPEAT,1000);
         return SUCCESS;
   }


      ___________________________________________________________ 
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for
your free account today 
http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html 
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to