亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? resource arbitration and power management - tinyos documentation wiki.htm

?? 從官方網站上下載tinyos2.0的學習指南
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
href="http://docs.tinyos.net/index.php/Image:Shared_resource_graph.png"><IMG 
height=277 
alt="This is a picture of how a shared resource works together with an arbiter and a power manager" 
src="Resource Arbitration and Power Management - TinyOS Documentation Wiki.files/450px-Shared_resource_graph.png" 
width=450 border=0></A><BR>Figure 2: Shared Resource Configuration </CENTER>
<P>From this figure, we see that the only interfaces exposed to a client through 
the shared resource abstraction are the <TT>Resource</TT> and 
<TT>ResourceRequested</TT> interfaces provided by the arbiter as well as any 
resource specific interfaces provided by the resource itself. It also uses a 
<TT>ResourceConfigure</TT> interface, expecting it to be implemented on a client 
by client basis depending on their requirements. A client requests access to a 
shared resource through the <TT>Resource</TT> interface and runs operations on 
it using whatever resource specific interfaces are provided. A client may choose 
to wire itself to the <TT>ResourceRequested</TT> interface if it wishes to hold 
onto a resource indefinitely and be informed whenever other clients request its 
use. </P>
<P>The rest of this tutorial is dedicated to teaching users how to use shared 
resources and show them how wiring is done between all components that make them 
up. </P>
<P>Specifically, this tutorial will teach users how to: </P>
<OL>
  <LI>Wire in a shared resource for use by a client. 
  <LI>Use the <TT>Resource</TT> interface to gain access to a shared resource. 
  <LI>Change the arbitration policy used by a particular shared resource. 
  <LI>Wire up a power manager for use by a shared resource. </LI></OL><A 
