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

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

?? tinydb.html

?? tinyos中文手冊,是根據tinyos系統自帶手冊翻譯過來的,雖然質量不好,但是對英文不強的人還是有用的
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
Note that you can use a <code>WHERE</code> clause over nodeid to send queries
to only a subset of the network.  
<p>
<b> Aggregation Predicates </b>:
TinyDB also allows you to compute <i>aggregates</i> over readings being reported by
several nodes in a query.  For example, to compute the average temperature reading of all
the sensors where the light is above 400, you would issue the query:
<blockquote>
<table border=0 hspace="4" cellspacing=2 width="50%" cellpadding=3>
<tr bgcolor="#e0e0e0">
<td width="100%"><pre>
SELECT 
AVG(temp) FROM
sensors WHERE
light &gt;  400
SAMPLE PERIOD 1024
</pre></td></tr></table>
</blockquote>
<p>
To specify this query, select "AVG" in the aggregation operator menu before moving
temp into the projected attributes list:
<p>
<IMG src="imgs/tinydb-aggr.jpg"></IMG>
<p>
TinyDB computes this query via an efficient <i>in-network</i> approach, where sensors
aggregate their own readings with readings from their neighbors and forward those
aggregate values towards the base station.
<p>
You've now seen how to pose a simple query with filtration and aggregation predicates.
In the next section, you'll learn how to write a small, standalone program to run
TinyDB queries.


    <p>
      <table border=0 hspace="4" cellspacing=2 width="100%" cellpadding=3>
	<tr bgcolor="#e0e0ff">
	  <td width="100%"><nobr> <b> <font
	  face="arial,helvetica">A Simple Java Program to Use TinyDB</font> </b></nobr></td>
	</tr> </table></p>

In this section, you will learn how to write a simple standalone Java 
program to run a query in TinyDB.  This program runs the query <code>SELECT light FROM sensors</code>.
First, we'll look at the whole program and then we'll see how the individual pieces work (this
application is available in tools/java/net/tinyos/tinydb/DemoApp.java):


<blockquote>
<table border=0 hspace="4" cellspacing=2 width="80%" cellpadding=3>
<tr bgcolor="#e0e0e0">
<td width="100%"><pre>
    package net.tinyos.tinydb;
    import net.tinyos.tinydb.parser.*;
    import java.util.Vector;
    import java.io.*;
    public class DemoApp implements ResultListener{
        public DemoApp() { 
            try {
                TinyDBMain.initMain(); //parse the query 
                q = SensorQueryer.translateQuery("SELECT light", (byte)1); 
                //inject the query, registering ourselves as a listener for result 
                System.out.println("Sending query."); 
                TinyDBMain.injectQuery( q, this); 
            } catch (IOException e) { 
                System.out.println("Network error."); 
            } catch (ParseException e) { 
                System.out.println("Invalid Query.");
            }
        } 
    
        /* ResultListener method called whenever a result arrives */
        public void addResult(QueryResult qr) {
            Vector v = qr.resultVector(); //print the result
            for (int i = 0;  i &lt;  v.size(); i++) {
                System.out.print("\t" + v.elementAt(i) + "\t|");
            }
            System.out.println();
        }

        public static void main(String argv[]) {
            new DemoApp();
        }
    
        TinyDBQuery q;
    }

</pre></td></tr></table>
</blockquote>


To try out this program, set up your motes as above (making sure you close any open TinyDB windows)
and type <code>java.net.tinyos.tinydb.DemoApp</code> from the <code>tools/java/</code> 
directory.  You should see output like:

<blockquote>
<table border=0 hspace="4" cellspacing=2 width="80%" cellpadding=3>
<tr bgcolor="#e0e0e0">
<td width="100%"><pre>

Listening for client connections on port 9000
SerialPortIO: initializing
Successfully opened COM1
client connected from localhost.localdomain (127.0.0.1)
Sending query.
	1	|	835	|
	2	|	833	|
	3	|	833	|
	4	|	833	|
	5	|	833	|
	6	|	833	|
	7	|	833	|
