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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? the tinyos printf library - tinyos documentation wiki.htm

?? 從官方網(wǎng)站上下載tinyos2.0的學(xué)習(xí)指南
?? HTM
?? 第 1 頁 / 共 2 頁
字號:
?<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0058)http://docs.tinyos.net/index.php/The_TinyOS_printf_Library -->
<HTML lang=en dir=ltr xml:lang="en" 
xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>The TinyOS printf Library - TinyOS Documentation Wiki</TITLE>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<META 
content="The TinyOS printf Library,Getting Started with TinyOS,Mote-PC serial communication and SerialForwarder,TinyOS Tutorials,Writing Low-Power Applications" 
name=keywords><LINK href="/favicon.ico" rel="shortcut icon"><LINK 
title="TinyOS Documentation Wiki (English)" href="/opensearch_desc.php" 
type=application/opensearchdescription+xml rel=search>
<STYLE type=text/css media="screen, projection">@import url( /skins/common/shared.css?97 );
@import url( /skins/monobook/main.css?97 );
</STYLE>
<LINK media=print 
href="The TinyOS printf Library - TinyOS Documentation Wiki.files/commonPrint.css" 
type=text/css rel=stylesheet><!--[if lt IE 5.5000]><style type="text/css">@import "/skins/monobook/IE50Fixes.css?97";</style><![endif]--><!--[if IE 5.5000]><style type="text/css">@import "/skins/monobook/IE55Fixes.css?97";</style><![endif]--><!--[if IE 6]>
<STYLE type=text/css>@import url( /skins/monobook/IE60Fixes.css?97 );
</STYLE>
<![endif]--><!--[if IE 7]><style type="text/css">@import "/skins/monobook/IE70Fixes.css?97";</style><![endif]--><!--[if lt IE 7]>
<SCRIPT 
src="The TinyOS printf Library - TinyOS Documentation Wiki.files/IEFixes.js" 
type=text/javascript></SCRIPT>

<META http-equiv=imagetoolbar content=no><![endif]-->
<SCRIPT type=text/javascript>/*<![CDATA[*/var skin = "monobook";var stylepath = "/skins";var wgArticlePath = "/index.php/$1";var wgScriptPath = "";var wgScript = "/index.php";var wgServer = "http://docs.tinyos.net";var wgCanonicalNamespace = "";var wgCanonicalSpecialPageName = false;var wgNamespaceNumber = 0;var wgPageName = "The_TinyOS_printf_Library";var wgTitle = "The TinyOS printf Library";var wgAction = "view";var wgRestrictionEdit = [];var wgRestrictionMove = [];var wgArticleId = "20";var wgIsArticle = true;var wgUserName = null;var wgUserGroups = null;var wgUserLanguage = "en";var wgContentLanguage = "en";var wgBreakFrames = false;var wgCurRevisionId = "813";/*]]>*/</SCRIPT>

<SCRIPT 
src="The TinyOS printf Library - TinyOS Documentation Wiki.files/wikibits.js" 
type=text/javascript><!-- wikibits js --></SCRIPT>

<SCRIPT 
src="The TinyOS printf Library - TinyOS Documentation Wiki.files/index.php" 
type=text/javascript><!-- site js --></SCRIPT>

<STYLE type=text/css>@import url( /index.php?title=MediaWiki:Common.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000 );
@import url( /index.php?title=MediaWiki:Monobook.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000 );
@import url( /index.php?title=-&action=raw&gen=css&maxage=18000 );
</STYLE>
<!-- Head Scripts -->
<SCRIPT 
src="The TinyOS printf Library - TinyOS Documentation Wiki.files/ajax.js" 
type=text/javascript></SCRIPT>