name=Working_with_Shared_Resources></A>
<H1><SPAN class=mw-headline>Working with Shared Resources</SPAN></H1>
<P>This section shows you how to gain access to and use shared resources in 
TinyOS. It walks through the process of making a request through the 
<CODE>Resource</CODE> interface and handling the <TT>granted</TT> event that is 
signaled back. We will connect multiple clients to a single shared resources and 
see how access to each of them gets arbitrated. We also show how to hold onto a 
resource until another client has requested it by implementing the 
<TT>ResourceRequested</TT> interface. </P>
<P>To begin, go to the <TT>tinyos-2.x/apps/tutorials/SharedResourceDemo</TT> 
directory and install this application on a mote. After installing the 
application you should see three leds flashing in sequence. </P>
<P>Let's take a look at the different components contained in this directory to 
see whats going on. Start with the top level application component: 
<CODE>SharedResourceDemoAppC</CODE> </P><PRE>configuration SharedResourceDemoAppC{
}
implementation {
  components MainC,LedsC, SharedResourceDemoC as App,
  new TimerMilliC() as Timer0,
  new TimerMilliC() as Timer1,
  new TimerMilliC() as Timer2;
  App -&gt; MainC.Boot;
  App.Leds -&gt; LedsC;
  App.Timer0 -&gt; Timer0;
  App.Timer1 -&gt; Timer1;
  App.Timer2 -&gt; Timer2;
  
  components
  new SharedResourceC() as SharedResource0,
  new SharedResourceC() as SharedResource1, 
  new SharedResourceC() as SharedResource2;
  App.Resource0 -&gt; SharedResource0;
  App.Resource1 -&gt; SharedResource1;
  App.Resource2 -&gt; SharedResource2;
  App.ResourceOperations0 -&gt; SharedResource0;
  App.ResourceOperations1 -&gt; SharedResource1;
  App.ResourceOperations2 -&gt; SharedResource2;
}
</PRE>
<P>Other than the instantiation and wiring of the interfaces provided by the 
<CODE>SharedResourceC</CODE> component, this configuration is identical to the 
one presented in Lesson 1 for the Blink Application. </P>
<P>All shared resources in TinyOS are provided through a generic component 
similar to the <CODE>SharedResourceC</CODE> component. A resource client simply 
instantiates a new instance of this component and wires to the interfaces it 
provides. In this application, three instances of the 
<CODE>SharedResourceC</CODE> component are instantiated and wired to three 
different clients from the <CODE>SharedResourceDemoC</CODE> component. Each 
instantiation provides a <TT>Resource</TT>, <TT>ResourceOperations</TT>, and 
<TT>ResourceRequested</TT> interface, and uses a <TT>ResourceConfgigure</TT> 
interface. In this example, no wiring is done to the <TT>ResourceConfigure</TT> 
or <TT>ResourceRequested</TT> interface as wiring to to these interfaces is 
optional. The <TT>ResourceOperations</TT> interface is an <B>EXAMPLE</B> of a 
resource specific interface that a resource may provide to perform operations on 
it. Calls to commands through this interface will only succeed if the client 
calling them happens to have access to the resource when they are called. </P>
<P>Let's take a look at the <CODE>SharedResourceDemoC</CODE> to see how access 
is actually granted to a Resource. </P><PRE>module SharedResourceDemoC {
  uses {
    interface Boot;  
    interface Leds;
    interface Timer as Timer0;
    interface Timer as Timer1;
    interface Timer as Timer2;
    
    interface Resource as Resource0;
    interface ResourceOperations as ResourceOperations0;
    
    interface Resource as Resource1;
    interface ResourceOperations as ResourceOperations1;
    
    interface Resource as Resource2;
    interface ResourceOperations as ResourceOperations2;
  }
}
</PRE>
<P>Each pair of <CODE>Resource/ResourceOperations</CODE> interfaces reperesents 
a different client of the shared resource used by this application. At boot 
time, we put in a request for the shared resource through each of these clients 
in the order (0,2,1). </P><PRE>event void Boot.booted() {
  call Resource0.request();
  call Resource2.request();
  call Resource1.request();
}
</PRE>
<P>Each of these requests is serviced in the order of the arbitration policy 
used by the shared resource. In the case of <CODE>SharedResourceC</CODE>, a 
Round-Robin policy is used, so these requests are serviced in the order (0,1,2). 
If a first-come-first-serve policy were in use, they would we be serviced in the 
order the were put in, i.e. (0,2,1). </P>
<P>Whenever a client's request for a resource has been granted, the 
<CODE>Resource.granted()</CODE> event for that client gets signaled. In this 
application, the body of the granted event for each client simply performs an 
operation on the resource as provided through the 
<CODE>ResourceOperations</CODE> interface. </P><PRE>event void Resource0.granted() {
  call ResourceOperations0.operation();   
}  
event void Resource1.granted() {
  call ResourceOperations1.operation();
}  
event void Resource2.granted() {
  call ResourceOperations2.operation();
} 
</PRE>
<P>Whenever one of these operations completes, a 
<CODE>ResourceOperations.operationDone()</CODE> event is signaled. Once this 
event is received by each client, a timer is started to hold onto the resource 
for 250 (binary) ms and an LED corresponding to that client is toggled. </P><PRE> #define HOLD_PERIOD 250
 
 event void ResourceOperations0.operationDone(error_t error) {
   call Timer0.startOneShot(HOLD_PERIOD);  
   call Leds.led0Toggle();
 }
 event void ResourceOperations1.operationDone(error_t error) {
   call Timer1.startOneShot(HOLD_PERIOD);  
   call Leds.led1Toggle();
 }
 event void ResourceOperations2.operationDone(error_t error) {
   call Timer2.startOneShot(HOLD_PERIOD);  
   call Leds.led2Toggle();
 }
 
</PRE>
<P>Whenever one of these timers goes off, the client that started it releases 
the resource and immediately puts in a request for it again. </P><PRE>event void Timer0.fired() {
  call Resource0.release();
  call Resource0.request();
}
event void Timer1.fired() {
  call Resource1.release();
  call Resource1.request();
}
event void Timer2.fired() {
  call Resource2.release();
  call Resource2.request();
}
</PRE>
<P>In this way, requests are continuously put in by each client, allowing the 
application to continuously flash the LEDs in the order in which requests are 
being serviced. As stated before, the <CODE>SharedResourceC</CODE> component 
services these requests in a round-robin fashion. If you would like to see the 
requests serviced in the order they are received (and see the LEDs flash 
accordingly), you can open up the <CODE>SharedResourceP</CODE> component in the 
<TT>apps/tutorials/SharedResourceDemo</TT> directory and replace the 
<CODE>RoundRobinArbiter</CODE> component with the <CODE>FcfsArbiter</CODE> 
component. </P>
<TABLE>
  <TBODY>
  <TR>
    <TD><B>RoundRobinArbiter</B> </TD>
    <TD><B>FcfsArbiter</B> </TD></TR>
  <TR>
    <TD><PRE>configuration SharedResourceP {
	provides interface Resource[uint8_t id];
	provides interface ResourceRequested[uint8_t id];
	provides interface ResourceOperations[uint8_t id];
	uses interface ResourceConfigure[uint8_t id];
}
implementation {
  components new RoundRobinArbiterC(UQ_SHARED_RESOURCE) as Arbiter;
  ...
  ...
}
</PRE></TD>
    <TD><PRE>configuration SharedResourceP {
	provides interface Resource[uint8_t id];
	provides interface ResourceRequested[uint8_t id];
	provides interface ResourceOperations[uint8_t id];
	uses interface ResourceConfigure[uint8_t id];
}
implementation {
  components new FcfsArbiterC(UQ_SHARED_RESOURCE) as Arbiter;
  ...
  ...
}
</PRE></TD></TR></TBODY></TABLE>
<P>Looking through the rest of this component, you can see how its wiring 
matches the connections shown in Figure 2. </P><PRE> #define UQ_SHARED_RESOURCE   "Shared.Resource"
 configuration SharedResourceP {
 	provides interface Resource[uint8_t id];
 	provides interface ResourceRequested[uint8_t id];
 	provides interface ResourceOperations[uint8_t id];
 	uses interface ResourceConfigure[uint8_t id];
 }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人免费xxxxxxxx| 国产精品你懂的在线欣赏| 99久久久久久| 成人免费高清在线| 国产suv精品一区二区6| 国产成人综合亚洲网站| 国产福利一区二区三区在线视频| 精品在线播放免费| 国产一区二区三区久久悠悠色av| 韩国精品主播一区二区在线观看| 男人的j进女人的j一区| 久久国内精品自在自线400部| 久久99精品国产麻豆婷婷洗澡| 免费高清在线一区| 国产精品综合av一区二区国产馆| 国产99久久久国产精品| av毛片久久久久**hd| 91首页免费视频| 欧美日韩国产片| 日韩一区国产二区欧美三区| 久久影院午夜论| 日韩毛片视频在线看| 一区二区三区日本| 亚洲第一在线综合网站| 日日欢夜夜爽一区| 国产剧情一区二区| 99久久亚洲一区二区三区青草| 色成人在线视频| 日韩视频在线永久播放| 国产拍揄自揄精品视频麻豆| 一片黄亚洲嫩模| 麻豆久久久久久| 一本一本大道香蕉久在线精品| 欧美久久高跟鞋激| 国产三级精品三级| 亚洲电影第三页| 成人午夜私人影院| 欧美久久一区二区| 中文字幕免费不卡| 日韩专区中文字幕一区二区| 成人毛片在线观看| 91精品福利在线一区二区三区| 亚洲国产精品成人综合 | 久久99精品国产麻豆婷婷| 福利一区二区在线| 91精品婷婷国产综合久久竹菊| 国产色一区二区| 日本aⅴ亚洲精品中文乱码| 国产成人自拍高清视频在线免费播放| 色悠悠久久综合| 久久嫩草精品久久久久| 亚洲午夜私人影院| 91污在线观看| 日本一区二区在线不卡| 日本vs亚洲vs韩国一区三区二区 | 精品在线一区二区| 欧美日韩亚洲国产综合| 中文字幕制服丝袜成人av| 激情五月婷婷综合网| 在线成人小视频| 亚洲欧美一区二区视频| 粉嫩在线一区二区三区视频| 日韩视频免费观看高清完整版| 亚洲图片一区二区| 色综合久久88色综合天天6| 欧美激情综合五月色丁香| 狠狠色伊人亚洲综合成人| 欧美一区三区二区| 午夜日韩在线观看| 欧美亚洲尤物久久| 亚洲精品欧美在线| 色婷婷一区二区三区四区| 日韩一区日韩二区| 波多野结衣中文一区| 国产精品嫩草影院com| 成人h动漫精品一区二区| 国产欧美日韩综合精品一区二区 | 国产精品久久福利| 国产69精品久久777的优势| 久久综合资源网| 国产91精品在线观看| 国产欧美日韩在线观看| 成人动漫在线一区| 一区二区中文字幕在线| 99精品在线观看视频| 伊人色综合久久天天人手人婷| 在线一区二区三区做爰视频网站| 一区二区久久久| 欧美精品电影在线播放| 韩国午夜理伦三级不卡影院| 久久久影视传媒| 91首页免费视频| 偷偷要91色婷婷| 精品国产sm最大网站| 国产v日产∨综合v精品视频| 中文字幕色av一区二区三区| 欧美伊人久久久久久久久影院 | 国产香蕉久久精品综合网| 国产a级毛片一区| ...xxx性欧美| 91.成人天堂一区| 国产一区二区三区黄视频| 亚洲欧洲日产国码二区| 欧美人牲a欧美精品| 国产精品一区一区三区| 一区二区三区精品视频| 日韩欧美一级在线播放| 成人av免费在线播放| 亚洲bt欧美bt精品| 久久久亚洲国产美女国产盗摄| 94-欧美-setu| 麻豆成人久久精品二区三区红| 国产欧美日本一区二区三区| 欧美亚洲国产怡红院影院| 国产精品自拍毛片| 亚洲制服丝袜av| 国产午夜精品理论片a级大结局 | 26uuu国产在线精品一区二区| 99久久国产综合精品女不卡| 奇米色777欧美一区二区| 国产精品美女久久久久久久| 欧美日韩一区二区在线观看视频| 国产高清在线精品| 首页国产欧美久久| 亚洲视频香蕉人妖| 久久这里都是精品| 4438成人网| 91高清在线观看| 成人av片在线观看| 国产毛片一区二区| 日本在线不卡视频一二三区| 亚洲日本va午夜在线电影| 欧美不卡一区二区| 欧美日韩国产精品自在自线| 成人av电影在线| 国产精品888| 精品影视av免费| 青青草成人在线观看| 亚洲一区二区三区中文字幕 | 中文字幕在线免费不卡| 欧美草草影院在线视频| 欧美日韩不卡在线| 欧美色图在线观看| 色综合天天性综合| 91香蕉视频黄| 91免费版pro下载短视频| 国产成人免费视| 福利一区在线观看| 国产电影精品久久禁18| 国产一区二区三区蝌蚪| 国模冰冰炮一区二区| 久久精品国产亚洲5555| 日日欢夜夜爽一区| 日本午夜一本久久久综合| 日韩国产欧美在线观看| 亚洲高清三级视频| 香蕉久久夜色精品国产使用方法| 一区av在线播放| 午夜视频一区在线观看| 日本特黄久久久高潮| 免费成人av资源网| 久久99精品久久只有精品| 精品制服美女久久| 国产精一品亚洲二区在线视频| 国内精品国产三级国产a久久| 韩国精品免费视频| 大桥未久av一区二区三区中文| 成人午夜免费av| 91社区在线播放| 欧美日韩精品一区二区三区蜜桃 | 9l国产精品久久久久麻豆| jiyouzz国产精品久久| 色中色一区二区| 欧美一区二区久久久| 久久免费精品国产久精品久久久久| 久久久不卡网国产精品一区| 国产精品国产三级国产普通话99| 亚洲色图制服诱惑| 午夜激情综合网| 久久精品国产精品亚洲精品| 国产精品一色哟哟哟| 97久久超碰国产精品| 欧美军同video69gay| 久久精品网站免费观看| 成人欧美一区二区三区黑人麻豆 | 亚洲天堂2016| 日本不卡一二三| 国产高清一区日本| 欧美视频在线观看一区| 精品粉嫩超白一线天av| 中文字幕在线观看一区| 日本亚洲视频在线| 99久久免费精品高清特色大片| 在线播放/欧美激情| 国产精品午夜免费| 日本在线不卡视频| 色偷偷成人一区二区三区91| wwww国产精品欧美| 五月激情六月综合| 99视频精品在线|