Thanks, I understand that.

But how could implementation of CtpP.StdControl be delegated to both
Router.StdControl and Estimator.StdControl. What would happen if I call
CtpP.StdControl.start()? Which one would be actually called,
Router.StdControl.start() or Estimator.StdControl.start()?

Another thing I don't understand is the following (red):
In CtpP
configuration CtpP {
  provides {
....
  }

  uses {
....
    interface CollectionDebug;
  }
.......
components new CtpRoutingEngineP(TREE_ROUTING_TABLE_SIZE, 128, 512000) as
Router;

  Router.CollectionDebug = CollectionDebug;


In CtpRoutingEngineP
generic module CtpRoutingEngineP(uint8_t routingTableSize, uint32_t
minInterval, uint32_t maxInterval) {
    provides {
.....
    }
    uses {
.....
        interface CollectionDebug;
.....
    }
}


Why are the left and right side of "=" both using the
interface CollectionDebug? Then who is providing that interface?

Thanks.

On Wed, Feb 17, 2010 at 2:26 PM, Philip Levis <[email protected]> wrote:

>
> On Feb 16, 2010, at 6:55 PM, Xiaohui Liu wrote:
>
> Hello everyone,
>
> I was looking at CTP code and find the following in configuration
> "CtpP.nc":
>
> 127: components LinkEstimatorP as Estimator;
>
> 134: components new CtpRoutingEngineP(TREE_ROUTING_TABLE_SIZE, 128, 512000)
> as Router;
> 135:
> 136: StdControl = Router;
> 137: StdControl = Estimator;
>
>
> What do line 136 and 137 mean? Thanks.
>
>
> It's a shortcut. If the component only has one matching instance of the
> interface, it automatically wires to that instance. So these lines are
> effectively
>
> StdControl = Router.StdControl;
> StdControl = Estimator.StdControl;
>
> I'd suggest reading the TinyOS tutorials and TinyOS programming manual
> (page 56) or the first half of TinyOS Programming (page 45). You can
> download both from docs.tinyos.net.
>
> Phil
>



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

Reply via email to