📄 getting started with tinyos - tinyos documentation wiki.htm
字号:
generated documentation for Blink on the telosb platform, you'll see
documentation for interfaces such as Boot, Leds, and Timer, as well as some from
the underlying hardware implementations, such as Msp430TimerEvent and
HplMsp430GeneralIO. </P>
<P>In the navigation panel on the left, components are below interfaces. Click
on BlinkAppC, and you should a figure like this: </P>
<CENTER><A class=image title=Image:BlinkAppC.gif
href="http://docs.tinyos.net/index.php/Image:BlinkAppC.gif"><IMG height=181
alt=Image:BlinkAppC.gif
src="Getting Started with TinyOS - TinyOS Documentation Wiki.files/BlinkAppC.gif"
width=616 border=0></A></CENTER>
<P>In nesdoc diagrams, a single box is a module and a double box is a
configuration. Dashed border lines denote that a component is a generic: </P>
<CENTER>
<TABLE cellPadding=6 border=1>
<TBODY>
<TR>
<TD></TD>
<TD><B>Singleton</B> </TD>
<TD><B>Generic</B> </TD></TR>
<TR>
<TD>Module </TD>
<TD>
<P><A class=image title=Image:singleton-module.gif
href="http://docs.tinyos.net/index.php/Image:Singleton-module.gif"><IMG
height=58 alt=Image:singleton-module.gif
src="Getting Started with TinyOS - TinyOS Documentation Wiki.files/Singleton-module.gif"
width=85 border=0></A> </P></TD>
<TD>
<P><A class=image title=Image:generic-module.gif
href="http://docs.tinyos.net/index.php/Image:Generic-module.gif"><IMG
height=62 alt=Image:generic-module.gif
src="Getting Started with TinyOS - TinyOS Documentation Wiki.files/Generic-module.gif"
width=150 border=0></A> </P></TD></TR>
<TR>
<TD>Configuration </TD>
<TD>
<P><A class=image title=Image:singleton-configuration.gif
href="http://docs.tinyos.net/index.php/Image:Singleton-configuration.gif"><IMG
height=67 alt=Image:singleton-configuration.gif
src="Getting Started with TinyOS - TinyOS Documentation Wiki.files/Singleton-configuration.gif"
width=93 border=0></A> </P></TD>
<TD>
<P><A class=image title=Image:generic-configuration.gif
href="http://docs.tinyos.net/index.php/Image:Generic-configuration.gif"><IMG
height=67 alt=Image:generic-configuration.gif
src="Getting Started with TinyOS - TinyOS Documentation Wiki.files/Generic-configuration.gif"
width=125 border=0></A> </P></TD></TR></TBODY></TABLE></CENTER>
<P>Lines denote wirings, and shaded ovals denote interfaces that a component
provides or uses. You can click on the components in the graph to examine their
internals. Click on MainC, which shows the wirings for the boot sequence: </P>
<CENTER><A class=image title=Image:tos.system.MainC.gif
href="http://docs.tinyos.net/index.php/Image:Tos.system.MainC.gif"><IMG
height=293 alt=Image:tos.system.MainC.gif
src="Getting Started with TinyOS - TinyOS Documentation Wiki.files/Tos.system.MainC.gif"
width=411 border=0></A></CENTER>
<P>Shaded ovals denote wireable interfaces. Because MainC provides the Boot
interface and uses the Init (as SoftwareInit) interface, it has two shaded
ovals. Note the direction of the arrows: because it uses SoftwareInit, the wire
goes out from RealMainP to SoftwareInit, while because it provides Boot, the
wire goes from Boot into RealMainP. The details of MainC aren't too important
here, and we'll be looking at it in greater depth in <A
title="Mote-mote radio communication"
href="http://docs.tinyos.net/index.php/Mote-mote_radio_communication">lesson
3</A> (you can also read <A class="external text"
title=http://www.tinyos.net/tinyos-2.x/doc/html/tep107.html
href="http://www.tinyos.net/tinyos-2.x/doc/html/tep107.html" rel=nofollow>TEP
107</A> for details), but looking at the components you can get a sense of what
it does: it controls the scheduler, initializes the hardware platform, and
initializes software components. </P><A name=Conclusion></A>
<H1><SPAN class=mw-headline>Conclusion</SPAN></H1>
<P>This lesson has introduced the concepts of the TinyOS component model:
configurations, modules, interfaces and wiring. It showed how applications are
built by wiring components together. The next lesson continues with Blink,
looking more closely at modules, including the TinyOS concurrency model and
executable code. </P><A name=Related_Documentation></A>
<H1><SPAN class=mw-headline>Related Documentation</SPAN></H1>
<UL>
<LI>mica mote Getting Started Guide at <A class="external text"
title=http://www.xbow.com href="http://www.xbow.com/"
rel=nofollow>Crossbow</A>
<LI>telos mote Getting Started Guide for <A class="external text"
title=http://www.moteiv.com href="http://www.moteiv.com/"
rel=nofollow>Moteiv</A>
<LI><A class="external text" title=https://sourceforge.net/projects/nescc
href="https://sourceforge.net/projects/nescc" rel=nofollow>nesc at
sourceforge</A>
<LI><A class="external text"
title=http://nescc.sourceforge.net/papers/nesc-ref.pdf
href="http://nescc.sourceforge.net/papers/nesc-ref.pdf" rel=nofollow>nesC
reference manual</A>
<LI><A class="external text"
title=http://csl.stanford.edu/~pal/pubs/tinyos-programming-1-0.pdf
href="http://csl.stanford.edu/~pal/pubs/tinyos-programming-1-0.pdf"
rel=nofollow>TinyOS Programming Guide</A>
<LI><A class="external text"
title=http://www.tinyos.net/tinyos-2.x/doc/html/tep3.html
href="http://www.tinyos.net/tinyos-2.x/doc/html/tep3.html" rel=nofollow>TEP 3:
TinyOS Coding Conventions</A>
<LI><A class="external text"
title=http://www.tinyos.net/tinyos-2.x/doc/html/tep102.html
href="http://www.tinyos.net/tinyos-2.x/doc/html/tep102.html" rel=nofollow>TEP
102: Timers</A>
<LI><A class="external text"
title=http://www.tinyos.net/tinyos-2.x/doc/html/tep106.html
href="http://www.tinyos.net/tinyos-2.x/doc/html/tep106.html" rel=nofollow>TEP
106: Schedulers and Tasks</A>
<LI><A class="external text"
title=http://www.tinyos.net/tinyos-2.x/doc/html/tep107.html
href="http://www.tinyos.net/tinyos-2.x/doc/html/tep107.html" rel=nofollow>TEP
106: TinyOS 2.x Boot Sequence</A> </LI></UL>
<HR>
<OL class=references>
<LI id=_note-timermillic_footnote><A title=""
href="http://docs.tinyos.net/index.php/Getting_Started_with_TinyOS#_ref-timermillic_footnote_0">↑</A>
The TimerMilliC component is a <I>generic component</I> which means that,
unlike non-generic components, it can be instantiated more than once. Generic
components can take types and constants as arguments, though in this case
TimerMilliC takes none. There are also <I>generic interafces</I>, which take
type arguments only. The Timer interface provided by TimerMilliC is a generic
interface; its type argument defines the timer's required precision (this
prevents programmer from wiring, e.g., microsecond timer users to millisecond
timer providers). A full explanation of generic components is outside this
document's scope, but you can read about them in the nesc generic component
documentation.
<LI id=_note-hint10><A title=""
href="http://docs.tinyos.net/index.php/Getting_Started_with_TinyOS#_ref-hint10_0">↑</A>
<B>Programming Hint 10:</B> Use the <I>as</I> keyword liberally. From <A
class="external text"
title=http://csl.stanford.edu/~pal/pubs/tinyos-programming-1-0.pdf
href="http://csl.stanford.edu/~pal/pubs/tinyos-programming-1-0.pdf"
rel=nofollow><I>TinyOS Programming</I></A></LI></OL>
<HR>
<CENTER>
<P>< <A title="Getting Started with TinyOS"
href="http://docs.tinyos.net/index.php/Getting_Started_with_TinyOS#Introduction">Top</A>
| <A title="Modules and the TinyOS Execution Model"
href="http://docs.tinyos.net/index.php/Modules_and_the_TinyOS_Execution_Model">Next
Lesson</A> > </P></CENTER><!-- Saved in parser cache with key tinyosdocs:pcache:idhash:7-0!1!0!!en!2!edit=0 and timestamp 20080402033608 -->
<DIV class=printfooter>Retrieved from "<A
href="http://docs.tinyos.net/index.php/Getting_Started_with_TinyOS">http://docs.tinyos.net/index.php/Getting_Started_with_TinyOS</A>"</DIV><!-- end content -->
<DIV class=visualClear></DIV></DIV></DIV></DIV>
<DIV id=column-one>
<DIV class=portlet id=p-cactions>
<H5>Views</H5>
<DIV class=pBody>
<UL>
<LI class=selected id=ca-nstab-main><A title="View the content page [c]"
accessKey=c
href="http://docs.tinyos.net/index.php/Getting_Started_with_TinyOS">Article</A>
<LI class=new id=ca-talk><A title="Discussion about the content page [t]"
accessKey=t
href="http://docs.tinyos.net/index.php?title=Talk:Getting_Started_with_TinyOS&action=edit">Discussion</A>
<LI id=ca-viewsource><A
title="This page is protected. You can view its source. [e]" accessKey=e
href="http://docs.tinyos.net/index.php?title=Getting_Started_with_TinyOS&action=edit">View
source</A>
<LI id=ca-history><A title="Past versions of this page. [h]" accessKey=h
href="http://docs.tinyos.net/index.php?title=Getting_Started_with_TinyOS&action=history">History</A>
</LI></UL></DIV></DIV>
<DIV class=portlet id=p-personal>
<H5>Personal tools</H5>
<DIV class=pBody>
<UL>
<LI id=pt-login><A
title="You are encouraged to log in, it is not mandatory however. [o]"
accessKey=o
href="http://docs.tinyos.net/index.php?title=Special:Userlogin&returnto=Getting_Started_with_TinyOS">Log
in / create account</A> </LI></UL></DIV></DIV>
<DIV class=portlet id=p-logo><A title="Visit the Main Page [z]"
style="BACKGROUND-IMAGE: url(/images/tos-jwall-small.jpg)" accessKey=z
href="http://docs.tinyos.net/index.php/Main_Page"></A></DIV>
<SCRIPT type=text/javascript> if (window.isMSIE55) fixalpha(); </SCRIPT>
<DIV class=portlet id=p-navigation>
<H5>Navigation</H5>
<DIV class=pBody>
<UL>
<LI id=n-mainpage><A title="Visit the Main Page [z]" accessKey=z
href="http://docs.tinyos.net/index.php/Main_Page">Main Page</A>
<LI id=n-portal><A
title="About the project, what you can do, where to find things"
href="http://docs.tinyos.net/index.php/TinyOS_Documentation_Wiki:Community_Portal">Community
portal</A>
<LI id=n-currentevents><A
title="Find background information on current events"
href="http://docs.tinyos.net/index.php/Current_events">Current events</A>
<LI id=n-recentchanges><A title="The list of recent changes in the wiki. [r]"
accessKey=r
href="http://docs.tinyos.net/index.php/Special:Recentchanges">Recent
changes</A>
<LI id=n-randompage><A title="Load a random page [x]" accessKey=x
href="http://docs.tinyos.net/index.php/Special:Random">Random page</A>
<LI id=n-help><A title="The place to find out."
href="http://docs.tinyos.net/index.php/Help:Contents">Help</A>
<LI id=n-sitesupport><A title="Support us"
href="http://docs.tinyos.net/index.php/TinyOS_Documentation_Wiki:Site_support">Donations</A>
</LI></UL></DIV></DIV>
<DIV class=portlet id=p-search>
<H5><LABEL for=searchInput>Search</LABEL></H5>
<DIV class=pBody id=searchBody>
<FORM id=searchform action=/index.php/Special:Search>
<DIV><INPUT id=searchInput title="Search TinyOS Documentation Wiki [f]"
accessKey=f name=search> <INPUT class=searchButton id=searchGoButton type=submit value=Go name=go> <INPUT class=searchButton id=mw-searchButton type=submit value=Search name=fulltext>
</DIV></FORM></DIV></DIV>
<DIV class=portlet id=p-tb>
<H5>Toolbox</H5>
<DIV class=pBody>
<UL>
<LI id=t-whatlinkshere><A title="List of all wiki pages that link here [j]"
accessKey=j
href="http://docs.tinyos.net/index.php/Special:Whatlinkshere/Getting_Started_with_TinyOS">What
links here</A>
<LI id=t-recentchangeslinked><A
title="Recent changes in pages linked from this page [k]" accessKey=k
href="http://docs.tinyos.net/index.php/Special:Recentchangeslinked/Getting_Started_with_TinyOS">Related
changes</A>
<LI id=t-upload><A title="Upload images or media files [u]" accessKey=u
href="http://docs.tinyos.net/index.php/Special:Upload">Upload file</A>
<LI id=t-specialpages><A title="List of all special pages [q]" accessKey=q
href="http://docs.tinyos.net/index.php/Special:Specialpages">Special pages</A>
<LI id=t-print><A title="Printable version of this page [p]" accessKey=p
href="http://docs.tinyos.net/index.php?title=Getting_Started_with_TinyOS&printable=yes">Printable
version</A>
<LI id=t-permalink><A title="Permanent link to this version of the page"
href="http://docs.tinyos.net/index.php?title=Getting_Started_with_TinyOS&oldid=853">Permanent
link</A> </LI></UL></DIV></DIV></DIV><!-- end of the left (by default at least) column -->
<DIV class=visualClear></DIV>
<DIV id=footer>
<DIV id=f-poweredbyico><A href="http://www.mediawiki.org/"><IMG
alt="Powered by MediaWiki"
src="Getting Started with TinyOS - TinyOS Documentation Wiki.files/poweredby_mediawiki_88x31.png"></A></DIV>
<UL id=f-list>
<LI id=lastmod>This page was last modified 01:08, 29 March 2008.
<LI id=viewcount>This page has been accessed 3,341 times.
<LI id=privacy><A title="TinyOS Documentation Wiki:Privacy policy"
href="http://docs.tinyos.net/index.php/TinyOS_Documentation_Wiki:Privacy_policy">Privacy
policy</A>
<LI id=about><A title="TinyOS Documentation Wiki:About"
href="http://docs.tinyos.net/index.php/TinyOS_Documentation_Wiki:About">About
TinyOS Documentation Wiki</A>
<LI id=disclaimer><A title="TinyOS Documentation Wiki:General disclaimer"
href="http://docs.tinyos.net/index.php/TinyOS_Documentation_Wiki:General_disclaimer">Disclaimers</A>
</LI></UL></DIV>
<SCRIPT type=text/javascript>if (window.runOnloadHook) runOnloadHook();</SCRIPT>
</DIV><!-- Served in 0.282 secs. --></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -