firebug-cvs Mailing List for FireBug: wireless wildfire monitoring (Page 25)
Brought to you by:
doolin
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(36) |
Jun
(45) |
Jul
(108) |
Aug
(31) |
Sep
(2) |
Oct
(4) |
Nov
(113) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(63) |
Feb
(37) |
Mar
(24) |
Apr
(6) |
May
(5) |
Jun
(5) |
Jul
(71) |
Aug
(42) |
Sep
(7) |
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(64) |
Jun
(71) |
Jul
(51) |
Aug
(89) |
Sep
(24) |
Oct
(1) |
Nov
(1) |
Dec
(2) |
2006 |
Jan
|
Feb
|
Mar
(3) |
Apr
(2) |
May
|
Jun
|
Jul
(21) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: <do...@us...> - 2003-12-14 09:39:18
|
Update of /cvsroot/firebug/firebug/project/src/Blinker In directory sc8-pr-cvs1:/tmp/cvs-serv14889 Modified Files: interfaces.html Log Message: Added an exercise. Index: interfaces.html =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/Blinker/interfaces.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** interfaces.html 13 Dec 2003 14:40:10 -0000 1.2 --- interfaces.html 13 Dec 2003 15:28:41 -0000 1.3 *************** *** 309,312 **** --- 309,341 ---- + <h2>Exercise</h2> + + <p> + Use a parameterized interface to make the yellow LED + blink. Hint: Remember to parameterize the default + implementation of the Blink event: + </p> + + <center> + <table class="code"> + <tbody> + <tr> + <td width="100%"> + <b>BlinkerM.nc</b> + <pre> + ... + + default event result_t BlinkHandler.Blink[uint8_t id]() { + return SUCCESS; + } + + ... + </pre> + </td> + </tr> + </tbody> + </table> + </center> + <p> |
From: <do...@us...> - 2003-12-14 08:42:08
|
Update of /cvsroot/firebug/firebug/project/src/Blinker In directory sc8-pr-cvs1:/tmp/cvs-serv5321 Modified Files: interfaces.html Log Message: Added to interface tutorial. Index: interfaces.html =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/Blinker/interfaces.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** interfaces.html 13 Dec 2003 00:50:17 -0000 1.1 --- interfaces.html 13 Dec 2003 14:40:10 -0000 1.2 *************** *** 48,51 **** --- 48,73 ---- + + <h2>Interfaces</h2> + + <p> + Let's start with a quote from the nesC reference manual: + </p> + <blockquote> + Interfaces in nesC are bidirectional: they specify + a multi-function interaction channel between two + components, the provider and the user. The interface + specifies a set of named functions, called commands, + to be implemented by the interface's provider and a + set of named functions, called events, to be implemented + by the interface's user. + </blockquote> + + <p> + For our application, <code>Blink</code> will be the + interface provider, and <code>Blinker</code> will be + the interface user. + </p> + <h1>Componentizing Blink</h1> *************** *** 53,58 **** To provide independence between the component that wants to blink an LED and the program that provides ! the actual blinking behavior, the Blink configuration ! needs to be slightly modified to remove Main: </p> --- 75,81 ---- To provide independence between the component that wants to blink an LED and the program that provides ! the actual blinking behavior, the <code>Blink</code> ! configuration needs to be slightly modified to ! remove Main: </p> |
From: <do...@us...> - 2003-12-14 08:38:26
|
Update of /cvsroot/firebug/firebug/project/src/FireBase In directory sc8-pr-cvs1:/tmp/cvs-serv9739/FireBase Log Message: Directory /cvsroot/firebug/firebug/project/src/FireBase added to the repository |
From: <do...@us...> - 2003-12-13 00:50:20
|
Update of /cvsroot/firebug/firebug/project/src/Blinker In directory sc8-pr-cvs1:/tmp/cvs-serv20536 Added Files: .cvsignore Blink.nc BlinkHandler.nc BlinkM.nc Blinker.nc BlinkerM.nc Makefile README interfaces.html main.css tutorial.css Log Message: Added a tutorial for handling events using interfaces. Hopefully this can be rolled into the tinyos main tree and out of here. --- NEW FILE: .cvsignore --- build *~ --- NEW FILE: Blink.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /* tab:4 * "Copyright (c) 2000-2003 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * * Copyright (c) 2002-2003 Intel Corporation * All rights reserved. * * This file is distributed under the terms in the attached INTEL-LICENSE * file. If you do not find these files, copies can be found by writing to * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, * 94704. Attention: Intel License Inquiry. */ /** * Blink is a basic application that toggles the leds on the mote * on every clock interrupt. The clock interrupt is scheduled to * occur every second. The initialization of the clock can be seen * in the Blink initialization function, StdControl.start().<p> * * Parts of this code were written or modified for FireBug project * funded by the NSF Information Technology Research * initiative. Copyright Regents of the University of * of California, 2003. * * @author tin...@mi... * @author David. M. Doolin */ // $Id: Blink.nc,v 1.1 2003/12/13 00:50:17 doolin Exp $ configuration Blink { provides { interface StdControl; interface BlinkHandler; } } implementation { components BlinkM, TimerC, LedsC; BlinkM.StdControl = StdControl; StdControl = TimerC; BlinkM.Timer -> TimerC.Timer[unique("Timer")]; BlinkM.Leds -> LedsC; BlinkM.BlinkHandler = BlinkHandler; } --- NEW FILE: BlinkHandler.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /* tab:4 * "Copyright (c) 2000-2003 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * */ /** * Parts of this code were written or modified for FireBug project * funded by the NSF Information Technology Research * initiative. Copyright Regents of the University of * of California, 2003. * * @author David. M. Doolin */ interface BlinkHandler { event result_t Blink (); } --- NEW FILE: BlinkM.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** tab:4 * "Copyright (c) 2000-2003 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * * Copyright (c) 2002-2003 Intel Corporation * All rights reserved. * * This file is distributed under the terms in the attached INTEL-LICENSE * file. If you do not find these files, copies can be found by writing to * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, * 94704. Attention: Intel License Inquiry. */ /** * Implementation for Blink component. Signal an * event when the timer fires. * * Parts of this code were written or modified for FireBug project * funded by the NSF Information Technology Research * initiative. Copyright Regents of the University of * of California, 2003. * * @author David. M. Doolin */ module BlinkM { provides { interface StdControl; interface BlinkHandler; } uses { interface Timer; interface Leds; } } implementation { command result_t StdControl.init() { call Leds.init(); return SUCCESS; } command result_t StdControl.start() { return call Timer.start(TIMER_REPEAT, 1000); } command result_t StdControl.stop() { return call Timer.stop(); } event result_t Timer.fired() { signal BlinkHandler.Blink(); call Leds.redToggle(); return SUCCESS; } default event result_t BlinkHandler.Blink() { return SUCCESS; } } --- NEW FILE: Blinker.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** * "Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * */ /** * Parts of this code were written or modified for FireBug project * funded by the NSF Information Technology Research * initiative. Copyright Regents of the University of * of California, 2003. * * @author David. M. Doolin */ configuration Blinker { } implementation { components Main, Blink, LedsC, BlinkerM; Main.StdControl -> BlinkerM.StdControl; Main.StdControl -> Blink.StdControl; BlinkerM.Leds -> LedsC; BlinkerM.BlinkHandler -> Blink.BlinkHandler; } --- NEW FILE: BlinkerM.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** * "Copyright (c) 2000-2003 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * */ /** * Parts of this code were written or modified for FireBug project * funded by the NSF Information Technology Research * initiative. Copyright Regents of the University of * of California, 2003. * * @author David. M. Doolin */ module BlinkerM { provides { interface StdControl; } uses { interface BlinkHandler; interface StdControl as Blink; interface Leds; } } implementation { command result_t StdControl.init() { call Leds.init(); return SUCCESS; } command result_t StdControl.start() { call Leds.greenOn(); return SUCCESS; } command result_t StdControl.stop() { return SUCCESS; } event result_t BlinkHandler.Blink() { call Leds.greenToggle(); return SUCCESS; } } --- NEW FILE: Makefile --- COMPONENT=Blinker include $(TOSROOT)/apps/Makerules --- NEW FILE: README --- README for Blinker Author/Contact: do...@ce... Description: Blinker is an application that demonstrates the use of interfaces for handling events. In this case, the interface defines a Blink event, which is signaled from the BlinkM module, and caught by the implementation in BlinkerM. The application is built on the Blink program described in the TinyOS tutorial. Tools: None Known bugs/limitations: None See Also: --- NEW FILE: interfaces.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <link type="text/css" rel="stylesheet" href="main.css" /> <link type="text/css" rel="stylesheet" href="tutorial.css" /> <script language="JavaScript1.2" src="/main.js" type="text/javascript"></script> <link rel="SHORTCUT ICON" href="./images/favicon.ico" /> <title>TinyOS Tutorial: Handling events with interfaces</title> </head> <body> <h1>nesC Interfaces: abstracting definition from implementation</h1> <p> This lesson discusses the basic concept of interfaces in the nesC programming language. It includes an easy to understand example using the Blink application introduced in the TinyOS Lesson 1 Tutorial. </p> <h1>Introduction</h1> <p>Bug-free, maintainable software is rarely written first try. As code evolves, pieces are rewritten, refactored and improved. One large component may turn into several smaller components. Given enough common functionality between components, the behavior of a set of components may be defined independently of any particular implementation. <code>nesC</code> encourages such abstraction by the use of <em>interfaces</em>. In this tutorial, we will define an interface (<code>BlinkHandler.nc</code>) for handling blinks, and wrap the Blink application with a program that implements the BlinkHandler interface. </p> <h1>Componentizing Blink</h1> <p> To provide independence between the component that wants to blink an LED and the program that provides the actual blinking behavior, the Blink configuration needs to be slightly modified to remove Main: </p> <center> <table class="code"> <tbody> <tr> <td width="100%"> <b>Blink.nc</b> <pre> configuration Blink { provides { interface StdControl; interface BlinkHandler; } } implementation { components BlinkM, TimerC, LedsC; BlinkM.StdControl = StdControl; StdControl = TimerC; BlinkM.Timer -> TimerC.Timer[unique("Timer")]; BlinkM.Leds -> LedsC; BlinkM.BlinkHandler = BlinkHandler; } </pre> </td> </tr> </tbody> </table> </center> <p> In addition to removing the Main, we also specify that the BlinkHandler interface is implemented. Since this tutorial is being written during the holiday season, the Leds interface is retained so that Blink can fire a red LED while the BlinkHandler implementation fires a green LED. </p> <p> In the Blink module file (BlinkM.nc) we need to add a few lines of code: </p> <center> <table class="code"> <tbody> <tr> <td width="100%"> <b>BlinkM.nc</b> <pre> module BlinkM { provides { interface StdControl; interface BlinkHandler; } uses { interface Timer; interface Leds; } } implementation { ... event result_t Timer.fired() { signal BlinkHandler.Blink(); call Leds.redToggle(); return SUCCESS; } ... default event result_t BlinkHandler.Blink() { return SUCCESS; } ... } </pre> </td> </tr> </tbody> </table> </center> <p> Now when the timer fires, the BlinkHandler is signaled as well as toggling the red LED. Since the BlinkHandler interface is provided, a default Blink event is implemented. </p> <h2>The BlinkHandler interface</h2> The interface is really simple. The entire BlinkHandler.nc file consists of 3 lines of code: <center> <table class="code"> <tbody> <tr> <td width="100%"> <b>BlinkHandler.nc</b> <pre> interface BlinkHandler { event result_t Blink (); } </pre> </td> </tr> </tbody> </table> </center> <h2>The Blinker program</h2> <p> Since Blink is a component, not a program, it can't run by itself: something, somewhere with a Main needs to wire to it. The Blinker program fits the bill: </p> <center> <table class="code"> <tbody> <tr> <td width="100%"> <b>Blinker.nc</b> <pre> configuration Blinker { } implementation { components Main, Blink, LedsC, BlinkerM; Main.StdControl -> BlinkerM.StdControl; Main.StdControl -> Blink.StdControl; BlinkerM.Leds -> LedsC; BlinkerM.BlinkHandler -> Blink.BlinkHandler; } </pre> </td> </tr> </tbody> </table> </center> <h2>Catching the BlinkHandler.Blink event</h2> <p> The final bit is to provide an overriding event for for catching the BlinkHandler.Blink signal. This is implemented like so: </p> <center> <table class="code"> <tbody> <tr> <td width="100%"> <b>BlinkerM.nc</b> <pre> module BlinkerM { provides { interface StdControl; } uses { interface BlinkHandler; interface StdControl as Blink; interface Leds; } } implementation { // StdControl implementation. ... event result_t BlinkHandler.Blink() { call Leds.greenToggle(); return SUCCESS; } } </pre> </td> </tr> </tbody> </table> </center> <h1>Summary</h1> <p> nesC interfaces are indispenable for rapidly and accurately implementing reusable components. This tutorial and accompanying code is intended to help clarify some of the implementation details for creating and implementing interfaces. </p> <p> Comments and corrections to: doolin at ce dot berkeley dot edu. </p> <hr /> </body> </html> --- NEW FILE: main.css --- BODY, TD, P { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #000000;} .black { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #000000;} .grey { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #676767;} .white { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #FFFFFF;} a.white { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight:bold; color: #FFFFFF;} .orange {color: #FF6600;} .titlered {color: #960707; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; font-weight:bold;} .titleorange {color: #CC6633; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; font-weight:bold;} .red { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #990000;} .small {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; font-weight:normal;} a.nav-main { font-size: 10px; color: #FFFFFF; font-weight:bold; text-decoration:none; } a.nav-main:hover { font-size: 10px; color: #FFF; font-weight:bold; text-decoration:none; } a.nav-sub { font-size: 10px; color: #FFFFFF; text-decoration:none; } a.nav-sub:hover { font-size: 10px; color: #CCCCCC; text-decoration:none; } A { font-family: Verdana, Arial, Helvetica, sans-serif; color: #0066CC;} A:HOVER { color: #FF9900; text-decoration: underline;} A:HOVER.white { color: #FFFFDD; text-decoration: underline;} A:HOVER.black { color: #FF9900; text-decoration: underline;} A:HOVER.orange { color: #993300; text-decoration: underline;} A.small { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #0066CC;} .topnav { font-size: 10px;} .topnav_active {background-color:#FDCD85; color:#394D73; font-weight: bold; font-size: 10px;} a.topnav{font-weight: bold; text-decoration:none; color:#394D73;} a.topnav:hover{background-color:#FDCD85; color:#394D73; text-decoration:none;} .header { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px; color: #000000; font-weight: bold;} .headerwhite { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px; color: #FFFFFF; font-weight: bold;} .wl {font-family:verdana, Helvetica, Sans-Serif; font-size: 12px; font-weight:bold; color:#666633;} .wlt {font-family:verdana, Helvetica, Sans-Serif; font-size: 11px; color:#666633;} .blueh {font-family:verdana, Helvetica, Sans-Serif; font-size: 13px;font-weight:bold;color:#336699;} .bluet {font-family:verdana, Helvetica, Sans-Serif; font-size: 12px;color:#336699;} .bluetsml {font-family:verdana, Helvetica, Sans-Serif; font-size: 10px; color:#336699;} .bluetout {font-family:verdana, Helvetica, Sans-Serif; font-size: 10px;color:#336699;} .boldsmall {font-family:verdana, Helvetica, Sans-Serif; font-size: 10px;color:#000000; font-weight:bold} .spacer1p {margin-top:1px;} .spacer2p {margin-top:2px;} .spacer4p {margin-top:4px;} .spacer5p {margin-top:5px;} .spacer7p {margin-top:7px;} .spacer10p {margin-top:10px;} .spacer12p {margin-top:12px;} .spacer15p {margin-top:15px;} .spacer20p {margin-top:20px;} .spacer25p {margin-top:25px;} .navbox {margin-top:2px;} TR.NavRow TD { vertical-align: middle; border: 1px solid; border-color: #369 #003 #003; border-left: none; cursor: pointer; } .Nav { background-color: #384ccc; color: #fff; cursor: pointer; } .NavText, .NavHighlightText, .NavGroupText { font-family: verdana, arial, sans-serif; font-size: 10px; font-weight: bold; line-height: 14px; padding-left: 6px; text-decoration: none; } .Nav A:link, .Nav A:visited { color: #fff; Text-decoration: none;} .NavHilite { background-color: #5A6B94; color: #fff; } .NavHilite A:link, .NavHilite A:visited { color: #fff; } TR TD.NavHilite A:link, TR TD.NavHilite A:visited { text-decoration: none; } TR.NavHiliteRow TD { vertical-align: middle; border: 1px solid; border-color: #000 #5A6B94 #000; border-left: none; } --- NEW FILE: tutorial.css --- table.header { background-color:#e0e0ff; width:100%; font-family:tahoma,arial,helvetica; font-weight:bold; font-size:150%; } table.code { background-color:#e0e0e0; border:none; width:80%; } table.db_schema { background-color:#ffff66; border:solid; width:80%; font-size:75%; } table.new { width:50%; } tr.code { /*background-color:#ffff66; */ } tr.msg_header { background-color:#ffcc00; text-align:center; } td.code { padding:5px; width:100%; } h1 { background-color:#e0e0ff; /* color:#ffffff;*/ font-family:tahoma,helvetica,arial; font-size:150%; } h2 { background-color:#e0e0ff; //color:#ff3300; font-family:tahoma,helvetica,arial; font-size:100%; } code.progname { font-weight:bold; } BODY { color:black; background-color:#FFFFF5; } SPAN.title {color:green} SPAN.author {color:purple;} SPAN.publication {color:green} SPAN.fortran { font-variant: small-caps; } span.invisible { color:#FFFFF5; } P.abstract {color:blue; margin-left: 10%; /* width: 80%; */ margin-right: auto; /* background-color: gray; */ } /* a:active { color:red; } a:visited { color:yellow; background-color:blue; } a:link { color:green; } a:hover { color:green; font:bold; } */ /* IMG.inlinemath { text-align: bottom } */ /************************************************/ body { margin:9px 9px 0 9px; padding:0; background-color:#ffffff; } #level0{ background-color:#ffcc00; } #level1 { margin-left:143px; padding-left:9px; background-color:#FFFFFF; } #level2 { background:#FFF3AC; position:relative; } #level3 { margin-right:143px; padding-right:9px; background:#FFFFFF; } #main { background:#fff3ac; } #topBar { background:#ffffff; } #advBar { background:#fff3ac; } #tipDay { float:right; width:175px; background:#FFF3AC; } #lftBar { position:absolute; width:143px; top:9px; left:9px; } #rgtBar { position:absolute; width:143px; top:0; right:0; } |
From: <do...@us...> - 2003-12-13 00:48:26
|
Update of /cvsroot/firebug/firebug/project/src/Blinker In directory sc8-pr-cvs1:/tmp/cvs-serv20250/Blinker Log Message: Directory /cvsroot/firebug/firebug/project/src/Blinker added to the repository |
From: <do...@us...> - 2003-12-12 00:31:13
|
Update of /cvsroot/firebug/mts400/sensors/i2c In directory sc8-pr-cvs1:/tmp/cvs-serv7936/sensors/i2c Removed Files: fireboard.h Log Message: Moved fireboard header out of i2c drivers. --- fireboard.h DELETED --- |
From: <do...@us...> - 2003-12-12 00:31:13
|
Update of /cvsroot/firebug/mts400/apps In directory sc8-pr-cvs1:/tmp/cvs-serv7936/apps Modified Files: Makelocal Log Message: Moved fireboard header out of i2c drivers. Index: Makelocal =================================================================== RCS file: /cvsroot/firebug/mts400/apps/Makelocal,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makelocal 26 Nov 2003 18:38:44 -0000 1.5 --- Makelocal 12 Dec 2003 00:31:10 -0000 1.6 *************** *** 12,15 **** --- 12,16 ---- LOCAL_PATH += -I../../interfaces/ + LOCAL_PATH += -I../../sensorboards/mts420ca |
From: <do...@us...> - 2003-12-12 00:28:58
|
Update of /cvsroot/firebug/mts400/sensorboards/mts420ca In directory sc8-pr-cvs1:/tmp/cvs-serv7498 Added Files: fireboard.h Log Message: Added fireboard.h to better place, added msg enum into header. --- NEW FILE: fireboard.h --- /** tab:4 * * * "Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * */ /* tab:4 * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. By * downloading, copying, installing or using the software you agree to * this license. If you do not agree to this license, do not download, * install, copy or use the software. * * Intel Open Source License * * Copyright (c) 2002 Intel Corporation * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * */ /* * * @author David M. Doolin * * $Id: fireboard.h,v 1.1 2003/12/12 00:28:55 doolin Exp $ */ typedef struct _firedata { uint16_t addr; uint16_t cnt; float temp; float rel_hum; float baro_pres; } Firedata_msg; |
From: <do...@us...> - 2003-12-12 00:23:05
|
Update of /cvsroot/firebug/mts400/sensorboards/mts420ca In directory sc8-pr-cvs1:/tmp/cvs-serv6611/mts420ca Log Message: Directory /cvsroot/firebug/mts400/sensorboards/mts420ca added to the repository |
From: <do...@us...> - 2003-12-12 00:22:43
|
Update of /cvsroot/firebug/mts400/sensorboards In directory sc8-pr-cvs1:/tmp/cvs-serv6456/sensorboards Log Message: Directory /cvsroot/firebug/mts400/sensorboards added to the repository |
From: <do...@us...> - 2003-12-12 00:14:02
|
Update of /cvsroot/firebug/mts400/apps/TestFireBoard In directory sc8-pr-cvs1:/tmp/cvs-serv4522 Added Files: fireboardtest.nc Log Message: Added a test file for the component. --- NEW FILE: fireboardtest.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ includes sensorboard; includes fireboard; configuration fireboardtest { } implementation { components Main, fireboard; Main.StdControl -> fireboard; } |
From: <do...@us...> - 2003-12-12 00:13:29
|
Update of /cvsroot/firebug/mts400/apps/TestFireBoard In directory sc8-pr-cvs1:/tmp/cvs-serv4427 Modified Files: Makefile fireboard.nc fireboardM.nc Log Message: Cleaned up global fireboard driver. Index: Makefile =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestFireBoard/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 26 Nov 2003 18:38:45 -0000 1.1 --- Makefile 12 Dec 2003 00:13:26 -0000 1.2 *************** *** 1,3 **** ! COMPONENT=fireboard SENSORBOARD=gps include ../Makelocal --- 1,3 ---- ! COMPONENT=fireboardtest SENSORBOARD=gps include ../Makelocal Index: fireboard.nc =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestFireBoard/fireboard.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fireboard.nc 27 Nov 2003 00:04:27 -0000 1.2 --- fireboard.nc 12 Dec 2003 00:13:26 -0000 1.3 *************** *** 3,16 **** includes sensorboard; ! configuration fireboard { } implementation { ! components Main, ! fireboardM, MicaWbSwitch, UARTGpsPacket, --- 3,16 ---- includes sensorboard; ! includes fireboard; configuration fireboard { + provides interface StdControl; } implementation { ! components fireboardM, MicaWbSwitch, UARTGpsPacket, *************** *** 21,27 **** LedsC; ! Main.StdControl -> fireboardM.StdControl; ! Main.StdControl -> TimerC.StdControl; ! Main.StdControl -> MicaWbSwitch.StdControl; fireboardM.Leds -> LedsC; --- 21,26 ---- LedsC; ! fireboardM.StdControl = StdControl; ! fireboardM.WBSwitch -> MicaWbSwitch.StdControl; fireboardM.Leds -> LedsC; Index: fireboardM.nc =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestFireBoard/fireboardM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fireboardM.nc 26 Nov 2003 19:17:43 -0000 1.2 --- fireboardM.nc 12 Dec 2003 00:13:26 -0000 1.3 *************** *** 19,22 **** --- 19,23 ---- interface Timer as GlobalTimer; + interface StdControl as WBSwitch; interface StdControl as SwitchControl; interface Switch as PowerSwitch; *************** *** 36,48 **** //Intersema ! interface SplitControl as PressureControl; ! //interface StdControl as PressureControl; ! interface ADC as IntersemaTemp; ! interface ADC as IntersemaPressure; ! interface Calibration as IntersemaCal; ! interface SplitControl as TaosControl; ! interface ADC as TaosCh0; ! interface ADC as TaosCh1; } --- 37,49 ---- //Intersema ! interface SplitControl as PressureControl; ! //interface StdControl as PressureControl; ! interface ADC as IntersemaTemp; ! interface ADC as IntersemaPressure; ! interface Calibration as IntersemaCal; ! interface SplitControl as TaosControl; ! interface ADC as TaosCh0; ! interface ADC as TaosCh1; } *************** *** 55,59 **** #include "SODebug.h" #include "gps.h" ! #define DBG_USR2 0 --- 56,60 ---- #include "SODebug.h" #include "gps.h" ! #define DBG_USR2 1 *************** *** 65,68 **** --- 66,70 ---- #define GPS_ONE_SHOT 1 + Firedata_msg firemsg; //char state; *************** *** 80,84 **** MAIN_SWITCH_ON, MAIN_SWITCH_OFF, WAIT_SWITCH_ON, WAIT_SWITCH_OFF, TIMER, ! GPS_DONE, SHT_DONE, HUMIDITY_DONE, PRESSURE_DONE, LIGHT_DONE}; --- 82,86 ---- MAIN_SWITCH_ON, MAIN_SWITCH_OFF, WAIT_SWITCH_ON, WAIT_SWITCH_OFF, TIMER, ! GPS_DONE, SHT_DONE, HUMIDITY_DONE, PRESSURE_DONE, LIGHT_DONE, DATA_DONE}; *************** *** 95,101 **** command result_t StdControl.init() { init_debug(); - state1 = IDLE; call Leds.init(); /** Control.init in GpsPacket.nc */ call GpsControl.init(); --- 97,105 ---- command result_t StdControl.init() { + state1 = IDLE; init_debug(); call Leds.init(); + //call GlobalTimer.init(); + //call MicaWbSwitch.init(); /** Control.init in GpsPacket.nc */ call GpsControl.init(); *************** *** 108,122 **** call Leds.redOn(); - call HumidityError.enable(); //in case Sensirion doesn't respond call TemperatureError.enable(); // " - - /** Control.start in GpsPacket.nc, calls - * SwitchControl.start and ByteControl.start() - * Move those functions up here out of the GPS - * driver, then abstract the sensorboard - * component away. - */ - //call GpsControl.start(); call GlobalTimer.start(TIMER_REPEAT, 3000) ; return SUCCESS; --- 112,117 ---- *************** *** 138,142 **** } - /** Ok, this function turns on the gps unit for reading, * which is turned of elsewhere when the read is finished. --- 133,136 ---- *************** *** 146,149 **** --- 140,149 ---- call Leds.greenToggle(); + /** Control.start in GpsPacket.nc, calls + * SwitchControl.start and ByteControl.start() + * Move those functions up here out of the GPS + * driver, then abstract the sensorboard + * component away. + */ call GpsControl.start(); *************** *** 157,164 **** event result_t GlobalTimer.fired() { switch (state1) { case BUSY: - SODbg(DBG_USR2, "gps_sht_baroM.GlobalTimer.fired(), BUSY\n"); break; --- 157,165 ---- event result_t GlobalTimer.fired() { + SODbg(DBG_USR2, "fireboardM.GlobalTimer.fired()\n"); + switch (state1) { case BUSY: break; *************** *** 385,389 **** async event result_t Humidity.dataReady(uint16_t data) { ! SODbg(DBG_USR2, "gsp_shtM.Humidity.dataReady()\n") atomic { --- 386,390 ---- async event result_t Humidity.dataReady(uint16_t data) { ! SODbg(DBG_USR2, "gps_shtM.Humidity.dataReady()\n") atomic { *************** *** 601,605 **** return SUCCESS; } - } --- 602,605 ---- |
From: <do...@us...> - 2003-12-02 03:26:12
|
Update of /cvsroot/firebug/mts400/interfaces In directory sc8-pr-cvs1:/tmp/cvs-serv22690/interfaces Added Files: Data.nc Log Message: Added a simple interface for convenience. --- NEW FILE: Data.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** * "Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * */ /** * $Id: Data.nc,v 1.1 2003/12/01 23:21:07 doolin Exp $ */ /** * The implementing program provide the call. * * @author David M. Doolin */ interface Data { event result_t dataReady(void * userdata); } |
From: <che...@us...> - 2003-11-30 00:47:50
|
Update of /cvsroot/firebug/firebug/project/src/sensordata In directory sc8-pr-cvs1:/tmp/cvs-serv4676 Modified Files: sensormsg.h Log Message: . Index: sensormsg.h =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/sensordata/sensormsg.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sensormsg.h 30 Jul 2003 23:43:17 -0000 1.2 --- sensormsg.h 30 Nov 2003 00:47:47 -0000 1.3 *************** *** 61,68 **** uint16_t addr; uint16_t cnt; float temp; ! float rel_hum; ! float baro_pres; ! uint16_t rss; }; --- 61,75 ---- uint16_t addr; uint16_t cnt; + uint8_t hours; + uint8_t minutes; + uint16_t dec_sec; + uint8_t Lat_deg; + uint16_t Lat_dec_min; + uint8_t Long_deg; + uint8_t Long_dec_min; + uint8_t NSEWind; float temp; ! //float rel_hum; ! // float baro_pres; }; |
From: <che...@us...> - 2003-11-30 00:22:02
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv565 Modified Files: db_create.php db_table_select.php Log Message: schema changed Index: db_create.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/db_create.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** db_create.php 30 Jul 2003 22:16:10 -0000 1.9 --- db_create.php 30 Nov 2003 00:21:59 -0000 1.10 *************** *** 38,45 **** mysql_query($statement) or die("Error: ".mysql_error()." in creating location atable"); ! $statement = "CREATE TABLE current (mote_id INTEGER, time TIMESTAMP, temp FLOAT, rel_hum FLOAT, baro_pres FLOAT, cnt INTEGER, rss INTEGER)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating current atable"); ! $statement = "CREATE TABLE cumulative (mote_id INTEGER, time TIMESTAMP, temp FLOAT, rel_hum FLOAT, baro_pres FLOAT, cnt INTEGER, rss INTEGER)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating cumulative atable"); --- 38,45 ---- mysql_query($statement) or die("Error: ".mysql_error()." in creating location atable"); ! $statement = "CREATE TABLE current (mote_id INTEGER, time TIMESTAMP, hours INTEGER, minutes INTEGER, dec_sec INTEGER, Lat_deg INTEGER, Lat_dec_min INTEGER, Long_deg INTEGER, Long_dec_min INTEGER, NSEWind INTEGER, temp FLOAT, cnt INTEGER)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating current atable"); ! $statement = "CREATE TABLE cumulative (mote_id INTEGER, time TIMESTAMP, hours INTEGER, minutes INTEGER, dec_sec INTEGER, Lat_deg INTEGER, Lat_dec_min INTEGER, Long_deg INTEGER, Long_dec_min INTEGER, NSEWind INTEGER, temp FLOAT, cnt INTEGER)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating cumulative atable"); *************** *** 53,57 **** for ($i = 2; $i <= $nummotes+1; $i++) { ! $statement = "insert into current values ($i,NULL,NULL,NULL,NULL,NULL,NULL);"; print "<br />"; print $statement; --- 53,57 ---- for ($i = 2; $i <= $nummotes+1; $i++) { ! $statement = "insert into current values ($i,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);"; print "<br />"; print $statement; Index: db_table_select.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/db_table_select.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_table_select.php 4 Aug 2003 16:17:29 -0000 1.1 --- db_table_select.php 30 Nov 2003 00:22:00 -0000 1.2 *************** *** 51,59 **** <td>Mote ID</td> <td>Time</td> <td>Temp</td> <td>Rel. Hum.</td> <td>Baro. Pres.</td> <td>Cnt </td> - <td>Rss </td> </tr> --- 51,66 ---- <td>Mote ID</td> <td>Time</td> + <td>Hours</td> + <td>Minutes</td> + <td>Dec_sec</td> + <td>Lat_deg</td> + <td>Lat_dec_min</td> + <td>Long_deg</td> + <td>Long_dec_min</td> + <td>NSEWind</td> <td>Temp</td> <td>Rel. Hum.</td> <td>Baro. Pres.</td> <td>Cnt </td> </tr> *************** *** 75,78 **** --- 82,118 ---- } + if ($hours == "") { + $hours = "%"; + } + + if ($minutes == "") { + $minutes = "%"; + } + + if ($dec_sec == "") { + $dec_sec = "%"; + } + + if ($Lat_deg == "") { + $Lat_deg = "%"; + } + + + if ($Lat_dec_min == "") { + $Lat_dec_min = "%"; + } + + if ($Long_deg == "") { + $Long_deg = "%"; + } + + if ($Long_dec_min == "") { + $Long_dec_min = "%"; + } + + if ($NSEWind == "") { + $NSEWind = "%"; + } + if ($temp == "") { $temp = "%"; *************** *** 87,94 **** } - if ($rss == "") { - $rss = "%"; - } - $result = mysql_query("select * from $tblname --- 127,130 ---- *************** *** 96,103 **** and time like '$time%' and cnt like '$cnt%' ! and rss like '$rss%' ! and temp like '$temp%' ! and rel_hum like '$rel_hum%' ! and baro_pres like '$baro_pres%'") or die("Error: ".mysql_error()." in query."); --- 132,146 ---- and time like '$time%' and cnt like '$cnt%' ! and hours like '$hours%' ! and minutes like '$minutes%' ! and dec_sec like '$dec_sec%' ! and Lat_deg like '$Lat_deg%' ! and Lat_dec_min like '$Lat_dec_min%' ! and Long_deg like '$Long_deg%' ! and Long_dec_min like '$Long_dec_min%' ! and NSEWind like '$NSEWind%' ! and temp like '$temp%'") ! //and rel_hum like '$rel_hum%' ! //and baro_pres like '$baro_pres%'" or die("Error: ".mysql_error()." in query."); *************** *** 119,140 **** print ("<td>"); ! print $row["temp"]; print ("</td>"); print ("<td>"); ! print $row["rel_hum"]; print ("</td>"); print ("<td>"); ! print $row["baro_pres"]; print ("</td>"); print ("<td>"); ! print $row["cnt"]; print ("</td>"); print ("<td>"); ! print $row["rss"]; print ("</td>"); print ("</tr>"); --- 162,205 ---- print ("<td>"); ! print $row["hours"]; print ("</td>"); print ("<td>"); ! print $row["minutes"]; print ("</td>"); print ("<td>"); ! print $row["dec_sec"]; print ("</td>"); print ("<td>"); ! print $row["Lat_deg"]; print ("</td>"); print ("<td>"); ! print $row["Lat_dec_min"]; ! print ("</td>"); ! ! print ("<td>"); ! print $row["Long_deg"]; ! print ("</td>"); ! ! print ("<td>"); ! print $row["Long_dec_min"]; print ("</td>"); + + print ("<td>"); + print $row["NSEWind"]; + print ("</td>"); + + print ("<td>"); + print $row["temp"]; + print ("</td>"); + + print ("<td>"); + print $row["cnt"]; + print ("</td>"); + + print ("</tr>"); |
From: <do...@us...> - 2003-11-27 00:05:26
|
Update of /cvsroot/firebug/mts400/sensors/i2c In directory sc8-pr-cvs1:/tmp/cvs-serv2028/i2c Added Files: fireboard.h Log Message: Adding files for fire bug data. --- NEW FILE: fireboard.h --- /** tab:4 * * * "Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * */ /* tab:4 * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. By * downloading, copying, installing or using the software you agree to * this license. If you do not agree to this license, do not download, * install, copy or use the software. * * Intel Open Source License * * Copyright (c) 2002 Intel Corporation * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * */ /* * * @author David M. Doolin * * $Id: fireboard.h,v 1.1 2003/11/27 00:05:23 doolin Exp $ */ typedef struct _firedata { uint16_t addr; uint16_t cnt; float temp; float rel_hum; float baro_pres; } Firedata_msg; |
From: <do...@us...> - 2003-11-27 00:04:32
|
Update of /cvsroot/firebug/mts400/sensors/intersema In directory sc8-pr-cvs1:/tmp/cvs-serv1851/mts400/sensors/intersema Modified Files: IntersemaPressureM.nc Log Message: Added some more testing files to the fireboard driver. Index: IntersemaPressureM.nc =================================================================== RCS file: /cvsroot/firebug/mts400/sensors/intersema/IntersemaPressureM.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IntersemaPressureM.nc 13 Nov 2003 00:10:06 -0000 1.1 --- IntersemaPressureM.nc 27 Nov 2003 00:04:28 -0000 1.2 *************** *** 34,42 **** #include "SODebug.h" ! #define DBG_USR2 0 //disables printf msgs ! enum { IDLE, WARM_UP, WAIT_SWITCH_ON, WAIT_SWITCH_OFF, BUSY, ! MAIN_SWITCH_ON, MAIN_SWITCH_OFF, SWITCH_IO1, SWITCH_IO2, SWITCH_IO3, ! POWERON, POWEROFF, IOON = 1, IOOFF = 0 }; // FIXME: Remove the norace and fix the rest of the atomic r/w warnings. --- 34,53 ---- #include "SODebug.h" ! #define DBG_USR2 0 //disables printf msgs ! enum { IDLE, ! WARM_UP, ! WAIT_SWITCH_ON, ! WAIT_SWITCH_OFF, ! BUSY, ! MAIN_SWITCH_ON, ! MAIN_SWITCH_OFF, ! SWITCH_IO1, ! SWITCH_IO2, ! SWITCH_IO3, ! POWERON, ! POWEROFF, ! IOON = 1, ! IOOFF = 0 }; // FIXME: Remove the norace and fix the rest of the atomic r/w warnings. *************** *** 62,68 **** } - task void IOBus() { ! atomic { if (state == BUSY) { --- 73,83 ---- } ! ! /** The #define'd MICAWB_PRESSURE_* are in sensorboard.h. ! * iostate is IOON = 1, IOOF = 0. Somehow, this is ! * screwing up the GPS unit from reading. ! */ ! task void IOBus() { if (state == BUSY) { *************** *** 72,86 **** } else if (state == SWITCH_IO1) { ! SODbg(DBG_USR2, "IntesemaPressure.IoBus.SCLK switch set \n"); state = SWITCH_IO2; call IOSwitch.set(MICAWB_PRESSURE_DIN, iostate); } else if (state == SWITCH_IO2) { ! SODbg(DBG_USR2, "IntesemaPressure.IoBus.Din switch set \n"); state = SWITCH_IO3; call IOSwitch.set(MICAWB_PRESSURE_DOUT, iostate); } else if (state == SWITCH_IO3) { ! SODbg(DBG_USR2, "IntesemaPressure.IOBus.all switches set \n"); state = IDLE; atomic { --- 87,101 ---- } else if (state == SWITCH_IO1) { ! SODbg(DBG_USR2, "IntersemaPressure.IoBus.SCLK switch set \n"); state = SWITCH_IO2; call IOSwitch.set(MICAWB_PRESSURE_DIN, iostate); } else if (state == SWITCH_IO2) { ! SODbg(DBG_USR2, "IntersemaPressure.IoBus.Din switch set \n"); state = SWITCH_IO3; call IOSwitch.set(MICAWB_PRESSURE_DOUT, iostate); } else if (state == SWITCH_IO3) { ! SODbg(DBG_USR2, "IntersemaPressure.IOBus.all switches set \n"); state = IDLE; atomic { *************** *** 93,97 **** } } ! } // else if (iostate == IOOFF) { // call LowerControl.stop(); --- 108,112 ---- } } ! // else if (iostate == IOOFF) { // call LowerControl.stop(); *************** *** 120,124 **** command result_t SplitControl.start() { ! SODbg(DBG_USR2, "IntersemaPressure.start: turning on power \n"); state = MAIN_SWITCH_ON; call SwitchControl.start(); --- 135,139 ---- command result_t SplitControl.start() { ! SODbg(DBG_USR2, "IntersemaPressureM.SplitControl.start: turning on power \n"); state = MAIN_SWITCH_ON; call SwitchControl.start(); *************** *** 131,139 **** command result_t SplitControl.stop() { ! SODbg(DBG_USR2, "IntersemaPressure.stop: turning off power \n"); state = MAIN_SWITCH_OFF; call SwitchControl.start(); if (call Switch.set(MICAWB_PRESSURE_POWER,0) != SUCCESS) { ! SODbg(DBG_USR2, "IntersemaPressure.stop: failed to get bus \n"); state = WAIT_SWITCH_OFF; } --- 146,154 ---- command result_t SplitControl.stop() { ! SODbg(DBG_USR2, "IntersemaPressureM.SplitControl.stop: turning off power \n"); state = MAIN_SWITCH_OFF; call SwitchControl.start(); if (call Switch.set(MICAWB_PRESSURE_POWER,0) != SUCCESS) { ! SODbg(DBG_USR2, "IntersemaPressureM.SplitControl.stop: failed to get bus \n"); state = WAIT_SWITCH_OFF; } *************** *** 150,153 **** --- 165,169 ---- if (state == WAIT_SWITCH_ON) { + SODbg(DBG_USR2, "IntersemaPressureM.Switch.setDone(): WAIT_SWITCH_ON\n"); if (call Switch.set(MICAWB_PRESSURE_POWER,1) == SUCCESS) { state = MAIN_SWITCH_ON; *************** *** 155,158 **** --- 171,175 ---- } else if (state == WAIT_SWITCH_OFF) { + SODbg(DBG_USR2, "IntersemaPressureM.Switch.setDone(): WAIT_SWITCH_OFF\n"); if (call Switch.set(MICAWB_PRESSURE_POWER,0) == SUCCESS) { state = MAIN_SWITCH_OFF; *************** *** 161,165 **** else if (state == MAIN_SWITCH_ON) { ! SODbg(DBG_USR2, "IntesemaPressure.start: power on, timer activated \n"); atomic { iostate = IOON; --- 178,182 ---- else if (state == MAIN_SWITCH_ON) { ! SODbg(DBG_USR2, "IntersemaPressureM.Switch.setDone(): MAIN_SWITCH_ON\n"); atomic { iostate = IOON; *************** *** 167,173 **** state = BUSY; post IOBus(); //turn on other switches ! return SUCCESS; } else if (state == MAIN_SWITCH_OFF) { state = BUSY; atomic { --- 184,191 ---- state = BUSY; post IOBus(); //turn on other switches ! return SUCCESS; } else if (state == MAIN_SWITCH_OFF) { + SODbg(DBG_USR2, "IntersemaPressureM.Switch.setDone(): MAIN_SWITCH_OFF\n"); state = BUSY; atomic { *************** *** 175,180 **** } post IOBus(); ! // post stopDone(); ! // state = POWEROFF; } return SUCCESS; --- 193,198 ---- } post IOBus(); ! //post stopDone(); ! //state = POWEROFF; } return SUCCESS; *************** *** 192,195 **** --- 210,216 ---- //turn on/off all the I/O switches event result_t IOSwitch.setDone(bool l_result) { + + SODbg(DBG_USR2, "IntersemaPressure.IOSwitch.setDone() \n"); + if ((state == SWITCH_IO1) || (state == SWITCH_IO2) || (state == SWITCH_IO3)) { post IOBus(); *************** *** 205,209 **** event result_t Timer.fired() { if (state == WARM_UP) { ! SODbg(DBG_USR2, "IntesemaPressure.Timer.fired \n"); state = BUSY; post IOBus(); --- 226,230 ---- event result_t Timer.fired() { if (state == WARM_UP) { ! SODbg(DBG_USR2, "IntersemaPressure.Timer.fired \n"); state = BUSY; post IOBus(); *************** *** 286,290 **** if (state == IDLE) { ! SODbg(DBG_USR2, "IntesemaPressure.Calibration.getData \n"); state = BUSY; call LowerControl.start(); --- 307,311 ---- if (state == IDLE) { ! SODbg(DBG_USR2, "IntersemaPressure.Calibration.getData \n"); state = BUSY; call LowerControl.start(); |
From: <do...@us...> - 2003-11-27 00:04:31
|
Update of /cvsroot/firebug/mts400/sensors/i2c In directory sc8-pr-cvs1:/tmp/cvs-serv1851/mts400/sensors/i2c Modified Files: SODebug.h Log Message: Added some more testing files to the fireboard driver. Index: SODebug.h =================================================================== RCS file: /cvsroot/firebug/mts400/sensors/i2c/SODebug.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SODebug.h 12 Nov 2003 23:52:42 -0000 1.1 --- SODebug.h 27 Nov 2003 00:04:28 -0000 1.2 *************** *** 12,15 **** --- 12,16 ---- //init comm port (56K baud, mica2 only, use 19K baud for mica2dot, mica....) for debug // call this from startup routine + // Consider making this call idempotent void init_debug(){ outp(0,UBRR0H); *************** *** 20,24 **** outp((1 << TXEN) ,UCSR0B); // Enable uart reciever and transmitter } ! //init comm port (19K baud) for mica2dot for debug // call this from startup routine --- 21,25 ---- outp((1 << TXEN) ,UCSR0B); // Enable uart reciever and transmitter } ! //init comm port (19K baud) for mica2dot for debug // call this from startup routine *************** *** 31,51 **** outp((1 << TXEN) ,UCSR0B); } ! ! // output a char to the uart ! void UARTPutChar(char c) { ! if (c == '\n') ! UARTPutChar('\r'); ! loop_until_bit_is_set(UCSR0A, UDRE); ! outb(UDR0,c); ! } ! ! void writedebug() { int i = 0; ! UARTPutChar('\n'); //write a carriage return 1st ! while (debugbuf[i] != '\n') ! UARTPutChar(debugbuf[i++]); ! // UARTPutChar('\n'); ! ! } #define SPRINTF //use this sprintf function #ifdef SPRINTF --- 32,52 ---- outp((1 << TXEN) ,UCSR0B); } ! ! // output a char to the uart ! void UARTPutChar(char c) { ! if (c == '\n') ! UARTPutChar('\r'); ! loop_until_bit_is_set(UCSR0A, UDRE); ! outb(UDR0,c); ! } ! ! void writedebug() { int i = 0; ! UARTPutChar('\n'); //write a carriage return 1st ! while (debugbuf[i] != '\n') ! UARTPutChar(debugbuf[i++]); ! // UARTPutChar('\n'); ! ! } #define SPRINTF //use this sprintf function #ifdef SPRINTF *************** *** 123,140 **** #define SO_NO_DEBUG 0 #define SO_DEBUG //turn on debug output ! #ifdef SO_DEBUG ! #define SODbg(__x,__args...) { \ ! char bStatus; \ if(__x != SO_NO_DEBUG){ \ ! bStatus=bit_is_set(SREG,7); \ ! cli(); \ sprintf(debugbuf,__args); \ ! writedebug(); \ ! if (bStatus) sei(); \ } \ ! } #else #define SODbg(__x,__args...) ! #endif ! ! --- 124,141 ---- #define SO_NO_DEBUG 0 #define SO_DEBUG //turn on debug output ! #ifdef SO_DEBUG ! #define SODbg(__x,__args...) { \ ! char bStatus; \ if(__x != SO_NO_DEBUG){ \ ! bStatus=bit_is_set(SREG,7); \ ! cli(); \ sprintf(debugbuf,__args); \ ! writedebug(); \ ! if (bStatus) sei(); \ } \ ! } #else #define SODbg(__x,__args...) ! #endif ! ! |
From: <do...@us...> - 2003-11-27 00:04:31
|
Update of /cvsroot/firebug/mts400/apps/TestTaos In directory sc8-pr-cvs1:/tmp/cvs-serv1851/mts400/apps/TestTaos Modified Files: taosM.nc Log Message: Added some more testing files to the fireboard driver. Index: taosM.nc =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestTaos/taosM.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** taosM.nc 13 Nov 2003 00:13:39 -0000 1.1 --- taosM.nc 27 Nov 2003 00:04:28 -0000 1.2 *************** *** 36,40 **** #include "SODebug.h" ! enum {START, BUSY, LIGHT_DONE, ACCEL_DONE}; --- 36,40 ---- #include "SODebug.h" ! #define DBG_USR2 0 enum {START, BUSY, LIGHT_DONE, ACCEL_DONE}; |
From: <do...@us...> - 2003-11-27 00:04:30
|
Update of /cvsroot/firebug/mts400/apps/TestFireBoard In directory sc8-pr-cvs1:/tmp/cvs-serv1851/mts400/apps/TestFireBoard Modified Files: fireboard.nc Log Message: Added some more testing files to the fireboard driver. Index: fireboard.nc =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestFireBoard/fireboard.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fireboard.nc 26 Nov 2003 18:38:45 -0000 1.1 --- fireboard.nc 27 Nov 2003 00:04:27 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- includes sensorboard; + configuration fireboard { |
From: <do...@us...> - 2003-11-26 19:17:46
|
Update of /cvsroot/firebug/mts400/apps/TestFireBoard In directory sc8-pr-cvs1:/tmp/cvs-serv7379 Modified Files: fireboardM.nc Log Message: Turned off debugging. Index: fireboardM.nc =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestFireBoard/fireboardM.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fireboardM.nc 26 Nov 2003 18:38:45 -0000 1.1 --- fireboardM.nc 26 Nov 2003 19:17:43 -0000 1.2 *************** *** 55,58 **** --- 55,60 ---- #include "SODebug.h" #include "gps.h" + #define DBG_USR2 0 + /** 0 means GPS runs forever, 1 means it takes one reading *************** *** 300,303 **** --- 302,306 ---- call Leds.greenToggle(); + #if DBG_USR2 for (i=0; i<=gps_data->data[0]; i++) { /** UARTPutChar is an SODebug function. *************** *** 307,311 **** } SODbg(DBG_USR2, "\n"); ! /** FIXME: Pulled the preprocessor define out, --- 310,314 ---- } SODbg(DBG_USR2, "\n"); ! #endif /** FIXME: Pulled the preprocessor define out, |
From: <do...@us...> - 2003-11-26 18:38:48
|
Update of /cvsroot/firebug/mts400/apps/TestFireBoard In directory sc8-pr-cvs1:/tmp/cvs-serv31741/TestFireBoard Added Files: .cvsignore Makefile fireboard.nc fireboardM.nc Log Message: FireBoard with gps, light, temp, hum and pressure now works together. --- NEW FILE: .cvsignore --- build *~ --- NEW FILE: Makefile --- COMPONENT=fireboard SENSORBOARD=gps include ../Makelocal include $(TOSROOT)/apps/Makerules --- NEW FILE: fireboard.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ includes sensorboard; configuration fireboard { } implementation { components Main, fireboardM, MicaWbSwitch, UARTGpsPacket, IntersemaPressure, SensirionHumidity, TaosPhoto, TimerC, LedsC; Main.StdControl -> fireboardM.StdControl; Main.StdControl -> TimerC.StdControl; Main.StdControl -> MicaWbSwitch.StdControl; fireboardM.Leds -> LedsC; fireboardM.GlobalTimer -> TimerC.Timer[unique("Timer")]; fireboardM.PowerSwitch -> MicaWbSwitch.Switch[0]; fireboardM.IOSwitch -> MicaWbSwitch.Switch[1]; fireboardM.GpsControl -> UARTGpsPacket; fireboardM.GpsSend -> UARTGpsPacket; fireboardM.GpsReceive -> UARTGpsPacket; fireboardM.GpsCmd -> UARTGpsPacket.GpsCmd; // Wiring for Sensirion humidity/temperature sensor fireboardM.TempHumControl -> SensirionHumidity; fireboardM.Humidity -> SensirionHumidity.Humidity; fireboardM.Temperature -> SensirionHumidity.Temperature; fireboardM.HumidityError -> SensirionHumidity.HumidityError; fireboardM.TemperatureError -> SensirionHumidity.TemperatureError; // Wiring for Intersema barometric pressure/temperature sensor fireboardM.IntersemaCal -> IntersemaPressure; fireboardM.PressureControl -> IntersemaPressure; fireboardM.IntersemaPressure -> IntersemaPressure.Pressure; fireboardM.IntersemaTemp -> IntersemaPressure.Temperature; fireboardM.TaosControl -> TaosPhoto; fireboardM.TaosCh0 -> TaosPhoto.ADC[0]; fireboardM.TaosCh1 -> TaosPhoto.ADC[1]; } --- NEW FILE: fireboardM.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ module fireboardM { provides { interface StdControl; command void readGps(); command void stopGps(); } uses { interface Leds; interface Timer as GlobalTimer; interface StdControl as SwitchControl; interface Switch as PowerSwitch; interface Switch as IOSwitch; interface StdControl as GpsControl; interface I2CSwitchCmds as GpsCmd; interface BareSendMsg as GpsSend; interface ReceiveMsg as GpsReceive; interface SplitControl as TempHumControl; interface ADC as Humidity; interface ADC as Temperature; interface ADCError as HumidityError; interface ADCError as TemperatureError; //Intersema interface SplitControl as PressureControl; //interface StdControl as PressureControl; interface ADC as IntersemaTemp; interface ADC as IntersemaPressure; interface Calibration as IntersemaCal; interface SplitControl as TaosControl; interface ADC as TaosCh0; interface ADC as TaosCh1; } } implementation { #include "SODebug.h" #include "gps.h" /** 0 means GPS runs forever, 1 means it takes one reading * and powers down. * FIXME: The GPS sensor powers back up after it powers down, * this should not happen and is a problem. */ #define GPS_ONE_SHOT 1 //char state; char gps_state; char switch_state; char state1; uint16_t TaosData; enum {IDLE, BUSY, BUSY_0, BUSY_1, GET_SAMPLE_0, GET_SAMPLE_1, OPENSCK, OPENDATA, CLOSESCK, CLOSEDATA, POWEROFF, MAIN_SWITCH_ON, MAIN_SWITCH_OFF, WAIT_SWITCH_ON, WAIT_SWITCH_OFF, TIMER, GPS_DONE, SHT_DONE, HUMIDITY_DONE, PRESSURE_DONE, LIGHT_DONE}; uint16_t HumData; //Intersema variables uint16_t calibration[6]; uint16_t C1,C2,C3,C4,C5,C6; uint16_t PressureData; char count; command result_t StdControl.init() { init_debug(); state1 = IDLE; call Leds.init(); /** Control.init in GpsPacket.nc */ call GpsControl.init(); call TempHumControl.init(); call PressureControl.init(); return SUCCESS; } command result_t StdControl.start() { call Leds.redOn(); call HumidityError.enable(); //in case Sensirion doesn't respond call TemperatureError.enable(); // " /** Control.start in GpsPacket.nc, calls * SwitchControl.start and ByteControl.start() * Move those functions up here out of the GPS * driver, then abstract the sensorboard * component away. */ //call GpsControl.start(); call GlobalTimer.start(TIMER_REPEAT, 3000) ; return SUCCESS; } command result_t StdControl.stop() { call GlobalTimer.stop(); return SUCCESS; } command void stopGps() { if (call GpsCmd.PowerSwitch(GPS_POWER_OFF)) { SODbg(DBG_USR2, "gps_sht_baroM.stopGps.stop(): GPS sensor powered off. \n"); } state1 = GPS_DONE; } /** Ok, this function turns on the gps unit for reading, * which is turned of elsewhere when the read is finished. * If the read isn't finished, the function exits. */ command void readGps() { call Leds.greenToggle(); call GpsControl.start(); /* Implementation is in GpsPacket.nc */ if (call GpsCmd.PowerSwitch(GPS_POWER_ON)) { SODbg(DBG_USR2, "gps_sht_baroM.readGps(): GPS powered on\n"); } } event result_t GlobalTimer.fired() { switch (state1) { case BUSY: SODbg(DBG_USR2, "gps_sht_baroM.GlobalTimer.fired(), BUSY\n"); break; case IDLE: state1 = BUSY; call readGps(); break; case GPS_DONE: state1 = BUSY; call TempHumControl.start(); break; case SHT_DONE: state1 = BUSY; call PressureControl.start(); break; case PRESSURE_DONE: state1 = BUSY; call TaosControl.start(); break; case LIGHT_DONE: state1 = IDLE; break; default: break; } return SUCCESS; } event result_t PowerSwitch.getDone(char value) { return SUCCESS; } /** FIXME: Make sure we don't need the startDone, stopDone * calls. Where is this called from? */ event result_t PowerSwitch.setDone(bool local_result) { switch(switch_state) { case MAIN_SWITCH_ON: SODbg(DBG_USR2, "PowerSwitch.setDone() MAIN_SWITCH_ON\n"); switch_state = IDLE; /** GpsControl is wired to GpsPacket.nc */ //signal GpsControl.startDone(); break; case MAIN_SWITCH_OFF: SODbg(DBG_USR2, "PowerSwitch.setDone() MAIN_SWITCH_OFF\n"); switch_state = POWEROFF; /** GpsControl is wired to GpsPacket.nc */ //signal GpsControl.stopDone(); break; case WAIT_SWITCH_ON: SODbg(DBG_USR2, "PowerSwitch.setDone() WAIT_SWITCH_ON\n"); if (call PowerSwitch.set(MICAWB_GPS_POWER,1) == SUCCESS) { switch_state = MAIN_SWITCH_ON; } break; case WAIT_SWITCH_OFF: SODbg(DBG_USR2, "PowerSwitch.setDone() WAIT_SWITCH_OFF\n"); if (call PowerSwitch.set(MICAWB_GPS_POWER,0) == SUCCESS) { switch_state = MAIN_SWITCH_OFF; } default: break; } return SUCCESS; } event result_t PowerSwitch.setAllDone(bool local_result) { return SUCCESS; } event result_t IOSwitch.getDone(char value) { return SUCCESS; } event result_t IOSwitch.setAllDone(bool local_result) { return SUCCESS; } /** FIXME: Rewrite this with a switch/case. */ /** FIXME: I see no reason why we need I2C information this * high in the application. All this I2C bus info needs * to be shoved down a level, and wired from here to something * like turnSensorOn(), turnSensorOff(), etc. */ event result_t IOSwitch.setDone(bool local_result) { //SODbg(DBG_USR2, "gps_sht_baroM.IOSwitch.setDone(): state: %i \n", state); if (switch_state == OPENSCK) { //SCK line enabled SODbg(DBG_USR2, "gps_sht_baroM.IOSwitch.setDone(): SCK enabled \n"); switch_state = OPENDATA; return call IOSwitch.set(MICAWB_HUMIDITY_DATA,1); } else if (switch_state == OPENDATA) { //Data line enabled SODbg(DBG_USR2, "gps_sht_baroM.IOSwitch.setDone(): SDA enabled \n"); switch_state = TIMER; SODbg(DBG_USR2, "gps_sht_baroM.IOSwitch.setDone(): Timer Started, state: %i \n", switch_state); //call GPSTimer.start(TIMER_ONE_SHOT, 100); return SUCCESS; } else if (switch_state == CLOSESCK) { switch_state = CLOSEDATA; SODbg(DBG_USR2, "gps_sht_baroM.IOSwitch.setDone(): SCK disabled \n"); return call IOSwitch.set(MICAWB_HUMIDITY_DATA,0); } else if (switch_state == CLOSEDATA) { SODbg(DBG_USR2, "gps_sht_baroM.IOSwitch.setDone(): SDA disabled \n"); } return SUCCESS; } /** * Packet received from GPS - ASCII msg * 1st byte in pkt is number of ascii bytes * async used only for testing. * * FIXME: Why is the data returned? It's passed in. * It should be declared const. * * This function is called from GpsPacket.receiveTask(). */ event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { uint8_t i; GPS_MsgPtr gps_data = (GPS_MsgPtr)data; call Leds.greenToggle(); for (i=0; i<=gps_data->data[0]; i++) { /** UARTPutChar is an SODebug function. * FIXME: Change this to use a char[]. */ UARTPutChar(gps_data->data[i]); } SODbg(DBG_USR2, "\n"); /** FIXME: Pulled the preprocessor define out, * code this up as a user defined variable that * is set when the gps unit is initialized. */ #if GPS_ONE_SHOT { /** Already written out one message. */ static uint16_t msg_count = 1; if (msg_count == 5) { call stopGps(); msg_count = 0; } msg_count++; } #endif return data; } event result_t GpsSend.sendDone(TOS_MsgPtr msg, result_t success) { SODbg(DBG_USR2, "GpsSend.sendDone(): state: %i \n", switch_state); return SUCCESS; } event result_t GpsCmd.SwitchesSet(uint8_t PowerState) { char tmp[] = {"Foo"}; //SODbg(DBG_USR2, "gps_sht_baro.GpsCmd.SwitchesSet(): PowerState: %i \n\n", PowerState); //SODbg(DBG_USR2, "gps_sht_baro.GpsCmd.SwitchesSet(): dummy string: %s \n", tmp); call Leds.yellowOn(); call Leds.redOff(); return SUCCESS; } /****************************************************************************** * Sensirion SHT11 humidity/temperature sensor * - Humidity data is 12 bit: * Linear calc (no temp correction) * fRH = -4.0 + 0.0405 * data -0.0000028 * data^2 'RH linear * With temperature correction: * fRH = (fTemp - 25) * (0.01 + 0.00008 * data) + fRH 'RH true * - Temperature data is 14 bit * Temp(degC) = -38.4 + 0.0098 * data *****************************************************************************/ async event result_t Temperature.dataReady(uint16_t data) { float fTemp, fHumidity; fTemp = -38.4 + 0.0098*(float)data; atomic { fHumidity = -4.0 + 0.0405 * HumData -0.0000028 * HumData * HumData; fHumidity= (fTemp-25.0)* (0.01 + 0.00008 * HumData) + fHumidity; } fTemp = 10*fTemp; SODbg(DBG_USR2, "gps_shtM.Humidity: Temp(adc): %i Humidity(adc): %i Temp(degCx10): %i Humidity(%): %i \n", data,HumData,(int)fTemp, (int)fHumidity); atomic { call TempHumControl.stop(); } return SUCCESS; } async event result_t Humidity.dataReady(uint16_t data) { SODbg(DBG_USR2, "gsp_shtM.Humidity.dataReady()\n") atomic { HumData = data; } return call Temperature.getData(); } event result_t TempHumControl.startDone() { SODbg(DBG_USR2, "gps_shtM.TempHumControl.startDone()\n") call Humidity.getData(); return SUCCESS; } event result_t TempHumControl.initDone() { SODbg(DBG_USR2, "gps_shtM.TempHumControl.initDone()\n") return SUCCESS; } event result_t TempHumControl.stopDone() { SODbg(DBG_USR2, "gps_shtM.TempHumControl.stopDone()\n") state1 = SHT_DONE; return SUCCESS; } event result_t HumidityError.error(uint8_t token) { SODbg(DBG_USR2, "gps_shtM.HumidityError.error()\n") call Leds.redOff(); call Leds.yellowOff(); call Temperature.getData(); return SUCCESS; } event result_t TemperatureError.error(uint8_t token) { SODbg(DBG_USR2, "gps_shtM.Temperature.error()\n") call TempHumControl.stop(); call Leds.yellowOff(); return SUCCESS; } /****************************************************************************** * Intersema MS5534A barometric pressure/temperature sensor * - 6 cal coefficients (C1..C6) are extracted from 4, 16 bit,words from sensor * - Temperature measurement: * UT1=8*C5+20224 * dT=data-UT1 * Temp=(degC x10)=200+dT(C6+50)/1024 * - Pressure measurement: * OFF=C2*4 + ((C4-512)*dT)/1024 * SENS=C1+(C3*dT)/1024 + 24576 * X=(SENS*(PressureData-7168))/16384 - OFF * Press(mbar)= X/32+250 *****************************************************************************/ async event result_t IntersemaTemp.dataReady(uint16_t data) { float UT1,dT,Temp; float OFF,SENS,X,Press; //temperature UT1=8*(float)C5+20224; dT = (float)data-UT1; Temp = 200.0 + dT*((float)C6+50.0)/1024.0; //pressure OFF = (float)C2*4 + (((float)C4-512.0)*dT)/1024; SENS = (float)C1 + ((float)C3*dT)/1024 + 24576; atomic { X = (SENS*((float)PressureData-7168.0))/16384 - OFF; } Press = X/32.0 + 250.0; SODbg(DBG_USR2, "Pressure: Temp(adc): %i Press(adc): %i Temp(degCx10): %i Press(mbar): %i \n", data,PressureData,(int)Temp, (int)Press); // FIXME: PressureControl is wired to SplitControl in IntersemaPressureM, // and called asynchronously from here, which needs to be fixed. call PressureControl.stop(); return SUCCESS; } async event result_t IntersemaPressure.dataReady(uint16_t data) { atomic { PressureData = data; } return call IntersemaTemp.getData(); } event result_t IntersemaCal.dataReady(char word, uint16_t value) { // make sure we get all the calibration bytes count++; // SODbg(DBG_USR2, " cal word %i value %x \n",word,value); calibration[word-1] = value; if (count == 4) { SODbg(DBG_USR2, "Pressure cal words (1..4): %x,%x,%x,%x \n", calibration[0],calibration[1],calibration[2],calibration[3] ); atomic { C1 = calibration[0] >> 1; C2 = ((calibration[2] & 0x3f) << 6) | (calibration[3] & 0x3f); C3 = calibration[3] >> 6; C4 = calibration[2] >> 6; C5 = ((calibration[0] & 1) << 10) | (calibration[1] >> 6); C6 = calibration[1] & 0x3f; } // SODbg(DBG_USR2, "Pressure C1:%x C2:%x C3:%x C4:%x C5:%x C6:%x \n", // C1,C2,C3,C4,C5,C6 ); SODbg(DBG_USR2, "Pressure C1:%i C2:%i C3:%i C4:%i C5:%i C6:%i \n", C1,C2,C3,C4,C5,C6 ); call IntersemaPressure.getData(); } return SUCCESS; } event result_t PressureControl.initDone() { return SUCCESS; } event result_t PressureControl.stopDone() { state1 = PRESSURE_DONE; SODbg(DBG_USR2, "gps_sht_baroM.PressureControl.stopDone()\n"); return SUCCESS; } event result_t PressureControl.startDone() { count = 0; call IntersemaCal.getData(); return SUCCESS; } /** * Taos- tsl2250 light sensor * Two ADC channels: * ADC Count Value (ACNTx) = INT(16.5*[CV-1]) +S*CV * where CV = 2^^C * C = (data & 0x7) >> 4 * S = data & 0xF * Light level (lux) = ACNT0*0.46*(e^^-3.13*R) * R = ACNT1/ACNT0 */ async event result_t TaosCh1.dataReady(uint16_t data) { uint16_t CV1,CH1,ST1,ACNT0,ACNT1; float CNT1,R,Lux; call Leds.greenToggle(); atomic { ST1 = TaosData & 0xf; } atomic { CH1 = (TaosData & 0x70) >> 4; } CV1 = 1 << CH1; CNT1 = (int)(16.5*(CV1-1)) + ST1*CV1; ACNT0 = (int)CNT1; atomic { if (TaosData == 0xff) { SODbg(DBG_USR2, "Taos Ch0 data: OVERFLOW \n") ; } } SODbg(DBG_USR2, "Taos Ch0 data: %i Cord: %i Step: %i ADC Counts: %i \n", TaosData & 0x0FF, CH1,ST1,ACNT0); data = data & 0xff; ST1 = data & 0xf; CH1 = (data & 0x70) >> 4; CV1 = 1 << CH1; CNT1 = (int)(16.5*(CV1-1)) + ST1*CV1; ACNT1 = (int)CNT1; R = (float)ACNT1/(float)ACNT0; Lux = (float)ACNT0*0.46/exp(3.13*R); if (data == 0xff) { SODbg(DBG_USR2, "Taos Ch1 data: OVERFLOW \n"); } SODbg(DBG_USR2, "Taos Ch1 data: %i Cord: %i Step: %i ADC Counts: %i Light(lux): %i \n", data & 0x0FF, CH1,ST1,ACNT1,(int)Lux); call TaosControl.stop(); return SUCCESS; } async event result_t TaosCh0.dataReady(uint16_t data) { atomic { TaosData = data & 0xff; } SODbg(DBG_USR2, "Got Taos Ch0 data \n") ; return call TaosCh1.getData(); } event result_t TaosControl.startDone(){ return call TaosCh0.getData(); } event result_t TaosControl.initDone() { return SUCCESS; } event result_t TaosControl.stopDone() { state1 = LIGHT_DONE; return SUCCESS; } } |
From: <do...@us...> - 2003-11-26 18:38:48
|
Update of /cvsroot/firebug/mts400/apps/TestIntersema In directory sc8-pr-cvs1:/tmp/cvs-serv31741/TestIntersema Modified Files: IntersemaM.nc Log Message: FireBoard with gps, light, temp, hum and pressure now works together. Index: IntersemaM.nc =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestIntersema/IntersemaM.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IntersemaM.nc 13 Nov 2003 00:08:00 -0000 1.1 --- IntersemaM.nc 26 Nov 2003 18:38:45 -0000 1.2 *************** *** 43,46 **** --- 43,47 ---- implementation { + #include "SODebug.h" *************** *** 73,77 **** call Leds.greenOn(); state = START; ! call Timer.start(TIMER_REPEAT, 500); return SUCCESS; } --- 74,78 ---- call Leds.greenOn(); state = START; ! call Timer.start(TIMER_REPEAT, 1500); return SUCCESS; } |
From: <do...@us...> - 2003-11-26 18:38:48
|
Update of /cvsroot/firebug/mts400/apps In directory sc8-pr-cvs1:/tmp/cvs-serv31741 Modified Files: Makelocal Log Message: FireBoard with gps, light, temp, hum and pressure now works together. Index: Makelocal =================================================================== RCS file: /cvsroot/firebug/mts400/apps/Makelocal,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makelocal 22 Nov 2003 01:06:46 -0000 1.4 --- Makelocal 26 Nov 2003 18:38:44 -0000 1.5 *************** *** 7,10 **** --- 7,13 ---- # This is a problem. LOCAL_PATH += -I../../sensors/sensirion + LOCAL_PATH += -I../../sensors/gps + LOCAL_PATH += -I../../sensors/taos + LOCAL_PATH += -I../../sensors/intersema LOCAL_PATH += -I../../interfaces/ |
From: <do...@us...> - 2003-11-26 18:37:22
|
Update of /cvsroot/firebug/mts400/apps/TestFireBoard In directory sc8-pr-cvs1:/tmp/cvs-serv31491/TestFireBoard Log Message: Directory /cvsroot/firebug/mts400/apps/TestFireBoard added to the repository |