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

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

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

?? 從官方網(wǎng)站上下載tinyos2.0的學(xué)習(xí)指南
?? HTM
?? 第 1 頁 / 共 2 頁
字號(hào):
?<!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
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美一区二区不卡| 色先锋资源久久综合| 日韩三级.com| 免费成人你懂的| 久久综合色8888| 国产精品18久久久久| 日本一区二区三区四区| 成人性生交大片| 亚洲免费观看高清完整版在线观看熊 | 91精品综合久久久久久| 日韩成人一区二区| 欧美成人video| 99久久精品免费| 午夜精品福利一区二区三区av| 日韩三级电影网址| 国产成人丝袜美腿| 国产精品福利电影一区二区三区四区| 成人动漫av在线| 亚洲国产一区二区三区| 欧美mv日韩mv亚洲| 91视频在线观看| 视频一区二区三区入口| 久久久激情视频| 欧美在线观看一区二区| 国内精品自线一区二区三区视频| 中文字幕欧美日本乱码一线二线| 99国内精品久久| 蜜乳av一区二区三区| 国产精品天天看| 欧美精品久久99| 成人黄色777网| 日韩精品一级中文字幕精品视频免费观看 | 日韩精品五月天| 久久久久九九视频| 欧美日韩精品福利| 国产电影精品久久禁18| 午夜久久久久久| 国产精品理论在线观看| 欧美一二三在线| 色网综合在线观看| 国产麻豆成人精品| 午夜久久久影院| 日韩理论片在线| 精品999在线播放| 欧洲日韩一区二区三区| 丁香婷婷综合五月| 美女免费视频一区二区| 亚洲一级电影视频| 国产精品高潮久久久久无| 欧美成人激情免费网| 欧美色精品在线视频| 99精品一区二区三区| 国产资源精品在线观看| 日本v片在线高清不卡在线观看| 亚洲人成7777| 国产欧美日韩中文久久| 日韩三级在线观看| 欧美日韩免费观看一区二区三区| 99精品视频一区二区三区| 国产乱子伦视频一区二区三区 | 一本一本大道香蕉久在线精品 | 国产精品久久夜| 亚洲精品一区在线观看| 日韩一区二区三区免费看 | 国产精品福利一区| 国产农村妇女毛片精品久久麻豆| 26uuu久久综合| 欧美成va人片在线观看| 欧美一区二区三区白人| 欧美久久久一区| 欧美日韩在线电影| 精品视频资源站| 欧美日韩亚洲另类| 在线观看日韩电影| 欧美亚洲动漫精品| 欧美日韩你懂得| 欧美一区二区网站| 69堂国产成人免费视频| 欧美精品粉嫩高潮一区二区| 欧美肥妇free| 日韩欧美中文字幕一区| 日韩三级电影网址| 久久免费午夜影院| 国产精品久久夜| 日韩美女视频一区| 亚洲色大成网站www久久九九| 亚洲欧洲美洲综合色网| 亚洲视频你懂的| 一区二区三区.www| 五月天激情小说综合| 免费不卡在线视频| 国产一区二区不卡| caoporn国产精品| 色女孩综合影院| 欧美精品第1页| 欧美变态tickling挠脚心| 久久久久久影视| 亚洲另类色综合网站| 婷婷开心久久网| 激情都市一区二区| 成人精品一区二区三区四区 | 国产aⅴ精品一区二区三区色成熟| 成人一区二区三区| 欧洲精品在线观看| 日韩一区二区视频在线观看| 亚洲精品一区二区三区99| 国产精品久久久一本精品| 一区二区三区日韩| 青青青伊人色综合久久| 国产精品乡下勾搭老头1| 一本久久精品一区二区| 这里只有精品电影| 国产精品视频一二三区 | 麻豆精品视频在线观看免费| 国产剧情一区在线| 91电影在线观看| 精品黑人一区二区三区久久 | 欧美日韩国产精品自在自线| 欧美成人福利视频| 一区二区三区中文字幕电影 | 国产91精品一区二区麻豆亚洲| 91网上在线视频| 日韩欧美一二区| 亚洲欧美一区二区视频| 日本视频中文字幕一区二区三区| 粉嫩高潮美女一区二区三区 | 国产综合久久久久影院| 在线一区二区三区做爰视频网站| 精品人在线二区三区| 亚洲国产一区在线观看| 国产精品1024| 欧美电影在哪看比较好| 亚洲男人的天堂在线观看| 国模冰冰炮一区二区| 欧美日韩三级视频| 亚洲手机成人高清视频| 国产一区在线精品| 欧美日韩亚洲综合在线| 亚洲欧美综合另类在线卡通| 久久99九九99精品| 欧美日产在线观看| 亚洲激情第一区| 99久久精品国产麻豆演员表| 久久影院午夜论| 久久精品久久精品| 欧美日韩国产经典色站一区二区三区| 国产精品免费视频观看| 国产一区在线看| 欧美电影免费观看高清完整版在线| 亚洲裸体在线观看| 成人免费视频视频在线观看免费| 91精品福利在线一区二区三区| 亚洲品质自拍视频网站| 国产精品一区二区x88av| 日韩欧美激情一区| 秋霞午夜av一区二区三区| 欧美性受xxxx| 亚洲午夜日本在线观看| 色噜噜狠狠色综合欧洲selulu| 亚洲欧洲成人精品av97| 成人综合在线视频| 欧美国产日韩在线观看| 国产成人av电影在线观看| 久久久电影一区二区三区| 国产在线看一区| 国产日韩高清在线| 国产中文一区二区三区| 久久久国产精品午夜一区ai换脸| 国内精品国产成人| 日本一区二区三级电影在线观看 | 91国偷自产一区二区使用方法| 国产精品国产三级国产有无不卡 | 欧美大度的电影原声| 视频精品一区二区| 7777精品伊人久久久大香线蕉超级流畅 | 在线观看日韩精品| 亚洲123区在线观看| 9191国产精品| 久久激情五月激情| 久久在线观看免费| eeuss鲁片一区二区三区在线观看| 国产精品女同一区二区三区| 成人国产亚洲欧美成人综合网| 国产精品美女久久久久久久| 91免费观看在线| 亚洲成人精品在线观看| 欧美一区三区二区| 国产酒店精品激情| 最新久久zyz资源站| 欧美性猛交xxxx黑人交| 男人的天堂亚洲一区| 国产三级三级三级精品8ⅰ区| 不卡的av电影| 亚洲激情成人在线| 欧美一区二区女人| 国产成人亚洲综合a∨猫咪| 亚洲人成精品久久久久| 欧美一区二区黄色| 国产91精品免费| 亚洲免费色视频|