<META content="MSHTML 6.00.2900.3268" name=GENERATOR></HEAD>
<BODY class="mediawiki ns-0 ltr page-The_TinyOS_printf_Library">
<DIV id=globalWrapper>
<DIV id=column-content>
<DIV id=content><A id=top name=top></A>
<H1 class=firstHeading>The TinyOS printf Library</H1>
<DIV id=bodyContent>
<H3 id=siteSub>From TinyOS Documentation Wiki</H3>
<DIV id=contentSub></DIV>
<DIV id=jump-to-nav>Jump to: <A 
href="http://docs.tinyos.net/index.php/The_TinyOS_printf_Library#column-one">navigation</A>, 
<A 
href="http://docs.tinyos.net/index.php/The_TinyOS_printf_Library#searchInput">search</A></DIV><!-- start content -->
<P>This lesson demonstrates how to use the <CODE>printf</CODE> library located 
in <CODE>tos/lib/printf</CODE> to debug TinyOS applications by printing messages 
over the serial port. </P>
<TABLE class=toc id=toc summary=Contents>
  <TBODY>
  <TR>
    <TD>
      <DIV id=toctitle>
      <H2>Contents</H2></DIV>
      <UL>
        <LI class=toclevel-1><A 
        href="http://docs.tinyos.net/index.php/The_TinyOS_printf_Library#Overview"><SPAN 
        class=tocnumber>1</SPAN> <SPAN class=toctext>Overview</SPAN></A> 
        <LI class=toclevel-1><A 
        href="http://docs.tinyos.net/index.php/The_TinyOS_printf_Library#The_TinyOS_printf_Library"><SPAN 
        class=tocnumber>2</SPAN> <SPAN class=toctext>The TinyOS printf 
        Library</SPAN></A> 
        <LI class=toclevel-1><A 
        href="http://docs.tinyos.net/index.php/The_TinyOS_printf_Library#Using_the_TinyOS_printf_Library"><SPAN 
        class=tocnumber>3</SPAN> <SPAN class=toctext>Using the TinyOS printf 
        Library</SPAN></A> 
        <LI class=toclevel-1><A 
        href="http://docs.tinyos.net/index.php/The_TinyOS_printf_Library#Conclusion"><SPAN 
        class=tocnumber>4</SPAN> <SPAN class=toctext>Conclusion</SPAN></A> 
      </LI></UL></TD></TR></TBODY></TABLE>
<SCRIPT type=text/javascript> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </SCRIPT>
<A name=Overview></A>
<H1><SPAN class=mw-headline>Overview</SPAN></H1>
<P>Anyone familiar with TinyOS knows that debugging applications has 
traditionally been a very arduous, if not stressful process. While simulators 
like TOSSIM can be used to help verify the logical correctness of a program, 
unforseen problems inevitably arise once that program is deployed on real 
hardware. Debugging such a program typically involves flashing the three 
available LEDs in some intricate sequence or resorting to line by line analysis 
of a running program through the use of a JTAG. </P>
<P>It is common practice when developing desktop applications to print output to 
the terminal screen for debugging purposes. While tools such as <CODE>gdb</CODE> 
provide means of stepping though a program line by line, often times developers 
simply want to quickly print something to the screen to verify that the value of 
a variable has been set correctly, or determine that some sequence of events is 
being run in the proper order. It would be absurd to suggest that they only be 
allowed three bits of information in order to do so. </P>
<P>The TinyOS <CODE>printf</CODE> library provides this terminal printing 
functionality to TinyOS applications through motes connected to a pc via their 
serial interface. Messages are printed by calling <CODE>printf</CODE> commands 
using a familiar syntax borrowed from the C programming language. In order to 
use this functionality, developers simply need to include a single component in 
their top level configuration file (<CODE>PrintfC</CODE>), and include a 
<CODE>"printf.h"</CODE> header file in any components that actually call 
<CODE>printf()</CODE>. </P>
<P>Currently, the <CODE>printf</CODE> library is only supported on msp430 and 
atmega128x based platforms (e.g. mica2, micaZ, telos, eyesIFX). In the future we 
hope to add support for other platforms as well. </P><A 
name=The_TinyOS_printf_Library></A>
<H1><SPAN class=mw-headline>The TinyOS <CODE>printf</CODE> Library</SPAN></H1>
<P>This section provides a basic overview of the TinyOS <CODE>printf</CODE> 
library, including the components that make it up and the interfaces they 
provide. In the following section we walk you through the process of actually 
using these components to print messages from a mote to your pc. If you dont 
care how <CODE>printf</CODE> works and only want to know how to use it, feel 
free to skip ahead to the next section. </P>
<HR>

<P>The entire <CODE>printf</CODE> library consists of only 4 files located in 
the <CODE>tos/lib/printf</CODE> directory: one module, one configuration, one 
interface file, and one header file. </P>
<UL>
  <LI><B>PrintfC.nc</B> -- Configuration file providing printf functionality to 
  TinyOS applications 
  <LI><B>PrintfP.nc</B> -- Module implementing the printf functionality 
  <LI><B>PrintfFlush.nc</B> -- Interface for flushing printf messages over the 
  serial port to a pc 
  <LI><B>printf.h</B> -- Header file specifying the printf message format and 
  size of the flush buffer </LI></UL>
