ranal fernando | 12 Jun 2012 22:25

understanding wiring in BlockingAMSenderP

Dear all,

Thanks a bunch for all the help you have given me earlier.


Now i have come up with a new problem. :) I was going through BlockingAMSender interface in tosthreads. I'm not able to understand how wiring is done for AMSend in tosthreads. Here is the problem...


BlockingAMSenderImplP uses AMSend.

generic module BlockingAMSenderImplP() {
provides {
interface Init;
interface BlockingAMSend[am_id_t id];
}
uses {
interface SystemCall;
interface Mutex;
interface AMSend[am_id_t id];
interface Packet;
interface Leds;
}
}



& the corresponding configuration file for BlockingAMSenderImplP is BlockingAMSenderP which is as follows.


configuration BlockingAMSenderP {
provides {
interface BlockingAMSend[am_id_t amId];
}
uses {
interface AMSend[am_id_t amId];
}
}

implementation {
components MainC;
components ActiveMessageC as AM;
components new BlockingAMSenderImplP();
components MutexC;
components SystemCallC;
components LedsC;

MainC.SoftwareInit -> BlockingAMSenderImplP;

BlockingAMSend = BlockingAMSenderImplP;
AMSend = BlockingAMSenderImplP;
BlockingAMSenderImplP.Mutex -> MutexC;
BlockingAMSenderImplP.SystemCall -> SystemCallC;
BlockingAMSenderImplP.Packet -> AM;
BlockingAMSenderImplP.Leds -> LedsC;
}

I understand BlockingAMSend= BlockingAMSenderImplP , if i'm not wrong both (BlockingAMSenderImplP and BlockingAMSenderP) provide BlockingAMSend interface. But AMSend on the other hand is used by both BlockingAMSenderImplP and BlockingAMSenderP. But who is providing it?

i would be thankful if you can help me understand this.

ranal
<div><div dir="ltr">

<div dir="ltr">Dear all,<div><br></div>
<div>Thanks a bunch for all the help you have given me earlier.</div>
<div><br></div>
<div><br></div>
<div>Now i have come up with a new problem. :) I was going through BlockingAMSender interface in tosthreads. I'm not able to understand how wiring is done for AMSend in tosthreads. Here is the problem...</div>
<div><br></div>
<div><br></div>
<div>BlockingAMSenderImplP uses AMSend.</div>
<div><br></div>
<div>
<table>
<tr><td class="source">generic module BlockingAMSenderImplP() {<br>
</td></tr>
<tr><td class="source">  provides {<br>
</td></tr>
<tr><td class="source">    interface Init;<br>
</td></tr>
<tr><td class="source">    interface BlockingAMSend[am_id_t id];<br>
</td></tr>
<tr><td class="source">  }<br>
</td></tr>
<tr><td class="source">  uses {<br>
</td></tr>
<tr><td class="source">    interface SystemCall;<br>
</td></tr>
<tr><td class="source">    interface Mutex;<br>
</td></tr>
<tr><td class="source">    interface AMSend[am_id_t id];<br>
</td></tr>
<tr><td class="source">    interface Packet;<br>
</td></tr>
<tr><td class="source">    interface Leds;<br>
</td></tr>
<tr><td class="source">  }<br>
</td></tr>
<tr><td class="source">}</td></tr>
</table>
<br>
</div>
<div><br></div>
<div><br></div>
<div>&amp; the corresponding configuration file for BlockingAMSenderImplP is BlockingAMSenderP which is as follows.</div>
<div><br></div>
<div><br></div>
<div>
<table>
<tr><td class="source">configuration BlockingAMSenderP {<br>
</td></tr>
<tr><td class="source">  provides {<br>
</td></tr>
<tr><td class="source">    interface BlockingAMSend[am_id_t amId];<br>
</td></tr>
<tr><td class="source">  }<br>
</td></tr>
<tr><td class="source">  uses {<br>
</td></tr>
<tr><td class="source">    interface AMSend[am_id_t amId];<br>
</td></tr>
<tr><td class="source">  }<br>
</td></tr>
<tr><td class="source">}<br>
</td></tr>
<tr><td class="source"><br></td></tr>
<tr><td class="source">implementation {<br>
</td></tr>
<tr><td class="source">  components MainC;<br>
</td></tr>
<tr><td class="source">  components ActiveMessageC as AM;<br>
</td></tr>
<tr><td class="source">  components new BlockingAMSenderImplP();<br>
</td></tr>
<tr><td class="source">  components MutexC;<br>
</td></tr>
<tr><td class="source">  components SystemCallC;<br>
</td></tr>
<tr><td class="source">  components LedsC;<br>
</td></tr>
<tr><td class="source">  <br>
</td></tr>
<tr><td class="source">  MainC.SoftwareInit -&gt; BlockingAMSenderImplP;<br>
</td></tr>
<tr><td class="source">  <br>
</td></tr>
<tr><td class="source">  BlockingAMSend = BlockingAMSenderImplP;<br>
</td></tr>
<tr><td class="source">  AMSend = BlockingAMSenderImplP;<br>
</td></tr>
<tr><td class="source">  BlockingAMSenderImplP.Mutex -&gt; MutexC;<br>
</td></tr>
<tr><td class="source">  BlockingAMSenderImplP.SystemCall -&gt; SystemCallC;<br>
</td></tr>
<tr><td class="source">  BlockingAMSenderImplP.Packet -&gt; AM;<br>
</td></tr>
<tr><td class="source">  BlockingAMSenderImplP.Leds -&gt; LedsC;<br>
</td></tr>
<tr><td class="source">}

</td></tr>
</table>
<br>
</div>
<div>I understand BlockingAMSend=&nbsp;<span>BlockingAMSenderImplP , if i'm not wrong both (</span><span>BlockingAMSenderImplP and BlockingAMSenderP)&nbsp;</span><span>provide BlockingAMSend interface. But AMSend on the other hand is used by both&nbsp;</span><span>BlockingAMSenderImplP and BlockingAMSenderP. But who is providing it?</span>
</div>
<div><span><br></span></div>
<div><span>i would be thankful if you can help me understand this.</span></div>
<div><span><br></span></div>
<div><span>ranal</span></div>
</div>
 		 	   		  </div></div>

Gmane