On Oct 22, 2009, at 2:54 PM, Wenjie Zeng wrote:

> Hi:
>
> I've come across a strange missing startDone() problem after I  
> receive SUCCESS after calling  
> CC2420ActiveMessageC.SplitControl.start() to start the radio. This  
> contradicts the documentation which states that the system MUST  
> signal a startDone() if it returns SUCCESS in start(). Then I looked  
> into CC2420CsmaP.nc which is the implementation of CC2420 control  
> and found the following code snippet:
>
>   /***************** SplitControl Commands ****************/
>   command error_t SplitControl.start() {
>     if(call SplitControlState.requestState(S_STARTING) == SUCCESS) {
>       call CC2420Power.startVReg();
>       return SUCCESS;
>
>     } else if(call SplitControlState.isState(S_STARTED)) {
>       return EALREADY;
>
>     } else if(call SplitControlState.isState(S_STARTING)) {
>
>       return SUCCESS;
>     }
>
>     return EBUSY;
>   }
>
> If the control flow falls into the first if statement, a  
> startDone_task() will be posted later on. However, if the radio is  
> somehow already in the state of S_STARTING, as in the third if  
> statement, the system will return SUCCESS without posting the task  
> startDone_task() which will signal the startDone() event. I guess  
> the assumption here is that someone else's earlier call to start()  
> must have triggered startDone_task() to be posted and as a result  
> the callee will still receive startDone(). I guess this assumption  
> is somehow INCORRECT.

That is the assumption. It would be good to know what causes it to be  
incorrect.

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

Reply via email to