<P>The <CODE>PrintfC</CODE> configuration is the only component an application 
needs to wire in order to use the functionality provided by the TinyOS 
<CODE>printf</CODE> library. Below is the component graph of the 
<CODE>PrintfC</CODE> configuration: </P>
<CENTER><A class=image title=Image:printf_components.png 
href="http://docs.tinyos.net/index.php/Image:Printf_components.png"><IMG 
height=293 alt=Image:printf_components.png 
src="The TinyOS printf Library - TinyOS Documentation Wiki.files/Printf_components.png" 
width=363 border=0></A> 
<P><B>Figure 1: The component graph of the PrintfC configuration.</B> 
</P></CENTER>
<P>Conceptually, the operation of the TinyOS <CODE>printf</CODE> library is very 
simple. Developers supply strings to <CODE>printf()</CODE> commands in a 
distributed fashion throughout any of the components that make up a complete 
TinyOS application. These strings are buffered in a central location inside the 
<CODE>PrintfP</CODE> component and flushed out to a PC in the form of TinyOS 
SerialMessages upon calling the <CODE>flush()</CODE> command of the 
<CODE>PrintfFlush</CODE> interface. </P>
<P>By encapsulating the strings produced by calls to <CODE>printf()</CODE> 
inside standard TinyOS SerialMessages, applications that use the serial stack 
for other purposes can share the use of the serial port. Alternate 
implementations were considered in which <CODE>printf</CODE> would have had 
exclusive access to the serial port, and explicit flushing would not have been 
necessary. In the end, we felt it was better to give developers the freedom to 
decide exactly when messages should be printed, as well as allow them to send 
multiple types of SerialMessages in a single application. </P>
<P>Currently, only a single buffer is used to store the strings supplied to 
calls to <CODE>printf</CODE> before flushing them. This means that while the 
buffer is being flushed, any calls to <CODE>printf</CODE> will fail. In the 
future, we plan to implement a double buffered approach so that strings can 
continue to be buffered at the same time they are being printed. </P>
<P>There are also plans to provide a means of flushing messages out to a PC 
without requiring developers to make an explicit <CODE>flush()</CODE> call. This 
would allow developers to simply wire in the <CODE>PrintfC</CODE> component 
without having to make any calls to any interfaces it provides. In fact, the 
<CODE>PrintfC</CODE> component would not need to provide any interfaces at all. 
It would start itself up and then run in a loop, periodically flushing the 
contents of the <CODE>printf</CODE> buffer. Such functionality is useful in 
applications that do not really care when messages are printed or how long a 
delay the process of printing introduces to other sections of code. Explicit 
flushing would still be recommended in applications where the sections of code 
under examinatation are very timing sensitive (e.g. inside the CC2420 radio 
stack). </P><A name=Using_the_TinyOS_printf_Library></A>
<H1><SPAN class=mw-headline>Using the TinyOS <CODE>printf</CODE> 
Library</SPAN></H1>
<P>To help guide the process of using the <CODE>printf</CODE> library, a 
<CODE>TestPrintf</CODE> application has been created. At present, this 
application is not included in the official TinyOS distribution (&lt;= 2.0.2). 
If you are using TinyOS from a cvs checkout, you will find it located under 
<CODE>apps/tutorials/Printf</CODE>. Otherwise, you can obtain it from cvs by 
running the following set of commands from a terminal window: </P><PRE>cd $TOSROOT/apps/tutorials
cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login
cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co -P -d Printf tinyos-2.x/apps/tutorials/Printf
</PRE>
<P>Just hit enter when prompted for a CVS password. You do not need to enter 
one. </P>
<P>If you are not using cvs, you will also have to apply the patch found <A 
class="external text" 
title=http://sing.stanford.edu/klueska/tinyos-2.0-printf.patch 
href="http://sing.stanford.edu/klueska/tinyos-2.0-printf.patch" 
rel=nofollow>here</A> in order to allow the <CODE>printf</CODE> library to 
compile correctly for atmega128x based platforms (i.e. mica2, micaz): </P><PRE>cp tinyos-2.0-printf.patch $TOSROOT/..
cd $TOSROOT/..
patch -p0 &lt; tinyos-2.0-printf.patch
</PRE>
<P>Note that you may have to use 'sudo' when applying the patch if you run into 
permission problems. </P>
<HR>