...
</pre></td></tr></table>
</blockquote>

Now, let's look at the program in more detail.  First, notice that the 
<code>DemoApp</code> class implements the <code>ResultListener</code>
interface.  The <code>addResult(...)</code> method is the only member
of this interface, and it will be called whenever a result arrives for
any query which DemoApp has registered.  We'll see how registration
works in a moment.
<p>
The first lines of the <code>DemoApp()</code> constructor initialize TinyDB,
parse the query, and inject the query into the network:

<blockquote>
<table border=0 hspace="4" cellspacing=2 width="80%" cellpadding=3>
<tr bgcolor="#e0e0e0">
<td width="100%"><pre>

    TinyDBMain.initMain();
 
    //parse the query
    q = SensorQueryer.translateQuery("SELECT light", (byte)1);
	    
    //inject the query, registering ourselves as a listener for result
    System.out.println("Sending query.");
    TinyDBMain.injectQuery( q, this);

</pre></td></tr></table>
</blockquote>


The call to <code>TinyDB.initMain()</code> reads the TinyDB configuration file
and sets up network communication.  By default, it opens its own connection
to the serial port, although it can be configured to share that connection
via a <code>SerialForwarder</code> (see the <A href="../tinydb.pdf">TinyDB documentation</A>
on the configuration file.)  
<p>
Next, the <code>SensorQueryer.translateQuery(..)</code> call converts
the specified SQL query into a <code>TinyDBQuery</code> object;  the second parameter
(<code>(byte)1</code>) specifies that the query id for this query should be 1;  this
id can be used to cancel or modify the query after it has been injected.
<p>
Finally, the <code>TinyDBMain.injectQuery(..)</code> actually sends the query into
the network and starts it running.  The second parameter, <code>this</code>,
specifies that the <code>DemoApp</code> object should be registered as 
a listener for results from this query.
<p>
That's it!  The query is now running.  Whenever a result arrives for this query, 
the <code>addResult</code> method will be called to print out each field of
each result that arrives.
<p>
By now, you've learned how to use the TinyDB GUI and write simple applications
that interact with TinyDB motes. In the next section, you'll learn how to extend 
TinyDB with new attributes that can be queried via the TinyDB query interface.

    <p>
      <table border=0 hspace="4" cellspacing=2 width="100%" cellpadding=3>
	<tr bgcolor="#e0e0ff">
	  <td width="100%"><nobr> <b> <font
	  face="arial,helvetica">Adding an Attribute</font> </b></nobr></td>
	</tr> </table></p>
<P>TinyDB comes with a builtin command&nbsp;for adding constant 
attributes.&nbsp; To add a constant attribute, click the "Add Attribute" button 
in the Mote Commands window.&nbsp; A dialog box will pop up asking you to fill 
in the attribute name, type and a constant value.&nbsp; Simply fill them in and 
click the "OK" button.&nbsp; The green&nbsp;LED on the motes should toggle once 
if they receive the "Add Attribute" command.&nbsp; The new attribute should be 
ready for use.&nbsp; You can now run queries over that attribute.</P>
<P><IMG alt="" hspace=100 src="imgs\tinydb-cmd.jpg" ><IMG id=IMG1 alt="" 
src="imgs\tinydb-addattr.jpg" ></P>
<P>To add an attribute for a specific mote, you can uncheck the "Broadcast" 
check box in the Mote Commands window, then fill in a Target Id.&nbsp; If a 
constant attribute of the same name has already been registered, the old 
constant value of the attribute will be overwritten with the new value.</P>
<P>Adding non-constant attributes will involve some NesC programming using the 
TinySchema API.&nbsp; The easiest way to get started is to copy and modify some 
builtin attributes implemented in tos/lib/Attributes.</P>


    <p>
      <table border=0 hspace="4" cellspacing=2 width="100%" cellpadding=3>
	<tr bgcolor="#e0e0ff">
	  <td width="100%"><nobr> <b> <font
	  face="arial,helvetica">Where To Look For More Information</font> </b></nobr></td>
	</tr> </table></p>

	There are a number of TinyDB related resources available to users of the system:
<ul>
<li> <a href="http://telegraph.cs.berkeley.edu/tinydb">The TinyDB Website</a>:  Look here for information about the latest release of TinyDB, as well as links to media, source code, and standalone images that can be programmed into a mote.
<li> <A href="../tinydb.pdf">The TinyDB User Manual</A>:  A much more thorough guide to installing, using, and modifying TinyDB.  Be sure to check out the
FAQ at the end if you are having difficulty!
<li> <A href="../tinyschema.pdf">The TinySchema Manual</A>: A guide to using 
  attributes and commands (with or without TinyDB).</li>            

</ul>

    
<p>
<hr>      
<b><A href="index.html"> Tutorial Index</A></b>

</body>
</html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美午夜影院一区| 亚洲欧美在线aaa| 国产视频一区二区在线| 1区2区3区国产精品| 蜜桃一区二区三区在线观看| 一本久道久久综合中文字幕| 日韩精品一区二区三区在线播放 | 丁香亚洲综合激情啪啪综合| 91久久人澡人人添人人爽欧美| 日韩一区二区三区免费观看| 尤物在线观看一区| 成人午夜视频免费看| 日韩欧美成人激情| 丝袜国产日韩另类美女| 色狠狠色噜噜噜综合网| 国产精品久久久久永久免费观看| 久久精品久久99精品久久| 91传媒视频在线播放| 中文一区一区三区高中清不卡| 免费观看日韩av| 在线播放国产精品二区一二区四区| 综合精品久久久| 高清成人在线观看| 久久久久久免费毛片精品| 日本午夜精品一区二区三区电影| 欧美色综合天天久久综合精品| 国产欧美视频一区二区三区| 国产在线视频一区二区| 日韩精品资源二区在线| 日韩1区2区日韩1区2区| 欧美日韩久久一区二区| 视频一区在线播放| 制服丝袜av成人在线看| 日韩精品国产精品| 9191久久久久久久久久久| 午夜成人免费视频| 在线不卡中文字幕| 老鸭窝一区二区久久精品| 日韩西西人体444www| 麻豆精品一区二区av白丝在线| 欧美一区二区网站| 久久99久久久欧美国产| 久久久久久久久97黄色工厂| 国产aⅴ综合色| 中文字幕欧美一| 欧美影院精品一区| 天天色 色综合| 日韩精品一区二区三区三区免费| 日本在线不卡视频| 久久久99精品久久| 95精品视频在线| 亚洲福利一二三区| 日韩欧美一区二区视频| 国产一区二区在线电影| 日本一区二区三区四区 | 国产精品国产馆在线真实露脸| 国产精品一区二区91| 国产精品美女久久久久av爽李琼 | 在线亚洲免费视频| 天涯成人国产亚洲精品一区av| 91精品久久久久久蜜臀| 激情综合网av| 国产精品成人一区二区三区夜夜夜 | 亚洲在线成人精品| 7777精品伊人久久久大香线蕉超级流畅 | 日韩av一二三| 国产亚洲午夜高清国产拍精品| 国产·精品毛片| 一区二区高清在线| www国产精品av| 色综合久久88色综合天天免费| 午夜亚洲国产au精品一区二区| 久久久久久久免费视频了| 欧美亚日韩国产aⅴ精品中极品| 秋霞国产午夜精品免费视频| 国产精品人妖ts系列视频| 在线精品视频一区二区三四| 激情综合亚洲精品| 亚洲一区二区三区美女| 国产欧美日韩久久| 5月丁香婷婷综合| www.综合网.com| 精品系列免费在线观看| 亚洲精品成人a在线观看| 久久久久国色av免费看影院| 欧美在线一区二区| 国产精华液一区二区三区| 亚洲电影在线播放| 中文字幕免费一区| 日韩一区二区精品在线观看| 99视频国产精品| 免费观看30秒视频久久| 一区二区三区四区在线播放| 国产欧美精品国产国产专区| 日韩一区二区视频在线观看| 91成人在线精品| 91麻豆蜜桃一区二区三区| 国产夫妻精品视频| 久久精品国产一区二区三 | 欧美精品日韩精品| 91免费看视频| 成人午夜免费视频| 国产激情一区二区三区| 黑人巨大精品欧美黑白配亚洲| 亚洲成人动漫av| 一区二区免费在线| 亚洲乱码国产乱码精品精可以看| 久久久久成人黄色影片| 久久久精品tv| 久久日韩粉嫩一区二区三区| 日韩精品一区二区在线| 日韩精品中文字幕一区 | 国产欧美日韩精品一区| 欧美xxx久久| 日韩精品中文字幕在线一区| 欧美变态口味重另类| 日韩欧美一级在线播放| 日韩欧美国产综合| 久久综合九色综合97婷婷女人 | 中文字幕不卡在线播放| 久久久亚洲精华液精华液精华液| 欧美一级二级三级蜜桃| 日韩三级精品电影久久久 | 欧洲日韩一区二区三区| 色老头久久综合| 91成人免费在线| 欧美日韩的一区二区| 欧美日产国产精品| 777色狠狠一区二区三区| 日韩亚洲欧美成人一区| 精品日韩一区二区| 国产精品久久久久久户外露出 | 日本欧美韩国一区三区| 美女看a上一区| 国产成人午夜精品影院观看视频| 高清不卡在线观看av| 99精品一区二区三区| 欧美在线|欧美| 日韩欧美视频一区| 中文一区一区三区高中清不卡| 日韩毛片在线免费观看| 偷窥少妇高潮呻吟av久久免费| 美女脱光内衣内裤视频久久网站| 国产精品一二二区| 91九色02白丝porn| 欧美男男青年gay1069videost| 日韩欧美一卡二卡| 亚洲天堂a在线| 日本三级亚洲精品| 成人爱爱电影网址| 欧美猛男男办公室激情| 国产视频亚洲色图| 亚洲一区二区免费视频| 国产一区二区三区视频在线播放| 99精品欧美一区二区三区小说 | 国产欧美一区二区精品婷婷| 亚洲欧美乱综合| 极品少妇xxxx偷拍精品少妇| 色婷婷av一区二区三区大白胸 | 国产精品久久久久aaaa樱花 | 7878成人国产在线观看| 久久丝袜美腿综合| 亚洲制服丝袜一区| 国产激情一区二区三区| 在线不卡一区二区| 亚洲精品免费播放| 风间由美一区二区三区在线观看 | 国产91清纯白嫩初高中在线观看| 色视频成人在线观看免| 2021中文字幕一区亚洲| 亚洲18色成人| 9人人澡人人爽人人精品| 日韩欧美激情四射| 香蕉加勒比综合久久| 成人app软件下载大全免费| 日韩一区二区三区视频在线| 一区二区三区美女| 不卡一区在线观看| 久久久久久久综合| 久久精工是国产品牌吗| 欧美日韩在线播| 亚洲精品视频在线观看免费| 国产高清精品网站| 精品国产一区二区精华| 日本中文在线一区| 欧美久久婷婷综合色| 亚洲一区欧美一区| 色www精品视频在线观看| 国产精品你懂的| 国产成人精品免费视频网站| 日韩精品一区二区三区视频播放 | 欧美一级免费大片| 亚洲国产一区二区三区| 一本色道久久综合亚洲精品按摩| 国产亚洲欧美激情| 精品一区二区三区视频在线观看| 国产91在线看| 99re6这里只有精品视频在线观看| 蜜臀国产一区二区三区在线播放 | 久久99日本精品|