[Tinyos-help] [TinyOS-2.x] CollectionSenderC.send() command is not working

Peizhao Hu peizhao at itee.uq.edu.au
Sat Jun 9 00:07:59 PDT 2007


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



More information about the Tinyos-help mailing list