<P>The <CODE>TestPrintf</CODE> application demonstrates everything necessary to 
use the <CODE>printf</CODE> library. Go ahead and open the 
<CODE>TestPrintfAppC</CODE> configuration to see how the various interfaces 
provided by the <CODE>PrintfC</CODE> component have been wired in. You will want 
to do something similar in your own applications. </P><PRE>configuration TestPrintfAppC{
}
implementation {
  components MainC, TestPrintfC, LedsC;
  components PrintfC;

  TestPrintfC.Boot -&gt; MainC;
  TestPrintfC.Leds -&gt; LedsC;
  TestPrintfC.PrintfControl -&gt; PrintfC;
  TestPrintfC.PrintfFlush -&gt; PrintfC;
}
</PRE>
<P>First, the <CODE>PrintfControl</CODE> interface has been wired in to enable 
turning on and off the service providing <CODE>printf</CODE> functionality. 
Turning on the <CODE>Printf</CODE> service implicity turns on the serial port 
for sending messages. Second, the <CODE>PrintfFlush</CODE> interface has been 
wired in to allow the application to control when <CODE>printf</CODE> messages 
should be flushed out over the serial line. In this application, all 
<CODE>printf()</CODE> commands are called directly within the 
<CODE>TestPrintfC</CODE> component. In general, <CODE>printf()</CODE> commands 
can be called from any component as long as they have included the 
<CODE>"printf.h"</CODE> header file. </P>
<HR>

<P>Before examining the <CODE>TestPrintfC</CODE> component, first install the 
application on a mote and see what kind of output it produces. Note that the 
instructions here are only valid for installation on a telosb mote on a linux 
based TinyOS distribution. For installation on other systems or for other mote 
platforms, please refer to <A title="Getting Started with TinyOS" 
href="http://docs.tinyos.net/index.php/Getting_Started_with_TinyOS">lesson 1</A> 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
...av二区三区久久精品| 欧美日韩国产免费| 中文字幕欧美国产| 国产毛片精品一区| 久久精品综合网| 高清av一区二区| 国产精品理论片| 一本大道av伊人久久综合| 亚洲午夜av在线| 欧美一区二区人人喊爽| 国产曰批免费观看久久久| 欧美国产精品中文字幕| 91免费版pro下载短视频| 一区二区三区影院| 日韩欧美在线一区二区三区| 蜜桃av噜噜一区| 欧美经典一区二区| 在线一区二区观看| 久久爱另类一区二区小说| 久久精品亚洲精品国产欧美| 91在线精品秘密一区二区| 亚洲综合偷拍欧美一区色| 欧美二区在线观看| 国产jizzjizz一区二区| 亚洲男人电影天堂| 日韩欧美国产综合一区 | 欧美日韩在线三区| 久久精品国产亚洲aⅴ| 中文av一区二区| 欧美亚日韩国产aⅴ精品中极品| 久久福利资源站| 国产精品初高中害羞小美女文| 欧美日韩三级一区二区| 国产主播一区二区| 亚洲成人黄色小说| 国产欧美日韩精品a在线观看| 色婷婷亚洲综合| 韩国成人在线视频| 亚洲第一激情av| 综合自拍亚洲综合图不卡区| 欧美一区二区三区系列电影| 99天天综合性| 国产乱码字幕精品高清av| 亚洲国产成人tv| √…a在线天堂一区| 日韩欧美在线不卡| 欧美在线免费观看视频| 国产白丝网站精品污在线入口| 亚洲国产日日夜夜| 亚洲免费资源在线播放| 久久久美女艺术照精彩视频福利播放| 欧美日韩久久不卡| 91在线视频官网| 大胆亚洲人体视频| 九色综合国产一区二区三区| 亚洲国产wwwccc36天堂| 亚洲色图色小说| 国产午夜精品在线观看| 精品国产乱码久久久久久夜甘婷婷 | 波多野结衣的一区二区三区| 国产真实精品久久二三区| 视频一区视频二区中文字幕| 亚洲视频小说图片| 欧美激情在线一区二区| 精品成人一区二区三区四区| 欧美夫妻性生活| 6080国产精品一区二区| 欧美视频一区二区三区| 色天使色偷偷av一区二区| 99精品黄色片免费大全| 成人高清免费观看| 成人一区在线观看| 懂色av中文一区二区三区| 国产一区二区三区av电影 | 亚洲精品精品亚洲| 综合久久国产九一剧情麻豆| 中文字幕综合网| 中文字幕日韩av资源站| 亚洲欧洲精品一区二区三区不卡| 国产午夜一区二区三区| 欧美国产一区在线| 中文字幕在线一区免费| 国产精品对白交换视频 | 欧美三级日韩在线| 欧美日韩亚洲综合| 91麻豆精品国产自产在线| 欧美精品一级二级| 欧美一级生活片| 欧美精品一区视频| 国产拍欧美日韩视频二区| 国产精品乱码一区二三区小蝌蚪| 中文字幕一区二区三区色视频| 亚洲人123区| 亚洲va欧美va国产va天堂影院| 亚洲 欧美综合在线网络| 日韩精品福利网| 国内成人自拍视频| 成人免费观看视频| 欧洲一区在线电影| 日韩午夜激情视频| 国产欧美日韩在线| 亚洲欧美日韩久久精品| 亚洲国产美国国产综合一区二区| 午夜精品久久久久久不卡8050| 蜜桃av一区二区| 国产v日产∨综合v精品视频| 日本韩国欧美一区| 91精品国产91热久久久做人人| 精品av综合导航| 日韩美女视频19| 青青草97国产精品免费观看 | 亚洲女人****多毛耸耸8| 亚洲一区二区三区四区在线观看 | 亚洲欧美日韩成人高清在线一区| 一片黄亚洲嫩模| 乱一区二区av| 一本久久综合亚洲鲁鲁五月天| 7777精品伊人久久久大香线蕉 | 久久99热狠狠色一区二区| 懂色中文一区二区在线播放| 色综合 综合色| 精品国产乱码久久久久久闺蜜| 国产精品电影一区二区三区| 午夜精品成人在线视频| 国产经典欧美精品| 欧美在线看片a免费观看| 26uuu欧美日本| 伊人性伊人情综合网| 国内欧美视频一区二区| 欧美中文字幕一区二区三区亚洲| 久久亚洲影视婷婷| 亚洲一区二区黄色| 丁香一区二区三区| 欧美一二三在线| 亚洲精品一二三区| 国产成人亚洲综合a∨婷婷| 欧美日韩亚洲综合| 最新国产成人在线观看| 精品一区二区三区免费播放| 欧美亚洲一区二区在线| 国产欧美一区二区精品性色 | 亚洲精品免费在线| 国产高清不卡二三区| 91精品国产一区二区| 亚洲女人的天堂| 成人午夜大片免费观看| 精品日韩一区二区三区| 日韩精品视频网站| 欧美性生交片4| 亚洲欧美日本韩国| 97久久超碰精品国产| 日本一区二区三区在线观看| 激情综合亚洲精品| 日韩一区二区免费在线电影| 亚洲国产aⅴ天堂久久| 97精品国产露脸对白| 欧美激情中文字幕一区二区| 国内精品伊人久久久久av影院| 91麻豆精品国产91久久久久| 亚洲高清不卡在线| 在线亚洲人成电影网站色www| 国产精品免费视频观看| 国产不卡一区视频| 久久久www成人免费毛片麻豆| 老司机一区二区| 日韩欧美国产一区二区在线播放 | 极品少妇一区二区三区精品视频| 欧美一区二区三区男人的天堂| 一区二区三区在线播放| 在线观看不卡一区| 亚洲影院免费观看| 欧美亚洲图片小说| 午夜日韩在线观看| 在线不卡中文字幕播放| 蜜桃av一区二区三区电影| 日韩精品中文字幕一区二区三区 | 奇米亚洲午夜久久精品| 日韩一级二级三级精品视频| 日本欧美大码aⅴ在线播放| 日韩一区二区在线看片| 国产自产视频一区二区三区| 久久久精品影视| av在线综合网| 亚洲黄色小说网站| 精品视频色一区| 蜜臀av性久久久久蜜臀aⅴ流畅| 日韩视频在线观看一区二区| 狠狠色丁香久久婷婷综| 欧美国产1区2区| 色系网站成人免费| 丝袜a∨在线一区二区三区不卡| 日韩精品中文字幕在线不卡尤物 | 欧美色综合天天久久综合精品| 亚洲成人av一区二区三区| 欧美一级日韩免费不卡| 国产精品18久久久久久久久久久久| 久久理论电影网| 欧美无砖砖区免费| 国产一区三区三区| 一区二区在线观看av|