Dear TinyOS developers,

I followed the AntiTheft and TestCollection examples provided by TinyOS 2.0.1 to create my own application.

I have a timer, which triggers the following registration function in some intervals. I have verified that the code basic triggering is working. however, when I added the sending codes, the error led is toggled at every timer fired. so it does mean the send command didn't return SUCCESS.

void registration()
 {
   if(regCount > 0)
     {
       if(!sendbusy)
       {
          /* send out registration */
sensdata_t *regData = (sensdata_t*)call SensDataRoot.getPayload(&sensdataMsg);
          regData->nodeid = TOS_NODE_ID;
          regData->count = regCount;
if(call SensDataRoot.send(&sensdataMsg, sizeof(sensdata)) != SUCCESS)
               errorLed();
          else
          {
               sendbusy = TRUE;
               regCount--;
          }
       }
     }
   else
     {
       call Leds.led2On();
       /* goto sleep mode */
       op_commands.operate = OP_MODE_SLEEP;
       op_commands.op_interval = SLEEP_INTERVAL;
       startTimer();
     }


the Configuration part, where COL_SENSDATA=11:

 /* Collection */
 components CollectionC;
 NRCMSNodeC.CollectionControl -> CollectionC;

 components new CollectionSenderC(COL_SENSDATA) as SensDataSender;
 NRCMSNodeC.SensDataRoot -> SensDataSender;

My deployment platform is Ubuntu + TinyOS 2.x (ubuntu package).

any idea?

--
regards;

Peizhao

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to