firebug-cvs Mailing List for FireBug: wireless wildfire monitoring (Page 19)
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: David M. D. <do...@us...> - 2004-07-01 21:40:35
|
Update of /cvsroot/firebug/firebug/project/src/sensordata In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25776 Modified Files: mkmsg.sh Added Files: xbow.h Log Message: Added header for xbow messages for 420 board. --- NEW FILE: xbow.h --- typedef struct XSensorMTS400Data1 { uint16_t battery; uint16_t humidity; uint16_t temp; uint16_t cal_word1; //!< Pressure calibration word 1 uint16_t cal_word2; //!< Pressure calibration word 2 uint16_t cal_word3; //!< Pressure calibration word 3 uint16_t cal_word4; //!< Pressure calibration word 4 uint16_t intersematemp; uint16_t intersemapressure; uint16_t taosch0; uint16_t taosch1; uint16_t accel_x; } XSensorMTS400Data1; enum { AM_XSENSORMTS400DATA1 = 137 }; typedef struct XSensorMTS420GPSData { uint8_t hours; //Hours uint8_t minutes;//Minutes uint8_t Lat_deg;//Latitude degrees uint8_t Long_deg;//Longitude degrees uint32_t dec_sec;//Decimal seconds uint32_t Lat_dec_min;//Latitude decimal minutes uint32_t Long_dec_min;//Longitude decimal minutes uint8_t NSEWind;//NSEWind uint8_t Fixed; // as to whether the packet is valid(i.e. has the gps Fixed on to the sattelites). } XSensorMTS420GPSData; enum { AM_XSENSORMTS420GPSDATA = 138 }; Index: mkmsg.sh =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/sensordata/mkmsg.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mkmsg.sh 26 Mar 2004 00:52:07 -0000 1.3 --- mkmsg.sh 1 Jul 2004 21:40:25 -0000 1.4 *************** *** 12,15 **** --- 12,19 ---- mig java -java-classname=org.firebug.GGAMsg -I. $HOME/firebug/fireboard/tos/sensors/leadtek9546/leadtek_9546.h GGAMsg > GGAMsg.java mig java -java-classname=org.firebug.RangeMsg -I. $HOME/firebug/fireboard/tos/sensorboards/xbow_mts420ca/fireboard.h Rangedata_msg > RangeMsg.java + mig java -java-classname=org.firebug.XBow1Msg -I. xbow.h XSensorMTS400Data1 > XBow1Msg.java + mig java -java-classname=org.firebug.XBow2Msg -I. xbow.h XSensorMTS420GPSData > XBow2Msg.java + + |
From: David M. D. <do...@us...> - 2004-07-01 19:33:17
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv326/src/org/firebug Modified Files: ListenFB.java Added Files: XBowLogger.java Log Message: Writing extract code for xbow type messages. --- NEW FILE: XBowLogger.java --- /** * * Handles the XBow data layout packages. * * * * typedef struct { uint16_t battery; uint16_t humidity; uint16_t temp; uint16_t cal_word1; //!< Pressure calibration word 1 uint16_t cal_word2; //!< Pressure calibration word 2 uint16_t cal_word3; //!< Pressure calibration word 3 uint16_t cal_word4; //!< Pressure calibration word 4 uint16_t intersematemp; uint16_t intersemapressure; uint16_t taosch0; uint16_t taosch1; uint16_t accel_x; } XSensorMTS400Data1; typedef struct { uint8_t hours; //Hours uint8_t minutes;//Minutes uint8_t Lat_deg;//Latitude degrees uint8_t Long_deg;//Longitude degrees uint32_t dec_sec;//Decimal seconds uint32_t Lat_dec_min;//Latitude decimal minutes uint32_t Long_dec_min;//Longitude decimal minutes uint8_t NSEWind;//NSEWind uint8_t Fixed; // as to whether the packet is valid(i.e. has the gps Fixed on to the sattelites). }XSensorMTS420GPSData; */ package org.firebug; import org.firebug.database.MysqlDBHandler; import java.io.*; import java.sql.*; import java.util.Random; import net.tinyos.message.*; public class XBowLogger implements ListenFB.PacketPrinter { private MysqlDBHandler dbh; // Move this into some test code later. private Random rand = new Random(); public XBowLogger (String dbname) { dbh = new MysqlDBHandler("localhost","3306","root","",dbname,true); } public void print(InputStream in) { } private int get_packet_type(byte [] packet) { return (int)packet[2]; } public void print_packet_raw(byte [] packet) { for (int i = 0; i < packet.length; i++) { String val = Integer.toHexString((int)packet[i]); if (val.length() == 1) { val = "0" + val; } System.out.print(val + " "); } System.out.println("\n"); } public void parse_packet_1(byte [] packet) { FireMsg fmsg = new FireMsg(packet,5); Connection conn = dbh.getConnection(); int mote_id = packet[7]; System.out.println("Mote id: " + packet[7]); int cnt = fmsg.get_cnt(); //int temp = (0x000000ff&packet[13]); int temp = packet[13]; temp = packet[14] << 8; System.out.println("temp: " + temp); float ftemp = (float)(-38.4) + (float)0.0098*(float)temp; System.out.println("ftemp: " + ftemp); float rel_hum = fmsg.get_rel_hum(); float baro_pres = fmsg.get_baro_pres(); float lux = fmsg.get_lux(); /** FIXME: Ugly flow control using exception logic to * to track down a bbad statement, needs to be cleaned up. */ try { ResultSet rs; Statement stmt = conn.createStatement(); String updatequery = "UPDATE current " + "SET " //+ "time=" + time + ", " + "cnt=" + cnt + "," + "rel_hum=" + rel_hum + ", " + "baro_pres=" + baro_pres + ", " + "temp=" + temp + "," + "lux=" + lux + " WHERE mote_id=" + mote_id; String insertquery = "INSERT INTO cumulative VALUES (" + mote_id + ", " + "NULL," // NULL lets timestamp do its thing. //time + ", " + cnt + ", " + temp + ", " + rel_hum + ", " + baro_pres + ", " + lux + ")"; try { rs = stmt.executeQuery(insertquery); } catch (SQLException sqle) { System.out.println("Problem with insert statement: " + insertquery); sqle.printStackTrace(); } try { rs = stmt.executeQuery(updatequery); } catch (SQLException sqle) { System.out.println("Problem with update statement: " + updatequery); sqle.printStackTrace(); } stmt.close(); } catch (SQLException sqle) { System.out.println("Problem with statement"); sqle.printStackTrace(); } dbh.return_connection(conn); } public void parse_packet_2(byte [] packet) { } /** Put everything in print for now. */ public void print(byte [] packet) { // Ugh what a kludge. The GPS date/time format // is not compatible with java. The date/time // should probably be stored as a string in the // database, then converted whenever it needs to // be displayed. int time = (int)System.currentTimeMillis(); int packet_id = packet[6]; System.out.println("Packet ID: " + packet_id); if (packet_id == 1) { parse_packet_1(packet); } else { parse_packet_2(packet); } //System.out.println("mote_id: " + mote_id); //System.out.println("cnt: " + cnt); //System.out.println("temp: " + temp); /* if (get_packet_type(packet) != 1){ dbh.return_connection(conn); return; } */ //print_packet_raw(packet); // This needs to throw an exception. /* if ( get_packet_type(packet) == 1 && packet[7] == -1) { dbh.return_connection(conn); return; } */ //base station ID is 1; /* if (mote_id == 1) { dbh.return_connection(conn); return; } */ /* FIXME: Need to be able to return a url as well as a * description. */ //return result; } private static void test() { String database_name = "test"; XBowLogger fl = new XBowLogger(database_name); while (true) { TestXBowLogger.test(fl); try { Thread.sleep(3000); } catch (Exception e) { System.out.println(e); } } // Unreachable /* if (TestDBLogger.test(dbl)) { System.out.println("Passed DBLogger test"); } else { System.out.println("Failed DBLogger test"); } */ } public static void main(String [] args) { test(); } } /** The TestDBLogger class exists only to construct * example packets to be fed into the DBLogger class. */ class TestXBowLogger { /** "test" is the _only_public_method_ in this * class. */ public static boolean test(XBowLogger fl) { return false; } } Index: ListenFB.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/ListenFB.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ListenFB.java 2 Apr 2004 17:53:04 -0000 1.20 --- ListenFB.java 1 Jul 2004 19:33:07 -0000 1.21 *************** *** 64,67 **** --- 64,69 ---- private RangeLogger rangelogger; private GPSLogger gpslogger; + private XBowLogger xbowlogger; + /** Use this interface when changing the output *************** *** 114,118 **** return gpslogger; } else { ! return null; } } --- 116,120 ---- return gpslogger; } else { ! return xbowlogger; } } *************** *** 201,205 **** */ int am_type = extract_am_type(packet); ! System.out.println("AM type number: " + am_type); PacketPrinter printer = GetPrinter(am_type); if (printer != null) { --- 203,207 ---- */ int am_type = extract_am_type(packet); ! //System.out.println("AM type number: " + am_type); PacketPrinter printer = GetPrinter(am_type); if (printer != null) { *************** *** 257,263 **** // Instantiating will allow processing statistics // at the base station level. ! listener.firelogger = new FireLogger(dbname); ! listener.rangelogger = new RangeLogger(dbname); ! listener.gpslogger = new GPSLogger(dbname); try { --- 259,268 ---- // Instantiating will allow processing statistics // at the base station level. ! ! //listener.firelogger = new FireLogger(dbname); ! //listener.rangelogger = new RangeLogger(dbname); ! //listener.gpslogger = new GPSLogger(dbname); ! ! listener.xbowlogger = new XBowLogger(dbname); try { |
From: David M. D. <do...@us...> - 2004-07-01 14:17:38
|
Update of /cvsroot/firebug/firebug/doc/chassis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1620/chassis Log Message: Directory /cvsroot/firebug/firebug/doc/chassis added to the repository |
From: David M. D. <do...@us...> - 2004-06-29 00:27:19
|
Update of /cvsroot/firebug/firebug/doc/sensor_interface/figs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14330/figs Added Files: Makefile api_stack.dia Log Message: Added missing figures. --- NEW FILE: api_stack.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Makefile --- .SUFFIXES : .eps .ps .jpg .dia .dot EPSPLOTS = tostreetop.eps \ tostree.eps \ fireboard_top.eps \ fireboard_bottom.eps \ api_stack.eps # graphviz dot format #PSPLOTS = TestSensirion.eps ALL = epsplots psplots all: $(ALL) epsplots: $(EPSPLOTS) psplots: $(PSPLOTS) #figplots: $(FIGPLOTS) pngplots: $(PNGPLOTS) hpglplots: $(HPGLPLOTS) .dia.eps: dia -e $*.eps $*.dia .gnu.eps: gnuplot < $*.gnu .m.eps: octave -q $*.m .win.png: gnuplot < $*.win .hp.hpg: gnuplot < $*.hp .fig.eps: fig2dev -L eps $*.fig > $*.eps .jpg.eps: jpeg2ps $*.jpg > $*.eps .dot.eps: dot -Tps $*.dot > $*.ps .gz.bb: zcat $* |egrep BoundingBox > $*.bb clean: rm -f core $(TEXPLOTS) $(PSPLOTS) *.bak *~ $(FIGPLOTS) $(EPSPLOTS) |
From: David M. D. <do...@us...> - 2004-06-29 00:26:43
|
Update of /cvsroot/firebug/firebug/doc/sensor_interface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14134 Modified Files: sensor_interface.tex Log Message: Changed authorship. Index: sensor_interface.tex =================================================================== RCS file: /cvsroot/firebug/firebug/doc/sensor_interface/sensor_interface.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sensor_interface.tex 28 Jun 2004 22:02:07 -0000 1.1 --- sensor_interface.tex 29 Jun 2004 00:26:27 -0000 1.2 *************** *** 29,37 **** \title{High-level Sensor interface for TinyOS applications} ! \author{David M. Doolin\thanks{% Civil and Environmental Engineering, University of California, Berkeley, ! 2108 Shattcuk Ave., Berkeley, CA 94720-1716 ! \tt{email: do...@ce...}}} \date{\today} \maketitle --- 29,37 ---- \title{High-level Sensor interface for TinyOS applications} ! \author{Various people\thanks{% Civil and Environmental Engineering, University of California, Berkeley, ! 2108 Shattuck Ave., Berkeley, CA 94720-1716}, ! Other folks\thanks{cens.ucla.edu}} \date{\today} \maketitle |
From: David M. D. <do...@us...> - 2004-06-28 22:32:33
|
Update of /cvsroot/firebug/firebug/doc/sensor_interface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17504 Added Files: .cvsignore Makefile sensor_interface.tex Log Message: Sensor interface paper with figures, extracted from poster presented at TOS Tech exchange. --- NEW FILE: .cvsignore --- *.log *.aux *.dvi *.ps *.pdf *.blg *.bbl chicago.sty spie.bib *.out --- NEW FILE: sensor_interface.tex --- \documentclass[10pt,letter]{article} \usepackage{color} \usepackage{chicago} \usepackage{subfigure} \input{comment} \usepackage{times} \usepackage{graphicx} \usepackage{algorithm} \usepackage{algorithmic} \newcommand{\tinyos}{TinyOS} \newcommand{\firebug}{Firebug} \newcommand{\sensor}{\textcolor{black}{HLSensor}} \newcommand{\fireboard}{Fireboard} \newcommand{\fig}{Fig.} \newcommand{\figs}{Figs.} \setlength{\topmargin}{0in} \setlength{\textheight}{8.5in} \setlength{\oddsidemargin}{0in} \setlength{\textwidth}{6.5in} \begin{document} \title{High-level Sensor interface for TinyOS applications} \author{David M. Doolin\thanks{% Civil and Environmental Engineering, University of California, Berkeley, 2108 Shattcuk Ave., Berkeley, CA 94720-1716 \tt{email: do...@ce...}}} \date{\today} \maketitle \begin{abstract} Wireless sensors for conducting wildfire monitoring share many of the capabilities of other environmental sensors, collecting data such as humidity, temperature and barometric pressure. On-board GPS location finding allows rapid, remote deployment. In this poster, a scheme for developing driver and interface software for employing the Crossbow MTS420CA sensorboard is described. A high-level, generalized sensor interface is presented. Data collection algorithms implemented over implementations of this sensor interface do not require programming changes to the underlying sensor driver code. \end{abstract} \section{Introduction} Monitoring rapidly changing environmental conditions occurring during wildfire requires deployment of large numbers of sensors into dangerous environments. The NSF Information Technology Research sponsored ``Firebug'' project~\citeyear{chen:mm2003} is developing a small, inexpensive platform using wireless communication networks to support a heterogeneous array of sensors useful for detecting the initiation and monitoring the spread of wildfires. One component of the \firebug\ project is a environmental sensor board with GPS location capabilities (``Fireboard''). The software architecture for the fireboard is described in this poster. \subsection{Fireboard} %%%%%%%%%%%% Change all of this to a ``positive'' slant. The \fireboard, bottom and top shown in \figs~1 and 2 respectively, is composed of an Analog Devices ADXL202JE accelarometer, an Sensirion SHT11 combined temperature and humidity sensor, an Intersema 5534AP combined barometric pressure and temperature sensor a Taos 250RD light sensor, and a LeadTek 9546 GPS unit. The driver code for the board initially combined previously written mica weatherboard code with preexisting code from a GPS unit. The code, while useful for demonstration purposes, required updating for TinyOS 1.1 and was written for synchronous operation using either the GPS unit, or all the other sensors, but not both at the same time. %%%%%% Here are a few notes I want to save, but can't yet use: % * Current TinyOS stuff is very good for it is being used for. % * Need to ``sell'' the concept of an API wrapped over ``core % tos''. Compare to BLAS/LAPACK, etc. % * The work in the poster is not necessarily proposed for % ``core tos''. % * The developers should be ready for nesc/tos to run away in % entirely unexpected directions. % * Our focus is on ``customers'' % * Current sensor boards have test code that can be wrapped % to implement the interfaces proposed here. \begin{figure} \begin{center} \subfigure[]{\label{} \includegraphics[width=2in]{figs/fireboard_bottom.eps}} \subfigure[]{\label{} \includegraphics[width=2in]{figs/fireboard_top.eps}} \caption{Fireboard} \label{fig:fireboard} \end{center} \end{figure} \subsection{Sensor and sensorboard operation} Currently, sensor values are collected by implementing components providing access directly to ADC or UART. This has the advantage of being ``close to the metal'', at the expense of introducing unnecessary complexity for application programmers. To reduce the complexity of sensor board programming, Gay et al.~\citeyear{gay:d2004a} recently proposed formalizing a specification for implementing sensor driver code as part of a sensorboard specification. This proposal, in part, reflects current implementations of code for operating sensors on ``weather boards'', such as that deployed at Great Duck Island~\shortcite{mainwaring:a2002}. For example, controlling sensors would still require understanding the code and mechanisms behind the operation of I2C, UART, and ADC. Ho~\citeyear{ho:h2004} proposed a MATLAB-based system for sending messages to motes pre-programmed with a ``GenericSensor'' application. Specifications for the active message (AM) structure are provided, including messages for command and control, route discovery, and data transmission. The advantage of this scheme is that once the software supporting the sensor hardware has been implemented, the system requires little further work on the mote software; data collection and mote control are provided through software written on the widely-familiar MATLAB platform. Disadvantages include: latency induced by having centralized control over mote behavior, slowing down the response of adaptive data collection algorithms and necessity of rewriting the application to fit changes in sensor hardware. The Gay et al. and Ho proposals could be considered as part of a ``DPI'': Developer's Programming Interface. The \sensor\ interface described here could be considered part of an API; an Applications Programming Interface constructed on the lower level modules, as shown in \fig~3. \begin{comment} \paragraph{Data collection/Data processing} The \tinyos\ model for data collection is characterized by the following: \begin{itemize} \item Centralized control on a PC, for example running the TASK toolset, instead of distributed control. \item \cite{hong:w2003}: \item \cite{gay:d2004b}: \end{itemize} \end{comment} %%% Perhaps mention this later. %In terms of a recently proposed framework for %application development in TinyOS~\cite{levis:pa2004}, %implementations of \sensor\ are intended to be %{\em modules}: compatible with but outside the %TinyOS core. \begin{figure} \begin{center} \includegraphics[width=2in]{figs/api_stack.eps} \caption{An API stack for \tinyos\ applications.} \label{fig:api_stack} \end{center} \end{figure} \subsection{Requirements and capabilities} We needed at least the following characteristics for the driver code: \begin{itemize} \item Ability to control which sensors are working at a given time. \item Separate data collection algorithm from sensor driver code. Changing the data collection algorithm should not require any changes in the lower level sensor driver code. \item Understandable, in principle, by participants without formal training in electrical engineering /computer science. \end{itemize} %%%%% Save for later, too hard to work it into this. %Any network deployment of sensors requires at %least the following capabilities: %\begin{itemize} %\item Configuration management %\item Acquisition control %\item Communications control %\item Time synchronization %\item Trigger control/trigger synchronization %\item Power management %\end{itemize} The definition and implementation of the \sensor\ interfaces form a ``Programmer's API'' that resides above the \tinyos\ core modules, but below the level of applications. Other types of applications benefit from this kind of abstraction. For example, Lynch et al.~\citeyear{lynch:jp2003:SEM} use a microcontroller to power both sensors and a computational unit for performing fast fourier transform on the platform. Typically, such transforms are used to extract a small number of lower order terms representing the dominant response. This saves a considerable amount of network traffic since the time series is not transmitted and low accuracy, higher order terms are ignored. %%%%%%%%%%%% Save for later. \begin{comment} \subsection{Interface definitions} \begin{itemize} \item Sensorboard \item Sensor \item Trigger \end{itemize} \end{comment} \begin{comment} \begin{verbatim} interface Sensor { command result_t powerOn(); event result_t powerOnDone(); command result_t init(); command result_t powerOff(); event result_t powerOffDone(); command result_t setSamplingInterval(// uint16_t interval); command result_t getSamplingInterval(// uint16_t interval); command result_t startSampling(); command result_t stopSampling(); command result_t sampleOnce(); event result_t dataReady(void * userdata); command result_t loadProgram(uint8_t * program); event result_t error(uint16_t error_code); } \end{verbatim} \paragraph{set/getSamplingInterval} allows run time control necessary for adaptive sampling. \end{comment} %%%%%%%%%%%%%%%%% Do triggering some other time. \begin{comment} \subsection{Trigger Control and Synchronization} The following trigger abilities will be needed. They either can be included in the OS by the Mote hardware manufacturer with necessary software hooks, or the necessary on-board processing hooks made available to end user. \begin{enumerate} \item Each sensor is remotely programmable for a different trigger level. \item Multiple types of trigger conditions should be supported: \begin{itemize} \item Excursion over/under a programmable threshold. Threshold can be either a positive or negative value or both (window condition) \item Excursion into a positive/negative threshold (i.e. sensor value is initially outside the window and then moves into the window). \item Both of the above trigger conditions should have an associated time value. Time value of zero means trigger generated immediately after trigger detected. Non zero value means trigger generated N samples after entering trigger condition if trigger condition is still true during all $N$ samples. \end{itemize} \item Each sensor can be remotely enabled/disabled to trigger. \item Sensor trigger levels are programmable in units of ADC lsbs. The base station is required to compute these levels. \item Number of pretrigger samples to be stored in flash \item Number of postrigger samples to be stored in flash \item Each sensor can be programmed to broadcast a detected trigger. Units receiving this message then (if enabled) start to store data from their own sensors. \item Time alignment of triggers is critical. When the broadcasted trigger message is sent it may take several hops to reach all other motes which introduces a time delay. This time delay must be accounted for in every mote receiving the trigger message. The receiving mote must time align its data to this trigger delay. \end{enumerate} \end{comment} \section{Module architecture} Separating a sensor board into constituent sensors has the following advantages: \begin{itemize} \item Reduces complexity --- divide and conquer. \item Encourages incremental implementation and testing. For example, not every command in an interface need be implemented initially. As commands are incrementally implemented, the implementation can be debugged. \end{itemize} TinyOS and nesC use a number of naming conventions. The Sensor interface follows this example: \begin{itemize} \item Each sensor located in a directory named by:\\ {\tt manufacturer\_modelnumber} (Figs. 4, 5). Example: \textcolor{red}{\tt sensirion\_sht11}. \item Each sensor board located in directory named by\\ {\tt manufacturer\_modelnumber}. Example: \textcolor{red}{\tt xbow\_mts420ca}. \end{itemize} %For analogous component in Linux system code, %consider how graphic or network card %code is written: the header files are at %least somewhat mnemonic. Using generic %filenames such as ``networkcard.h'' or %graphicscard.h'' probably would not be %very convenient. \begin{figure} \begin{center} \subfigure[]{\label{} \includegraphics[width=2in]{figs/tostree.eps}} \subfigure[]{\label{} \includegraphics[width=2in]{figs/tostreetop.eps}} \caption{Fireboard} \label{fig:fireboard} \end{center} \end{figure} The actual files making the sensor work are divided into a driver file, then everything else: \begin{itemize} \item *\_driver.nc is the configuration for sensor ``*''. This provides a ``first line of defense'' when driver code needs to be modified, and should consist only of nesC system code. \item Every other file in the directory supports the driver, and may consist of a mixture of nesC system code and hardware specific code. \item CPU specific code (Atmel, TI, etc) should not be located in this directory. \end{itemize} Constructing unique names for sensor boards eliminates any ambiguity about precisely which piece of hardware is being used. A unique name reduces the potential for blunders caused by incorrect include paths, where {\tt sensorboard.h} may be included more than once, or from the wrong location. An example of this is compiling the micawbdot into an application, then using the fireboard, which will return data of some unknown sort. \subsection{High-level Sensor interface} \begin{verbatim} interface HLSensor { command result_t powerOn(uint8_t power_state); event result_t powerOnDone(); command result_t init(); command result_t powerOff(); event result_t powerOffDone(); command result_t setSamplingInterval(// uint16_t interval); command result_t getSamplingInterval(// uint16_t interval); command result_t startSampling(); command result_t stopSampling(); command result_t sampleOnce(); event result_t dataReady(void * userdata); command result_t loadProgram(uint8_t * program); event result_t error(uint16_t error_code); } \end{verbatim} The \sensor\ interface is ``heavier'' than most of the interfaces defined in the TinyOS core. Interfaces in the core are more general, designed for flexibility. The \sensor\ interface trades some flexibility for ease-of-programming at the application level. Interfaces in the TinyOS core could be considered an API for library extension development, constituting a ``developer's programming interface'' (DPI). In contrast, the \sensor\ interface provides an application's programmer interface (API). Implementations of \sensor\ allow application programmers to experiment with distributed data collection algorithms, such as feedback-controlled adaptive algorithms, without having to modify any driver code. One advantage of \sensor\ is that a general sensorboard component may be written that provides multiple sensors. The sensorboard component then packages the requisite data into a custom data structure which is then tucked into an active message for radio transmission. \paragraph{Sampling} is controlled by 6 commands which reflect the expectations and vocabulary of domain experts: $[$get,set$]$SamplingInterval, $[$start,stop$]$Sampling, sampleOnce and dataReady. These commands do exactly what the names suggest. The commands $[$start,stop$]$Sampling are useful for continuous, asynchronous sampling where the implementation controls the timing of the data collection. This capability is useful for adaptive sampling. sampleOnce is useful for synchronous data collection controlled, for example, by a sensorboard component. The dataReady event provides a void pointer cast to a sensor-specific data structure. This differs from the Gay et al.~\citeyear{gay:d2004a} proposal for a lower level sensor interface, where the dataReady event returns raw values from hardware components such as the ADC. This and the Gay et al. specifications complement each other in the sense that \sensor\ may be implemented on top of the Gay et al. design for processing and calibrating hardware readings on the mote to allow distibuted/autonomous control over data collection. \paragraph{Power, init and error} Arguments to the powerOn command allow control of sensors with multiple power states. The init command provides software initialization of a sensor component, independent of the power$[$On/Off$]$ command. The error event passes an sensor-specific error argument, defined in the header file for each sensor. \paragraph{Runtime sensor programming} is performed using the loadProgram command. All sensors are assumed {\em logically} programmable, \begin{itemize} \item If there is hardware support for programming, loading a program causes sensor/implementation dependent behavior. \item If there is no hardware programming support, then loading a program is a no-op. \end{itemize} Note that the program could just as easily be used for controlling driver software state controlling sensor hardware operations. \begin{comment} \section{Implementation} \subsection{Algorithm for data collection} Because the GPS unit is an independently functioning microcomputer, the data collection algorithm must be more involved than simply powering on the sensor board and polling for data. \bigskip \hrule \smallskip %\begin{algorithm} %\caption{Directional points. Superscript $d$ indexes the %directional points, subscripts index the time step.} \begin{minipage}{\figwidth} \addtocounter{algorithmcount}{1}{\small \captcolor Algorithm~\arabic{algorithmcount}. Synchronous algorithm for controlling MTS420CA \\ sensor board.} \smallskip \hrule \begin{algorithmic}[1] \STATE Power GPS from cold start. \REPEAT [Sample NMEA output] \STATE Examine GPS satellite fix quality. \UNTIL {GPS satellite fix obtained.} \STATE Signal GPS fix ready for RF. \STATE Put GPS in Trickle Power. \FOR {$i = 1,...n$ time steps} \STATE Sample temperature/humidity. \STATE Sample barometric pressure. \STATE Sample light intensity. \STATE Signal data ready for RF. \ENDFOR \end{algorithmic} \end{minipage} %\label{alg:directionalpoint} %\end{algorithm} \bigskip \hrule \smallskip \hrule \bigskip \end{comment} \begin{comment} \begin{minipage}{\figwidth} \begin{center} \includegraphics[scale=0.5]{figs/satellite.lg.eps} \\ \addtocounter{figscount}{1}{ \small \captcolor Figure~\arabic{figscount}. Satellites are used for GPS fixes. } \end{center} \end{minipage} \end{comment} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{comment} \begin{minipage}{\figwidth} \begin{center} \includegraphics[scale=1.6]{figs/TestGPS.testgps.nc.if.ps}\\ \addtocounter{figscount}{1}{ \small \captcolor{ Figure~\arabic{figscount}. Wiring diagram using \sensor\ interface for GPS test application.} } \end{center} \end{minipage} \end{comment} \begin{comment} \begin{minipage}{\figwidth} \begin{center} \includegraphics[scale=1.6]{figs/TestTaos.testtaos.nc.if.ps}\\ \addtocounter{figscount}{1}{ \small \captcolor Figure~\arabic{figscount}. Caption. } \end{center} \end{minipage} \end{comment} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{comment} \subsection{Example --- LeadTek 9546} \textcolor{red}{Add a bunch more specs for the GPS unit here.} \begin{itemize} \item NMEA --- many different data formats: GGA, GLL, GSA, GSV, RMC, VTG. Of these, we only care for the GGA format. \item Active or passive antenna, supplies 2.85 VDC for antenna power. \item Internal clock for unit. \item Operating temperature -20 C to 70 C. \end{itemize} %%%% How the UART transmit and receive work? \end{comment} \section{Summary} \begin{itemize} \item Separating the Fireboard sensors into modules allowed driver code for each sensor to be upgraded independently. \item Using an implementation of the \sensor\ interface is much easier than modifying drivers. \item The \sensor\ interface is not a panacea, but given there is no ``one size fits all'' the current implementation works well. \item In light of recently proposed sensor abstractions~\shortcite{gay:d2004a,ho:h2004}, more work needs to be done to define the interaction between the TinyOS core and higher levels interfaces such as \sensor. \end{itemize} \bibliographystyle{chicago} \bibliography{sensor,tinyos} \end{document} \begin{comment} \A*nal"o*gy\, n.; pl. {Analogies}. [L. analogia, Gr. ?, fr. ?: cf. F. analogie. See {Analogous}.] 1. A resemblance of relations; an agreement or likeness between things in some circumstances or effects, when the things are otherwise entirely different. Thus, learning enlightens the mind, because it is to the mind what light is to the eye, enabling it to discover things before hidden. Note: Followed by between, to, or with; as, there is an analogy between these objects, or one thing has an analogy to or with another. Note: Analogy is very commonly used to denote similarity or essential resemblance; but its specific meaning is a similarity of relations, and in this consists the difference between the argument from example and that from analogy. In the former, we argue from the mere similarity of two things; in the latter, from the similarity of their relations. --Karslake. 2. (Biol.) A relation or correspondence in function, between organs or parts which are decidedly different. 3. (Geom.) Proportion; equality of ratios. 4. (Gram.) Conformity of words to the genius, structure, or general rules of a language; similarity of origin, inflection, or principle of pronunciation, and the like, as opposed to {anomaly}. --Johnson. \end{comment} --- NEW FILE: Makefile --- sensor_interface: latex sensor_interface bibtex sensor_interface latex sensor_interface latex sensor_interface dvips -o sensor_interface.ps sensor_interface.dvi dvipdfm sensor_interface.dvi all: sensor_interface clean: rm -rf *.ps *.dvi *.aux *.log *.bbl *.blg *~ *.fff *.lof |
From: David M. D. <do...@us...> - 2004-06-28 22:24:41
|
Update of /cvsroot/firebug/firebug/doc/sensor_interface/figs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16472/figs Log Message: Directory /cvsroot/firebug/firebug/doc/sensor_interface/figs added to the repository |
From: David M. D. <do...@us...> - 2004-06-28 21:52:05
|
Update of /cvsroot/firebug/firebug/doc/sensor_interface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15718/sensor_interface Log Message: Directory /cvsroot/firebug/firebug/doc/sensor_interface added to the repository |
From: David M. D. <do...@us...> - 2004-05-20 01:00:56
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13002 Modified Files: steves_talk.ppt Added Files: chassis.xls Log Message: Added b.o.m. for chassis. --- NEW FILE: chassis.xls --- (This appears to be a binary file; contents omitted.) Index: steves_talk.ppt =================================================================== RCS file: /cvsroot/firebug/firebug/web/steves_talk.ppt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvseSNXVc and /tmp/cvsfkjOb0 differ |
From: David M. D. <do...@us...> - 2004-05-11 23:34:27
|
Update of /cvsroot/firebug/firebug/web/demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5953 Added Files: .cvsignore Log Message: Cleaning up demo directory. --- NEW FILE: .cvsignore --- *~ *.png |
From: David M. D. <do...@us...> - 2004-05-11 23:24:18
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4083 Added Files: db_list_databases.php Log Message: Refactored more code. --- NEW FILE: db_list_databases.php --- <table class="db_schema"> <tr> <td>Database</td> <td>Selected</td> </tr> <?php $dblink=mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); $arr = array(1 => "mysql", 2 => "test"); $db_list = mysql_list_dbs($dblink); while ($row = mysql_fetch_object($db_list)) { $var=$row->Database; $flag=false; for ($i = 1; $i <= count($arr); $i++){ if ($arr[$i]==$var) { $flag=true;} } if($flag==false){ print ("<tr><td>"); print $var; print ("</td>"); print ("<td>"); print ("<input type=radio name=db1 value=\"$var\">"); print ("</td>"); print ("</tr>"); } } ?> </table> |
From: David M. D. <do...@us...> - 2004-05-11 23:23:48
|
Update of /cvsroot/firebug/firebug/web/demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3947/demo Modified Files: temphum.php Log Message: Refactored more code. Index: temphum.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/demo/temphum.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** temphum.php 2 Apr 2004 22:51:24 -0000 1.2 --- temphum.php 11 May 2004 23:23:38 -0000 1.3 *************** *** 18,22 **** <?php ! $dbname = "foobar"; $tblname = "cumulative"; $mote_id = $HTTP_POST_VARS["motes"]; --- 18,22 ---- <?php ! $dbname = "testem"; $tblname = "cumulative"; $mote_id = $HTTP_POST_VARS["motes"]; |
From: David M. D. <do...@us...> - 2004-05-11 23:23:47
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3947 Modified Files: db_list.php firebug.css Log Message: Refactored more code. Index: db_list.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/db_list.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_list.php 30 Jul 2003 21:49:39 -0000 1.2 --- db_list.php 11 May 2004 23:23:38 -0000 1.3 *************** *** 21,61 **** <form action="db_select.php" method="post"> ! <table class="db_schema"> ! <tr> ! <td>DataBase Name</td> ! <td>Selected</td> ! </tr> ! ! <?php ! $dblink=mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); ! $arr = array(1 => "mysql", 2 => "test"); ! ! ! $db_list = mysql_list_dbs($dblink); ! ! while ($row = mysql_fetch_object($db_list)) { ! $var=$row->Database; ! ! $flag=false; ! for ($i = 1; $i <= count($arr); $i++){ ! if ($arr[$i]==$var) ! { $flag=true;} ! } ! ! if($flag==false){ ! print ("<tr><td>"); ! print $var; ! print ("</td>"); ! ! print ("<td>"); ! print ("<input type=radio name=db1 value=\"$var\">"); ! print ("</td>"); ! ! print ("</tr>"); ! } ! } - ?> - </table> <input type="submit" value="Show tables"> </form> --- 21,26 ---- <form action="db_select.php" method="post"> ! <?php include "db_list_databases.php" ?> <input type="submit" value="Show tables"> </form> Index: firebug.css =================================================================== RCS file: /cvsroot/firebug/firebug/web/firebug.css,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** firebug.css 16 Feb 2004 02:03:16 -0000 1.12 --- firebug.css 11 May 2004 23:23:38 -0000 1.13 *************** *** 17,22 **** --- 17,24 ---- background-color:#ffff66; border:solid; + /* width:80%; font-size:75%; + */ } |
From: David M. D. <do...@us...> - 2004-04-02 23:03:39
|
Update of /cvsroot/firebug/firebug/web/demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1926/demo Modified Files: temphum.php Log Message: Plotting temperature and humidity works for one mote at a time. Index: temphum.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/demo/temphum.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** temphum.php 2 Apr 2004 16:41:32 -0000 1.1 --- temphum.php 2 Apr 2004 22:51:24 -0000 1.2 *************** *** 5,11 **** <html> <head> ! <title>Results demo script</title> ! <link rel="SHORTCUT ICON" href="../images/favicon.ico"> ! <link type="text/css" rel="stylesheet" href="../firebug.css"> </head> --- 5,11 ---- <html> <head> ! <title>Results demo script</title> ! <link rel="SHORTCUT ICON" href="../images/favicon.ico"> ! <link type="text/css" rel="stylesheet" href="../firebug.css"> </head> *************** *** 18,271 **** <?php ! $dbname = "gpsradio"; ! $tblname = "location"; ! //$dbname = $HTTP_POST_VARS["db1"]; ! //$tblname = $HTTP_SESSION_VARS["tblname"]; ! //$checkboxname = $HTTP_SESSION_VARS["cb"]; ! $radiox = $HTTP_POST_VARS["radiox"]; ! $radioy = $HTTP_POST_VARS["radioy"]; ! $xmin = $HTTP_POST_VARS["xmin"]; ! $xmax = $HTTP_POST_VARS["xmax"]; ! //echo "Radio x: ".$radiox;echo "Radio y: ".$radioy; ! mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); ! $dblink=mysql_select_db("$dbname") or die("Error: ".mysql_error()." in mysql_select_db."); ! ?> - <?php - //include "db_print_table.php"; - ?> ! <table> ! <tr> ! <td> ! <form action="graphem.php" method="post"> ! <table> ! <tr> ! <td>mote_id</td> ! <td><input type=radio name=radiox value="mote_id"</td> ! <td><input type=radio name=radioy value="mote_id"</td> ! </tr> - <tr> - <td>gps_hours</td> - <td><input type=radio name=radiox value="gps_hours"</td> - <td><input type=radio name=radioy value="gps_hours"</td> - </tr> - <tr> - <td>gps_minutes</td> - <td><input type=radio name=radiox value="gps_minutes"</td> - <td><input type=radio name=radioy value="gps_minutes"</td> - </tr> ! <tr> ! <td>gps_seconds</td> ! <td><input type=radio name=radiox value="gps_seconds"</td> ! <td><input type=radio name=radioy value="gps_seconds"</td> ! </tr> ! <tr> ! <td>lat_deg</td> ! <td><input type=radio name=radiox value="lat_deg"</td> ! <td><input type=radio name=radioy value="lat_deg"</td> ! </tr> ! <tr> ! <td>lat_dec_min</td> ! <td><input type=radio name=radiox value="lat_dec_min"</td> ! <td><input type=radio name=radioy value="lat_dec_min"</td> ! </tr> ! <tr> ! <td>long_deg</td> ! <td><input type=radio name=radiox value="long_deg"</td> ! <td><input type=radio name=radioy value="long_deg"</td> ! </tr> - <tr> - <td>long_dec_min</td> - <td><input type=radio name=radiox value="long_dec_min"</td> - <td><input type=radio name=radioy value="long_dec_min"</td> - </tr> ! <tr> ! <td>nsew</td> ! <td><input type=radio name=radiox value="nsew"</td> ! <td><input type=radio name=radioy value="nsew"</td> ! </tr> ! ! <tr> ! <td>numsats</td> ! <td><input type=radio name=radiox value="numsats"</td> ! <td><input type=radio name=radioy value="numsats"</td> ! </tr> - </table> - <input type=hidden name=db1 value="dbname"> - <input type=submit value="Plot"> - </form> - </td> - <!-- - <form action="graphem.php" method="post"> <table> <tr> ! <td>mote_id</td> ! <td><input type=radio name=radiox value="mote_id"</td> ! <td><input type=radio name=radioy value="mote_id"</td> ! </tr> ! <tr> ! <td>time</td> ! <td><input type=radio name=radiox value="time"</td> ! <td><input type=radio name=radioy value="time"</td> ! </tr> <tr> ! <td>count</td> ! <td><input type=radio name=radiox value="cnt"</td> ! <td><input type=radio name=radioy value="cnt"</td> ! </tr> ! <tr> ! <td>RSSI</td> ! <td><input type=radio name=radiox value="rssi"</td> ! <td><input type=radio name=radioy value="rssi"</td> </tr> - </table> <input type=hidden name=db1 value="dbname"> <input type=submit value="Plot"> </form> - --> - - <?php - - - $dbname = "gpsradio"; - $statement = "use $dbname"; - mysql_query($statement) or die("Error: ".mysql_error()." changing databases"); - - - if ($radioy == null) { - print("Error, must choose a y value\n"); - // statement for selecting against y value only. - } - - if ($radiox == null) { - $statement = "select $radioy from location where lat_deg = 37 and long_deg = 122"; - } else { - $statement = "select $radiox,$radioy from location where lat_deg = 37 and long_deg = 122"; - } - - $result = mysql_query($statement) or die("Error: ".mysql_error()." in select statement"); - - - if (!$ofp=fopen("test.dat","w")) { - echo "Unable to open data output file for writing.\n"; - } - - if(!chmod ("test.dat", 0775)) { - echo "chmod failed\n"; - } - - function print_row($item2,$key) { - fwrite($ofp,$item2); - } - - if ($row = mysql_fetch_row($result)) { - - // for each row - do { - // For each column... - $row = array_values($row); - $size = count($row); - for ($i=0; $i<$size; $i++) { - // This is no good for multiple columns. - fwrite($ofp,$row[$i]." "); - } - fwrite($ofp,"\n"); - } while ($row = mysql_fetch_row($result)); - } - fclose($ofp); - // This stuff doesn't work yet, but would be - // be a better way to do this. Move all this - // kind of stuff into dedicated functions. - //$command = "echo -e 'set term png\n"; - $command = "'set term png\n"; - $command .= "set size 0.4\n"; - //$command .= "plot \"test2.dat\"\n'"; - $command .= "plot \"test.dat\"\n'"; - //$command .= "| C:/gp373w32/pgnuplot.exe > test.png"; - $command .= "| C:/gp373w32/pgnuplot.exe > test.png"; - - //$plotcommand = "echo -e 'set term png\n"; - $plotcommand = "'set term png\n"; - $plotcommand .= "set size 0.4\n"; - $plotcommand .= "set output \"test.png\"\n"; - $plotcommand .= "plot \"test.dat\" with lines 2'"; - - $plotstring = "set term png\n"; - $plotstring .= "set size 0.5\n"; - $plotstring .= "set output \"test.png\"\n"; - $plotstring .= "plot \"test.dat\" with lines 2"; - - - $gnuplot = " | C:\\gp373w32\\pgnuplot.exe"; - - //echo $command; - - // System call - $systemcall = $plotcommand; - $systemcall .= $gnuplot; - - $gnufile = "test2.gnu"; - //$ofp = fopen("test1.gnu","w"); - $ofp = fopen($gnufile,"w"); - fwrite($ofp,$plotstring); - fclose($ofp); - //system("C:\\gp373w32\\pgnuplot.exe < ./test1.gnu"); - //Try the redirect going the other way with an output file name. - system("C:\\gp373w32\\pgnuplot.exe < ./$gnufile"); // > $outfile.png ! /* ! print("<pre>"); ! print($plotcommand.$gnuplot); ! print("</pre>"); ! */ ! //This doesn't work either. ! //`$plotcommand.$gnuplot`; ! /* ! $systemcall = $plotcommand; ! $systemcall .= $gnuplot; ! $e = escapeshellcmd($systemcall); ! // This would be preferable, but doesn't seem to work. ! if(system("echo -e $systemcall",$error)) { ! echo "System call succeeded\n"; ! } else { ! echo "System call failed with error $error\n"; ! } ! print("<pre>"); ! print($e); ! print("</pre>"); ! */ ?> - - <td> - <img src="test.png"> </td> </tr> --- 18,150 ---- <?php + $dbname = "foobar"; + $tblname = "cumulative"; + $mote_id = $HTTP_POST_VARS["motes"]; + $radioy = $HTTP_POST_VARS["radioy"]; + mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); + $dblink=mysql_select_db("$dbname") or die("Error: ".mysql_error()." in mysql_select_db."); ! function extract_mote_id($result) { ! if ($row = mysql_fetch_row($result)) { ! // for each row ! do { ! // For each column... ! $row = array_values($row); ! echo "<option value=\"$row[0]\">"; ! print($row[0]); ! echo "</option>\n"; ! } while ($row = mysql_fetch_row($result)); ! ! } ! } ! function write_data_to_file($result,$datafile) { ! if (!$ofp=fopen($datafile,"w")) { ! echo "Unable to open data output file for writing.\n"; ! } + if(!chmod ($datafile, 0775)) { + echo "chmod failed\n"; + } ! if ($row = mysql_fetch_row($result)) { ! // for each row ! do { ! // For each column... ! $row = array_values($row); ! $size = count($row); ! for ($i=0; $i<$size; $i++) { ! fwrite($ofp,$row[$i]." "); ! } ! fwrite($ofp,"\n"); ! } while ($row = mysql_fetch_row($result)); ! } ! fclose($ofp); ! } ! function plot($outfile,$datafile,$gnufile) { ! $plotstring = "set term png\n"; ! $plotstring .= "set size 0.5\n"; ! $plotstring .= "set output \"$outfile\"\n"; ! $plotstring .= "plot \"$datafile\" with lines 2"; ! $ofp = fopen($gnufile,"w"); ! fwrite($ofp,$plotstring); ! fclose($ofp); ! system("C:\\gp373w32\\pgnuplot.exe < ./$gnufile"); ! } ! ?> <table> <tr> ! <td> ! <form action="temphum.php" method="post"> + <table> <tr> ! <td>Temperature</td> ! <td><input type=radio name=radiox value="temp"</td> ! <td><input type=radio name=radioy value="temp"</td> ! </tr> <tr> ! <td>Relative humidity</td> ! <td><input type=radio name=radiox value="rel_hum"</td> ! <td><input type=radio name=radioy value="rel_hum"</td> ! </tr> ! <tr> ! <td>Barometric pressure</td> ! <td><input type=radio name=radiox value="baro_pres"</td> ! <td><input type=radio name=radioy value="baro_pres"</td> ! </tr> ! <tr> ! <td>Select mote id for plotting: ! <select name=motes> ! <?php ! $statement = "select distinct mote_id from cumulative"; ! $result = mysql_query($statement) or die("Error in distinct mote id: ".mysql_error()." in select statement"); ! extract_mote_id($result); ! ?> ! </select> ! </td> </tr> </table> + <input type=hidden name=db1 value="dbname"> <input type=submit value="Plot"> </form> + </td> ! <?php ! ! $statement = "select $radioy from cumulative where mote_id = $mote_id"; ! $result = mysql_query($statement) or die("Error in plot data select: ".mysql_error()." in select statement"); ! $datafile = "temp.dat"; ! $gnufile = "temp.gnu"; ! $outfile = "temp.png"; ! write_data_to_file($result,$datafile); ! plot($outfile,$datafile,$gnufile); + echo "<td>\n"; + echo "<img src=\"$outfile\">\n"; ?> </td> </tr> *************** *** 274,281 **** <?php include("../nav_footer.php"); - //$radiox = null; - //$radioy = null; ?> --- 153,159 ---- + <?php include("../nav_footer.php"); ?> *************** *** 283,290 **** <hr /> ! <p> ! Last Updated: $Date$ ! by $Author$. ! </p> </body> --- 161,168 ---- <hr /> ! <p> ! Last Updated: $Date$ ! by $Author$. ! </p> </body> |
From: David M. D. <do...@us...> - 2004-04-02 18:05:21
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6467/project/java/src/org/firebug Modified Files: FireLogger.java GPSLogger.java ListenFB.java Log Message: Cleaning up message logging classes. Index: GPSLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/GPSLogger.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GPSLogger.java 27 Mar 2004 00:04:47 -0000 1.1 --- GPSLogger.java 2 Apr 2004 17:53:04 -0000 1.2 *************** *** 53,57 **** public void print(byte [] packet) { ! GGAMsg msg = new GGAMsg(packet,5); Connection conn = dbh.getConnection(); --- 53,57 ---- public void print(byte [] packet) { ! GGAMsg msg = new GGAMsg(packet,5,GGAMsg.DEFAULT_MESSAGE_SIZE); Connection conn = dbh.getConnection(); Index: FireLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/FireLogger.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FireLogger.java 27 Mar 2004 00:04:47 -0000 1.3 --- FireLogger.java 2 Apr 2004 17:53:04 -0000 1.4 *************** *** 69,72 **** --- 69,73 ---- float rel_hum = fmsg.get_rel_hum(); float baro_pres = fmsg.get_baro_pres(); + float lux = fmsg.get_lux(); System.out.println("mote_id: " + mote_id); *************** *** 116,120 **** + "rel_hum=" + rel_hum + ", " + "baro_pres=" + baro_pres + ", " ! + "temp=" + temp + " WHERE mote_id=" + mote_id; --- 117,122 ---- + "rel_hum=" + rel_hum + ", " + "baro_pres=" + baro_pres + ", " ! + "temp=" + temp + "," ! + "lux=" + lux + " WHERE mote_id=" + mote_id; *************** *** 122,129 **** + mote_id + ", " + "NULL," // NULL lets timestamp do its thing. //time + ", " + temp + ", " + rel_hum + ", " + baro_pres + ", " ! + cnt + ")"; --- 124,132 ---- + mote_id + ", " + "NULL," // NULL lets timestamp do its thing. //time + ", " + + cnt + ", " + temp + ", " + rel_hum + ", " + baro_pres + ", " ! + lux + ")"; Index: ListenFB.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/ListenFB.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ListenFB.java 27 Mar 2004 00:04:47 -0000 1.19 --- ListenFB.java 2 Apr 2004 17:53:04 -0000 1.20 *************** *** 58,67 **** private static int AM_FIREDATA_MSG = 128; private static int AM_RANGEDATA_MSG = 129; ! private static int AM_GGAMSG = 130; ! private static FireLogger firelogger; ! private static RangeLogger rangelogger; ! private static GPSLogger gpslogger; /** Use this interface when changing the output --- 58,67 ---- private static int AM_FIREDATA_MSG = 128; private static int AM_RANGEDATA_MSG = 129; ! private static int AM_GGA_MSG = 130; ! private FireLogger firelogger; ! private RangeLogger rangelogger; ! private GPSLogger gpslogger; /** Use this interface when changing the output *************** *** 111,114 **** --- 111,116 ---- } else if (am_type == AM_RANGEDATA_MSG) { return rangelogger; + } else if (am_type == AM_GGA_MSG) { + return gpslogger; } else { return null; *************** *** 201,205 **** System.out.println("AM type number: " + am_type); PacketPrinter printer = GetPrinter(am_type); ! printer.print(packet); } } --- 203,209 ---- System.out.println("AM type number: " + am_type); PacketPrinter printer = GetPrinter(am_type); ! if (printer != null) { ! printer.print(packet); ! } } } *************** *** 249,260 **** String port = args[args.length - 1]; ! ListenFB reader = new ListenFB(port); ! firelogger = new FireLogger(dbname); ! rangelogger = new RangeLogger(dbname); ! gpslogger = new GPSLogger(dbname); try { ! reader.read(); } catch (Exception e) { e.printStackTrace(); --- 253,266 ---- String port = args[args.length - 1]; ! ListenFB listener = new ListenFB(port); ! // Instantiating will allow processing statistics ! // at the base station level. ! listener.firelogger = new FireLogger(dbname); ! listener.rangelogger = new RangeLogger(dbname); ! listener.gpslogger = new GPSLogger(dbname); try { ! listener.read(); } catch (Exception e) { e.printStackTrace(); |
From: David M. D. <do...@us...> - 2004-04-02 16:53:43
|
Update of /cvsroot/firebug/firebug/web/demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24508/demo Modified Files: graphem.php Added Files: temphum.php Log Message: Started a file for plotting temperature and humidity. --- NEW FILE: temphum.php --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Results demo script</title> <link rel="SHORTCUT ICON" href="../images/favicon.ico"> <link type="text/css" rel="stylesheet" href="../firebug.css"> </head> <body> <h1>Demonstration monitoring</h1> <?php $dbname = "gpsradio"; $tblname = "location"; //$dbname = $HTTP_POST_VARS["db1"]; //$tblname = $HTTP_SESSION_VARS["tblname"]; //$checkboxname = $HTTP_SESSION_VARS["cb"]; $radiox = $HTTP_POST_VARS["radiox"]; $radioy = $HTTP_POST_VARS["radioy"]; $xmin = $HTTP_POST_VARS["xmin"]; $xmax = $HTTP_POST_VARS["xmax"]; //echo "Radio x: ".$radiox;echo "Radio y: ".$radioy; mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); $dblink=mysql_select_db("$dbname") or die("Error: ".mysql_error()." in mysql_select_db."); ?> <?php //include "db_print_table.php"; ?> <table> <tr> <td> <form action="graphem.php" method="post"> <table> <tr> <td>mote_id</td> <td><input type=radio name=radiox value="mote_id"</td> <td><input type=radio name=radioy value="mote_id"</td> </tr> <tr> <td>gps_hours</td> <td><input type=radio name=radiox value="gps_hours"</td> <td><input type=radio name=radioy value="gps_hours"</td> </tr> <tr> <td>gps_minutes</td> <td><input type=radio name=radiox value="gps_minutes"</td> <td><input type=radio name=radioy value="gps_minutes"</td> </tr> <tr> <td>gps_seconds</td> <td><input type=radio name=radiox value="gps_seconds"</td> <td><input type=radio name=radioy value="gps_seconds"</td> </tr> <tr> <td>lat_deg</td> <td><input type=radio name=radiox value="lat_deg"</td> <td><input type=radio name=radioy value="lat_deg"</td> </tr> <tr> <td>lat_dec_min</td> <td><input type=radio name=radiox value="lat_dec_min"</td> <td><input type=radio name=radioy value="lat_dec_min"</td> </tr> <tr> <td>long_deg</td> <td><input type=radio name=radiox value="long_deg"</td> <td><input type=radio name=radioy value="long_deg"</td> </tr> <tr> <td>long_dec_min</td> <td><input type=radio name=radiox value="long_dec_min"</td> <td><input type=radio name=radioy value="long_dec_min"</td> </tr> <tr> <td>nsew</td> <td><input type=radio name=radiox value="nsew"</td> <td><input type=radio name=radioy value="nsew"</td> </tr> <tr> <td>numsats</td> <td><input type=radio name=radiox value="numsats"</td> <td><input type=radio name=radioy value="numsats"</td> </tr> </table> <input type=hidden name=db1 value="dbname"> <input type=submit value="Plot"> </form> </td> <!-- <form action="graphem.php" method="post"> <table> <tr> <td>mote_id</td> <td><input type=radio name=radiox value="mote_id"</td> <td><input type=radio name=radioy value="mote_id"</td> </tr> <tr> <td>time</td> <td><input type=radio name=radiox value="time"</td> <td><input type=radio name=radioy value="time"</td> </tr> <tr> <td>count</td> <td><input type=radio name=radiox value="cnt"</td> <td><input type=radio name=radioy value="cnt"</td> </tr> <tr> <td>RSSI</td> <td><input type=radio name=radiox value="rssi"</td> <td><input type=radio name=radioy value="rssi"</td> </tr> </table> <input type=hidden name=db1 value="dbname"> <input type=submit value="Plot"> </form> --> <?php $dbname = "gpsradio"; $statement = "use $dbname"; mysql_query($statement) or die("Error: ".mysql_error()." changing databases"); if ($radioy == null) { print("Error, must choose a y value\n"); // statement for selecting against y value only. } if ($radiox == null) { $statement = "select $radioy from location where lat_deg = 37 and long_deg = 122"; } else { $statement = "select $radiox,$radioy from location where lat_deg = 37 and long_deg = 122"; } $result = mysql_query($statement) or die("Error: ".mysql_error()." in select statement"); if (!$ofp=fopen("test.dat","w")) { echo "Unable to open data output file for writing.\n"; } if(!chmod ("test.dat", 0775)) { echo "chmod failed\n"; } function print_row($item2,$key) { fwrite($ofp,$item2); } if ($row = mysql_fetch_row($result)) { // for each row do { // For each column... $row = array_values($row); $size = count($row); for ($i=0; $i<$size; $i++) { // This is no good for multiple columns. fwrite($ofp,$row[$i]." "); } fwrite($ofp,"\n"); } while ($row = mysql_fetch_row($result)); } fclose($ofp); // This stuff doesn't work yet, but would be // be a better way to do this. Move all this // kind of stuff into dedicated functions. //$command = "echo -e 'set term png\n"; $command = "'set term png\n"; $command .= "set size 0.4\n"; //$command .= "plot \"test2.dat\"\n'"; $command .= "plot \"test.dat\"\n'"; //$command .= "| C:/gp373w32/pgnuplot.exe > test.png"; $command .= "| C:/gp373w32/pgnuplot.exe > test.png"; //$plotcommand = "echo -e 'set term png\n"; $plotcommand = "'set term png\n"; $plotcommand .= "set size 0.4\n"; $plotcommand .= "set output \"test.png\"\n"; $plotcommand .= "plot \"test.dat\" with lines 2'"; $plotstring = "set term png\n"; $plotstring .= "set size 0.5\n"; $plotstring .= "set output \"test.png\"\n"; $plotstring .= "plot \"test.dat\" with lines 2"; $gnuplot = " | C:\\gp373w32\\pgnuplot.exe"; //echo $command; // System call $systemcall = $plotcommand; $systemcall .= $gnuplot; $gnufile = "test2.gnu"; //$ofp = fopen("test1.gnu","w"); $ofp = fopen($gnufile,"w"); fwrite($ofp,$plotstring); fclose($ofp); //system("C:\\gp373w32\\pgnuplot.exe < ./test1.gnu"); //Try the redirect going the other way with an output file name. system("C:\\gp373w32\\pgnuplot.exe < ./$gnufile"); // > $outfile.png /* print("<pre>"); print($plotcommand.$gnuplot); print("</pre>"); */ //This doesn't work either. //`$plotcommand.$gnuplot`; /* $systemcall = $plotcommand; $systemcall .= $gnuplot; $e = escapeshellcmd($systemcall); // This would be preferable, but doesn't seem to work. if(system("echo -e $systemcall",$error)) { echo "System call succeeded\n"; } else { echo "System call failed with error $error\n"; } print("<pre>"); print($e); print("</pre>"); */ ?> <td> <img src="test.png"> </td> </tr> </table> <?php include("../nav_footer.php"); //$radiox = null; //$radioy = null; ?> <hr /> <p> Last Updated: $Date: 2004/04/02 16:41:32 $ by $Author: doolin $. </p> </body> </html> Index: graphem.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/demo/graphem.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** graphem.php 2 Apr 2004 00:18:36 -0000 1.1 --- graphem.php 2 Apr 2004 16:41:32 -0000 1.2 *************** *** 42,46 **** ?> ! <form action="graphem.php" method="post"> --- 42,48 ---- ?> ! <table> ! <tr> ! <td> <form action="graphem.php" method="post"> *************** *** 110,115 **** --- 112,150 ---- <input type=submit value="Plot"> </form> + </td> + + + <!-- + <form action="graphem.php" method="post"> + <table> + <tr> + <td>mote_id</td> + <td><input type=radio name=radiox value="mote_id"</td> + <td><input type=radio name=radioy value="mote_id"</td> + </tr> + + <tr> + <td>time</td> + <td><input type=radio name=radiox value="time"</td> + <td><input type=radio name=radioy value="time"</td> + </tr> + + <tr> + <td>count</td> + <td><input type=radio name=radiox value="cnt"</td> + <td><input type=radio name=radioy value="cnt"</td> + </tr> + <tr> + <td>RSSI</td> + <td><input type=radio name=radiox value="rssi"</td> + <td><input type=radio name=radioy value="rssi"</td> + </tr> + </table> + <input type=hidden name=db1 value="dbname"> + <input type=submit value="Plot"> + </form> + --> <?php *************** *** 182,186 **** $plotstring = "set term png\n"; ! $plotstring .= "set size 0.8\n"; $plotstring .= "set output \"test.png\"\n"; $plotstring .= "plot \"test.dat\" with lines 2"; --- 217,221 ---- $plotstring = "set term png\n"; ! $plotstring .= "set size 0.5\n"; $plotstring .= "set output \"test.png\"\n"; $plotstring .= "plot \"test.dat\" with lines 2"; *************** *** 228,236 **** */ - echo "<center>"; - echo "<img src=\"test.png\">"; - echo "</center>"; ?> --- 263,274 ---- */ ?> + <td> + <img src="test.png"> + </td> + </tr> + </table> + |
From: David M. D. <do...@us...> - 2004-04-02 00:30:38
|
Update of /cvsroot/firebug/firebug/web/demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15440/demo Added Files: db_print_table.php graphem.php Log Message: Worked on graphing web app. --- NEW FILE: db_print_table.php --- <?php ///* echo "<table class=\"db_schema\">"; $statement = "show columns from $tblname;"; $columns = mysql_query($statement) or die("Error: ".mysql_error()." getting columns"); // Build the table header column names. Make this into a function. if ($columnname = mysql_fetch_array($columns)) { print("<tr>\n"); $names = array(); do { print ("<td>"); array_push($names, $columnname[0]); print $columnname[0]; print ("</td>"); } while ($columnname = mysql_fetch_array($columns)); print("</tr>\n"); // This is pretty cool for debugging. //print_r($names); } $statement = "select * from $tblname"; $result = mysql_query($statement); function print_table_row($item2,$key) { print ("<td>\n"); echo "$item2\n"; print ("</td>\n"); } if ($row = mysql_fetch_row($result)) { do { print ("<tr>"); $row = array_values($row); array_walk($row,'print_table_row'); print ("</tr>"); } while ($row = mysql_fetch_row($result)); } echo "</table>"; //*/ ?> --- NEW FILE: graphem.php --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Results demo script</title> <link rel="SHORTCUT ICON" href="../images/favicon.ico"> <link type="text/css" rel="stylesheet" href="../firebug.css"> </head> <body> <h1>Demonstration monitoring</h1> <?php $dbname = "gpsradio"; $tblname = "location"; //$dbname = $HTTP_POST_VARS["db1"]; //$tblname = $HTTP_SESSION_VARS["tblname"]; //$checkboxname = $HTTP_SESSION_VARS["cb"]; $radiox = $HTTP_POST_VARS["radiox"]; $radioy = $HTTP_POST_VARS["radioy"]; $xmin = $HTTP_POST_VARS["xmin"]; $xmax = $HTTP_POST_VARS["xmax"]; //echo "Radio x: ".$radiox;echo "Radio y: ".$radioy; mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); $dblink=mysql_select_db("$dbname") or die("Error: ".mysql_error()." in mysql_select_db."); ?> <?php //include "db_print_table.php"; ?> <form action="graphem.php" method="post"> <table> <tr> <td>mote_id</td> <td><input type=radio name=radiox value="mote_id"</td> <td><input type=radio name=radioy value="mote_id"</td> </tr> <tr> <td>gps_hours</td> <td><input type=radio name=radiox value="gps_hours"</td> <td><input type=radio name=radioy value="gps_hours"</td> </tr> <tr> <td>gps_minutes</td> <td><input type=radio name=radiox value="gps_minutes"</td> <td><input type=radio name=radioy value="gps_minutes"</td> </tr> <tr> <td>gps_seconds</td> <td><input type=radio name=radiox value="gps_seconds"</td> <td><input type=radio name=radioy value="gps_seconds"</td> </tr> <tr> <td>lat_deg</td> <td><input type=radio name=radiox value="lat_deg"</td> <td><input type=radio name=radioy value="lat_deg"</td> </tr> <tr> <td>lat_dec_min</td> <td><input type=radio name=radiox value="lat_dec_min"</td> <td><input type=radio name=radioy value="lat_dec_min"</td> </tr> <tr> <td>long_deg</td> <td><input type=radio name=radiox value="long_deg"</td> <td><input type=radio name=radioy value="long_deg"</td> </tr> <tr> <td>long_dec_min</td> <td><input type=radio name=radiox value="long_dec_min"</td> <td><input type=radio name=radioy value="long_dec_min"</td> </tr> <tr> <td>nsew</td> <td><input type=radio name=radiox value="nsew"</td> <td><input type=radio name=radioy value="nsew"</td> </tr> <tr> <td>numsats</td> <td><input type=radio name=radiox value="numsats"</td> <td><input type=radio name=radioy value="numsats"</td> </tr> </table> <input type=hidden name=db1 value="dbname"> <input type=submit value="Plot"> </form> <?php $dbname = "gpsradio"; $statement = "use $dbname"; mysql_query($statement) or die("Error: ".mysql_error()." changing databases"); if ($radioy == null) { print("Error, must choose a y value\n"); // statement for selecting against y value only. } if ($radiox == null) { $statement = "select $radioy from location where lat_deg = 37 and long_deg = 122"; } else { $statement = "select $radiox,$radioy from location where lat_deg = 37 and long_deg = 122"; } $result = mysql_query($statement) or die("Error: ".mysql_error()." in select statement"); if (!$ofp=fopen("test.dat","w")) { echo "Unable to open data output file for writing.\n"; } if(!chmod ("test.dat", 0775)) { echo "chmod failed\n"; } function print_row($item2,$key) { fwrite($ofp,$item2); } if ($row = mysql_fetch_row($result)) { // for each row do { // For each column... $row = array_values($row); $size = count($row); for ($i=0; $i<$size; $i++) { // This is no good for multiple columns. fwrite($ofp,$row[$i]." "); } fwrite($ofp,"\n"); } while ($row = mysql_fetch_row($result)); } fclose($ofp); // This stuff doesn't work yet, but would be // be a better way to do this. Move all this // kind of stuff into dedicated functions. //$command = "echo -e 'set term png\n"; $command = "'set term png\n"; $command .= "set size 0.4\n"; //$command .= "plot \"test2.dat\"\n'"; $command .= "plot \"test.dat\"\n'"; //$command .= "| C:/gp373w32/pgnuplot.exe > test.png"; $command .= "| C:/gp373w32/pgnuplot.exe > test.png"; //$plotcommand = "echo -e 'set term png\n"; $plotcommand = "'set term png\n"; $plotcommand .= "set size 0.4\n"; $plotcommand .= "set output \"test.png\"\n"; $plotcommand .= "plot \"test.dat\" with lines 2'"; $plotstring = "set term png\n"; $plotstring .= "set size 0.8\n"; $plotstring .= "set output \"test.png\"\n"; $plotstring .= "plot \"test.dat\" with lines 2"; $gnuplot = " | C:\\gp373w32\\pgnuplot.exe"; //echo $command; // System call $systemcall = $plotcommand; $systemcall .= $gnuplot; $gnufile = "test2.gnu"; //$ofp = fopen("test1.gnu","w"); $ofp = fopen($gnufile,"w"); fwrite($ofp,$plotstring); fclose($ofp); //system("C:\\gp373w32\\pgnuplot.exe < ./test1.gnu"); //Try the redirect going the other way with an output file name. system("C:\\gp373w32\\pgnuplot.exe < ./$gnufile"); // > $outfile.png /* print("<pre>"); print($plotcommand.$gnuplot); print("</pre>"); */ //This doesn't work either. //`$plotcommand.$gnuplot`; /* $systemcall = $plotcommand; $systemcall .= $gnuplot; $e = escapeshellcmd($systemcall); // This would be preferable, but doesn't seem to work. if(system("echo -e $systemcall",$error)) { echo "System call succeeded\n"; } else { echo "System call failed with error $error\n"; } print("<pre>"); print($e); print("</pre>"); */ echo "<center>"; echo "<img src=\"test.png\">"; echo "</center>"; ?> <?php include("../nav_footer.php"); //$radiox = null; //$radioy = null; ?> <hr /> <p> Last Updated: $Date: 2004/04/02 00:18:36 $ by $Author: doolin $. </p> </body> </html> |
From: David M. D. <do...@us...> - 2004-04-01 15:10:09
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv395 Added Files: db_list_component.php Log Message: Added more php scripts for post processing. --- NEW FILE: db_list_component.php --- <!-- <table class="db_schema"> --> <table> <tr> <td>Database Name</td> <td>Selected</td> </tr> <?php $dblink=mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); $arr = array(1 => "mysql", 2 => "test"); $db_list = mysql_list_dbs($dblink); while ($row = mysql_fetch_object($db_list)) { $var=$row->Database; $flag=false; for ($i = 1; $i <= count($arr); $i++){ if ($arr[$i]==$var) { $flag=true;} } if($flag==false){ print ("<tr><td>"); print $var; print ("</td>"); print ("<td>"); print ("<input type=radio name=db1 value=\"$var\">"); print ("</td>"); print ("</tr>"); } } ?> </table> |
From: David M. D. <do...@us...> - 2004-04-01 15:09:25
|
Update of /cvsroot/firebug/firebug/web/demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32680/demo Modified Files: results.php Log Message: Added more php scripts for post processing. Index: results.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/demo/results.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** results.php 13 Mar 2004 05:09:02 -0000 1.2 --- results.php 1 Apr 2004 14:57:25 -0000 1.3 *************** *** 15,30 **** <h1>Demonstration monitoring</h1> <?php ! /** ! * Lots of broken code in here, mostly related to the ! * system() function. The workaround is not pretty, ! * the strings will need to be handled using lots of ! * small functions. ! */ mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); ! $statement = "use gpsradio"; mysql_query($statement) or die("Error: ".mysql_error()." changing databases"); --- 15,186 ---- <h1>Demonstration monitoring</h1> + + <!-- + <form action="db_select.php" method="post"> + --> + + <form action="results.php" method="post"> + <?php + if ($HTTP_POST_VARS["tbl1"]!=Null){ + $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; + $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; + $HTTP_SESSION_VARS["checkboxname"] = $HTTP_POST_VARS["cb"]; + } ! $dbname = $HTTP_POST_VARS["db1"]; ! $tblname = $HTTP_SESSION_VARS["tblname"]; ! $checkboxname = $HTTP_SESSION_VARS["cb"]; ! ! include("../db_list_component.php"); ! ?> ! <input type="submit" value="Show tables"> ! </form> ! ! ! ! ! <form action="results.php" method="post"> ! ! <?php ! ! //$dbname = $HTTP_POST_VARS["db1"]; mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); + $dblink=mysql_select_db("$dbname") or die("Error: ".mysql_error()." in mysql_select_db."); ! ! ! print("<h1>Database $dbname tables</h1>"); ! ! ! print("<center>\n"); ! print("<table class='db_schema'><tr><td>Table Name</td><td>Selected</td></tr>"); ! ! $result = mysql_list_tables($dbname); ! if($result) ! { ! while ($row = mysql_fetch_row($result)) { ! print ("<tr>"); ! ! print ("<td>"); ! print $row[0]; ! print ("</td>"); ! ! print ("<td>"); ! print ("<input type=radio name=tbl1 value=\"" . htmlspecialchars($row[0]) . "\">"); ! print ("</td>"); ! ! print ("</tr>"); ! } ! print ("</table>"); ! print ("<input type=hidden name=db1 value=\"$dbname\">"); ! print ("<input type=submit value=SUBMIT>"); ! } ! ?> ! ! </table> ! </form> ! </center> ! ! <form action="results.php" method="post"> ! ! <table class="db_schema"> ! <?php ! // Build the table header column names. Make this into a function. ! $statement = "show columns from $tblname;"; ! $columns = mysql_query($statement) or die("Error: ".mysql_error()." getting columns"); ! if ($columnname = mysql_fetch_array($columns)) { ! ! print("<tr>\n"); ! $names = array(); ! do { ! print ("<td>"); ! array_push($names, $columnname[0]); ! print $columnname[0]; ! print ("</td>"); ! print ("<td>"); ! print ("<input type=checkbox name=cb value=\"" . htmlspecialchars($row[0]) . "\">"); ! print ("</td>"); ! } while ($columnname = mysql_fetch_array($columns)); ! print("</tr>\n"); ! // This is pretty cool for debugging. ! //print_r($names); ! } ! print("</table>"); ! print ("<input type=hidden name=db1 value=\"$dbname\">"); ! print ("<input type=submit value=\"Checkbox\">"); ! ! print("<br />Checkbox name: ".$checkboxname."\n"); ! ?> ! </form> ! ! <?php ! echo "<table class=\"db_schema\">"; ! ! $statement = "show columns from $tblname;"; ! $columns = mysql_query($statement) or die("Error: ".mysql_error()." getting columns"); ! ! ! // Build the table header column names. Make this into a function. ! if ($columnname = mysql_fetch_array($columns)) { ! ! print("<tr>\n"); ! $names = array(); ! do { ! print ("<td>"); ! array_push($names, $columnname[0]); ! print $columnname[0]; ! print ("</td>"); ! } while ($columnname = mysql_fetch_array($columns)); ! print("</tr>\n"); ! // This is pretty cool for debugging. ! //print_r($names); ! } ! ! ! ! ! ! ! $statement = "select * from $tblname"; ! $result = mysql_query($statement); ! ! ! //Print the value for a row. ! ! function print_table_row($item2,$key) { ! ! print ("<td>\n"); ! echo "$item2\n"; ! print ("</td>\n"); ! } ! ! ! ! // Print every row. ! if ($row = mysql_fetch_row($result)) { ! ! // for each row ! do { ! // For each column... ! print ("<tr>"); ! $row = array_values($row); ! array_walk($row,'print_table_row'); ! print ("</tr>"); ! } while ($row = mysql_fetch_row($result)); ! } ! ! ! ?> ! </table> ! ! ! ! <?php ! ! $dbname = "gpsradio"; ! //$statement = "use gpsradio"; ! $statement = "use $dbname"; mysql_query($statement) or die("Error: ".mysql_error()." changing databases"); *************** *** 122,131 **** */ ! echo "<img src=\"test.png\">"; ?> --- 278,291 ---- */ ! echo "<center>"; echo "<img src=\"test.png\">"; + echo "</center>"; ?> + <?php + include("../nav_footer.php"); + ?> |
From: David M. D. <do...@us...> - 2004-03-30 23:38:56
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22068 Added Files: db_table_buttons.php Log Message: Buttons for database table access added. --- NEW FILE: db_table_buttons.php --- <form action="db_table_select.php" method="post"> <?php print("Choose different table: "); mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); $dblink=mysql_select_db("$dbname") or die("Error: ".mysql_error()." in mysql_select_db."); print("<table class='db_schema'>"); $result = mysql_list_tables($dbname); if($result) { while ($row = mysql_fetch_row($result)) { print ("<input type=hidden name=db1 value=\"$dbname\">"); print ("<input type=submit name=tbl1 value=\"" . htmlspecialchars($row[0]) . "\">"); } } ?> </form> |
From: David M. D. <do...@us...> - 2004-03-30 23:38:33
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21980 Modified Files: db_table_select.php Log Message: Buttons for database table access added. Index: db_table_select.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/db_table_select.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** db_table_select.php 9 Mar 2004 20:02:38 -0000 1.5 --- db_table_select.php 30 Mar 2004 23:26:52 -0000 1.6 *************** *** 41,44 **** --- 41,49 ---- print("<h1>Mote activity: Database $dbname, table $tblname</h1>"); ?> + + <?php + include("db_table_buttons.php"); + ?> + <center> *************** *** 104,107 **** --- 109,115 ---- <hr /> + + <hr /> + <?php include("nav_footer.php"); *************** *** 110,113 **** --- 118,123 ---- <hr /> + + <p> Sensor data last updated: |
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30727/src/org/firebug Modified Files: DBLogger.java FireLogger.java FireMsg.java GGAMsg.java ListenFB.java RangeLogger.java RangeMsg.java Added Files: GPSLogger.java Log Message: Reconfigured the ListenFB to accept arbitrary message AM types as long as there is a single byte magic number occupying the first byte of the payload. --- NEW FILE: GPSLogger.java --- package org.firebug; import org.firebug.database.MysqlDBHandler; import java.io.*; import java.sql.*; import java.util.Random; import net.tinyos.message.*; public class GPSLogger implements ListenFB.PacketPrinter { private MysqlDBHandler dbh; // Move this into some test code later. private Random rand = new Random(); public GPSLogger (String dbname) { dbh = new MysqlDBHandler("localhost","3306","root","",dbname,true); } public void print(InputStream in) { } /** All of the private methods for extracting * data from packets are deterministic, that is, * these methods should work on any random packet. */ private int getMoteID (byte [] packet) { int baseID=packet[5]; return baseID; //id; } private int get_packet_type(byte [] packet) { return (int)packet[2]; } public void print_packet_raw(byte [] packet) { for (int i = 0; i < packet.length; i++) { System.out.print(packet[i] + " "); } System.out.println("\n"); } public void print(byte [] packet) { GGAMsg msg = new GGAMsg(packet,5); Connection conn = dbh.getConnection(); int mote_id = msg.get_mote_id(); int hours = msg.get_hours(); int minutes = msg.get_minutes(); float dec_sec = msg.get_dec_sec(); int Lat_deg = msg.get_Lat_deg(); float Lat_dec_min = msg.get_Lat_dec_min(); int Long_deg = msg.get_Long_deg(); float Long_dec_min = msg.get_Long_dec_min(); int NSEWind = msg.get_NSEWind(); int num_sats = msg.get_num_sats(); //print_packet_raw(packet); /** FIXME: Ugly flow control using exception logic to * to track down a bbad statement, needs to be cleaned up. */ try { ResultSet rs; Statement stmt = conn.createStatement(); String insertquery = "INSERT INTO location VALUES (" + mote_id + ", " + hours + ", " + minutes + ", " + dec_sec + ", " + Lat_deg + ", " + Lat_dec_min + ", " + Long_deg + ", " + Long_dec_min + ", " + NSEWind + "," + num_sats + ")"; try { rs = stmt.executeQuery(insertquery); } catch (SQLException sqle) { System.out.println("Problem with insert statement: " + insertquery); sqle.printStackTrace(); } stmt.close(); } catch (SQLException sqle) { System.out.println("Problem with statement"); sqle.printStackTrace(); } dbh.return_connection(conn); } private static void test() { String database_name = "test"; GPSLogger dbl = new GPSLogger(database_name); while (true) { TestGPSLogger.test(dbl); try { Thread.sleep(3000); } catch (Exception e) { System.out.println(e); } } } public static void main(String [] args) { test(); } } /** FIXME: This whole test class needs to be fixed, or deleted. */ class TestGPSLogger { /** "test" is the _only_public_method_ in this * class. */ public static boolean test(GPSLogger dbl) { byte mote_id = (byte)0xff; FireMsg fmsg = new FireMsg(); fmsg.set_mote_id(1); fmsg.set_cnt(15); fmsg.set_temp(11); fmsg.set_rel_hum(12); fmsg.set_baro_pres(13); fmsg.set_lux(14); byte [] packet = {0x7e, //header 0x0, //header 0x0a, //packet type 0x7d, //group id 0x1a, //payload length 0x01, //routing 0x01, //routing 0x01, //routing 0x02, //routing 0x03, //routing mote_id, 0x12,0x67, //temp 0x37,0x2d, //rel_hum 0x4a,0x22 //baro }; dbl.print(packet); dbl.print_packet_raw(fmsg.dataGet()); return false; } /** All of the following methods are private * for a reason: they are only to be used in this * class. */ private static int getRandomID(int baseID) { int id = baseID + Math.abs(rand.nextInt())%5; return id; } private static float getRandomTemp(float basetemp) { float temp = (float)(basetemp + (3*rand.nextGaussian())); return temp; } private static float getRandomRelHum(float baserelhum) { float relhum = (float)(baserelhum + (3*rand.nextGaussian())); return relhum; } private static float getRandomBaroPres(float basebaropres) { float baropres = (float)(basebaropres + (3*rand.nextGaussian())); return baropres; } private static Random rand = new Random(); } Index: FireLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/FireLogger.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FireLogger.java 19 Feb 2004 17:41:53 -0000 1.2 --- FireLogger.java 27 Mar 2004 00:04:47 -0000 1.3 *************** *** 64,68 **** System.out.println(fmsg.toString()); ! int mote_id = fmsg.get_addr(); int cnt = fmsg.get_cnt(); float temp = fmsg.get_temp(); --- 64,68 ---- System.out.println(fmsg.toString()); ! int mote_id = fmsg.get_mote_id(); int cnt = fmsg.get_cnt(); float temp = fmsg.get_temp(); *************** *** 148,155 **** - - - - dbh.return_connection(conn); --- 148,151 ---- *************** *** 208,212 **** FireMsg fmsg = new FireMsg(); ! fmsg.set_addr(getRandomID(1)); fmsg.set_cnt(15); fmsg.set_temp(getRandomTemp((float)27.0)); --- 204,208 ---- FireMsg fmsg = new FireMsg(); ! fmsg.set_mote_id(getRandomID(1)); fmsg.set_cnt(15); fmsg.set_temp(getRandomTemp((float)27.0)); Index: RangeLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/RangeLogger.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RangeLogger.java 11 Mar 2004 23:53:36 -0000 1.1 --- RangeLogger.java 27 Mar 2004 00:04:47 -0000 1.2 *************** *** 65,68 **** --- 65,72 ---- //SensorMsg msg = new SensorMsg(packet,5,19); + int am_type = (int)(packet[5]&0xFF); + + + RangeMsg msg = new RangeMsg(packet,5,RangeMsg.DEFAULT_MESSAGE_SIZE); Index: ListenFB.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/ListenFB.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ListenFB.java 11 Mar 2004 23:52:00 -0000 1.18 --- ListenFB.java 27 Mar 2004 00:04:47 -0000 1.19 *************** *** 55,60 **** --- 55,68 ---- private OutputStream out; + /** This is lame, but anything else gets real hard real fast. */ + private static int AM_FIREDATA_MSG = 128; + private static int AM_RANGEDATA_MSG = 129; + private static int AM_GGAMSG = 130; + private static FireLogger firelogger; + private static RangeLogger rangelogger; + private static GPSLogger gpslogger; + /** Use this interface when changing the output * of the packet printing. Note that the packet *************** *** 97,100 **** --- 105,119 ---- + private PacketPrinter GetPrinter(int am_type) { + + if (am_type == AM_FIREDATA_MSG) { + return firelogger; + } else if (am_type == AM_RANGEDATA_MSG) { + return rangelogger; + } else { + return null; + } + } + public void open() throws NoSuchPortException, PortInUseException, *************** *** 149,152 **** --- 168,174 ---- } + static int extract_am_type(byte [] packet) { + return (int)(packet[5]&0xFF); + } /** FIXME: Need some changes here. First, change the *************** *** 158,167 **** * msg printer. */ ! public void read(Vector printers) throws IOException { ! //public void read(PacketPrinter printer) throws IOException { - //int i; - //int count = 0; - //byte[] packet = new byte[MAX_MSG_SIZE]; PacketSource reader = BuildSource.makePacketSource(); if (reader == null) { --- 180,186 ---- * msg printer. */ ! //public void read(Vector printers) throws IOException { ! public void read() throws IOException { PacketSource reader = BuildSource.makePacketSource(); if (reader == null) { *************** *** 173,184 **** reader.open(PrintStreamMessenger.err); for (;;) { byte[] packet = reader.readPacket(); ! Enumeration enum = printers.elements(); ! while (enum.hasMoreElements()) { ! PacketPrinter printer = (PacketPrinter)enum.nextElement(); ! printer.print(packet); ! } ! ! System.out.println(); } } --- 192,205 ---- reader.open(PrintStreamMessenger.err); for (;;) { + byte[] packet = reader.readPacket(); ! ! /** Right here we need to extract a magic number from the ! * payload to determine which kind of payload it is. ! */ ! int am_type = extract_am_type(packet); ! System.out.println("AM type number: " + am_type); ! PacketPrinter printer = GetPrinter(am_type); ! printer.print(packet); } } *************** *** 187,227 **** } - /* - // Note that i is an integer, in.read() - // is returning 4 bytes at a time. - while ((i = in.read()) != -1) { - - String val = Integer.toHexString( i & 0xff); - if (val.length() == 1) { - val = "0" + val; - } - - if(i == 0x7e || count != 0){ - - // We have to cast i from int to byte... - packet[count] = (byte)i; - System.out.print(val + " "); // Packet data - count++; - if (count >= MAX_MSG_SIZE) { - System.out.println(); - count = 0; - packetLength = MAX_MSG_SIZE; - // Might be faster to index the Vector. - Enumeration enum = printers.elements(); - while (enum.hasMoreElements()) { - PacketPrinter printer = (PacketPrinter)enum.nextElement(); - printer.print(packet); - } - } - } - else{ - System.out.println("extra byte: " + val); - } - } - */ - } --- 208,215 ---- } + } *************** *** 260,294 **** handle_args(args); - - Vector printers = new Vector(5); - String port = args[args.length - 1]; ListenFB reader = new ListenFB(port); - //SensorPacket print = new SensorPacket(); - //DBLogger dblogger = new DBLogger(dbname); - - //RawPacket rawpacket = new RawPacket(); - //FireLogger firelogger = new FireLogger(dbname); - RangeLogger rangelogger = new RangeLogger(dbname); - - //RawPacket rawpacket = new RawPacket(); - //FireLogger firelogger = new FireLogger(dbname); - //GPSLogger gpslogger = new GPSLogger(dbname); - - - //printers.add(print); - //printers.add(dblogger); - - //printers.add(firelogger); - printers.add(rangelogger); - - - //printers.add(firelogger); - //printers.add(gpslogger); try { ! //reader.open(); ! reader.read(printers); } catch (Exception e) { e.printStackTrace(); --- 248,260 ---- handle_args(args); String port = args[args.length - 1]; ListenFB reader = new ListenFB(port); + firelogger = new FireLogger(dbname); + rangelogger = new RangeLogger(dbname); + gpslogger = new GPSLogger(dbname); try { ! reader.read(); } catch (Exception e) { e.printStackTrace(); Index: DBLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/DBLogger.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** DBLogger.java 11 Mar 2004 23:52:00 -0000 1.26 --- DBLogger.java 27 Mar 2004 00:04:47 -0000 1.27 *************** *** 212,216 **** */ ! fmsg.set_addr(1); fmsg.set_cnt(15); fmsg.set_temp(11); --- 212,216 ---- */ ! fmsg.set_mote_id(1); fmsg.set_cnt(15); fmsg.set_temp(11); Index: FireMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/FireMsg.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FireMsg.java 11 Mar 2004 23:52:00 -0000 1.2 --- FireMsg.java 27 Mar 2004 00:04:47 -0000 1.3 *************** *** 10,19 **** /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 20; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 128; ! /** Create a new FireMsg of size 20. */ public FireMsg() { super(DEFAULT_MESSAGE_SIZE); --- 10,19 ---- /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 21; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 128; ! /** Create a new FireMsg of size 21. */ public FireMsg() { super(DEFAULT_MESSAGE_SIZE); *************** *** 88,91 **** --- 88,94 ---- String s = "Message <FireMsg> \n"; try { + s += " [magic=0x"+Long.toHexString(get_magic())+"]\n"; + } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } + try { s += " [mote_id=0x"+Long.toHexString(get_mote_id())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } *************** *** 111,117 **** ///////////////////////////////////////////////////////// // Accessor methods for field: mote_id // Field type: int ! // Offset (bits): 0 // Size (bits): 16 ///////////////////////////////////////////////////////// --- 114,183 ---- ///////////////////////////////////////////////////////// + // Accessor methods for field: magic + // Field type: short + // Offset (bits): 0 + // Size (bits): 8 + ///////////////////////////////////////////////////////// + + /** + * Return whether the field 'magic' is signed (true). + */ + public static boolean isSigned_magic() { + return true; + } + + /** + * Return whether the field 'magic' is an array (false). + */ + public static boolean isArray_magic() { + return false; + } + + /** + * Return the offset (in bytes) of the field 'magic' + */ + public static int offset_magic() { + return (0 / 8); + } + + /** + * Return the offset (in bits) of the field 'magic' + */ + public static int offsetBits_magic() { + return 0; + } + + /** + * Return the value (as a short) of the field 'magic' + */ + public short get_magic() { + return (short)getUIntElement(offsetBits_magic(), 8); + } + + /** + * Set the value of the field 'magic' + */ + public void set_magic(short value) { + setUIntElement(offsetBits_magic(), 8, value); + } + + /** + * Return the size, in bytes, of the field 'magic' + */ + public static int size_magic() { + return (8 / 8); + } + + /** + * Return the size, in bits, of the field 'magic' + */ + public static int sizeBits_magic() { + return 8; + } + + ///////////////////////////////////////////////////////// // Accessor methods for field: mote_id // Field type: int ! // Offset (bits): 8 // Size (bits): 16 ///////////////////////////////////////////////////////// *************** *** 135,139 **** */ public static int offset_mote_id() { ! return (0 / 8); } --- 201,205 ---- */ public static int offset_mote_id() { ! return (8 / 8); } *************** *** 142,146 **** */ public static int offsetBits_mote_id() { ! return 0; } --- 208,212 ---- */ public static int offsetBits_mote_id() { ! return 8; } *************** *** 176,180 **** // Accessor methods for field: cnt // Field type: int ! // Offset (bits): 16 // Size (bits): 16 ///////////////////////////////////////////////////////// --- 242,246 ---- // Accessor methods for field: cnt // Field type: int ! // Offset (bits): 24 // Size (bits): 16 ///////////////////////////////////////////////////////// *************** *** 198,202 **** */ public static int offset_cnt() { ! return (16 / 8); } --- 264,268 ---- */ public static int offset_cnt() { ! return (24 / 8); } *************** *** 205,209 **** */ public static int offsetBits_cnt() { ! return 16; } --- 271,275 ---- */ public static int offsetBits_cnt() { ! return 24; } *************** *** 239,243 **** // Accessor methods for field: temp // Field type: float ! // Offset (bits): 32 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 305,309 ---- // Accessor methods for field: temp // Field type: float ! // Offset (bits): 40 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 261,265 **** */ public static int offset_temp() { ! return (32 / 8); } --- 327,331 ---- */ public static int offset_temp() { ! return (40 / 8); } *************** *** 268,272 **** */ public static int offsetBits_temp() { ! return 32; } --- 334,338 ---- */ public static int offsetBits_temp() { ! return 40; } *************** *** 302,306 **** // Accessor methods for field: rel_hum // Field type: float ! // Offset (bits): 64 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 368,372 ---- // Accessor methods for field: rel_hum // Field type: float ! // Offset (bits): 72 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 324,328 **** */ public static int offset_rel_hum() { ! return (64 / 8); } --- 390,394 ---- */ public static int offset_rel_hum() { ! return (72 / 8); } *************** *** 331,335 **** */ public static int offsetBits_rel_hum() { ! return 64; } --- 397,401 ---- */ public static int offsetBits_rel_hum() { ! return 72; } *************** *** 365,369 **** // Accessor methods for field: baro_pres // Field type: float ! // Offset (bits): 96 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 431,435 ---- // Accessor methods for field: baro_pres // Field type: float ! // Offset (bits): 104 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 387,391 **** */ public static int offset_baro_pres() { ! return (96 / 8); } --- 453,457 ---- */ public static int offset_baro_pres() { ! return (104 / 8); } *************** *** 394,398 **** */ public static int offsetBits_baro_pres() { ! return 96; } --- 460,464 ---- */ public static int offsetBits_baro_pres() { ! return 104; } *************** *** 428,432 **** // Accessor methods for field: lux // Field type: float ! // Offset (bits): 128 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 494,498 ---- // Accessor methods for field: lux // Field type: float ! // Offset (bits): 136 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 450,454 **** */ public static int offset_lux() { ! return (128 / 8); } --- 516,520 ---- */ public static int offset_lux() { ! return (136 / 8); } *************** *** 457,461 **** */ public static int offsetBits_lux() { ! return 128; } --- 523,527 ---- */ public static int offsetBits_lux() { ! return 136; } Index: RangeMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/RangeMsg.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RangeMsg.java 11 Mar 2004 23:53:36 -0000 1.1 --- RangeMsg.java 27 Mar 2004 00:04:47 -0000 1.2 *************** *** 10,19 **** /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 8; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 129; ! /** Create a new RangeMsg of size 8. */ public RangeMsg() { super(DEFAULT_MESSAGE_SIZE); --- 10,19 ---- /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 9; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 129; ! /** Create a new RangeMsg of size 9. */ public RangeMsg() { super(DEFAULT_MESSAGE_SIZE); *************** *** 88,91 **** --- 88,94 ---- String s = "Message <RangeMsg> \n"; try { + s += " [magic=0x"+Long.toHexString(get_magic())+"]\n"; + } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } + try { s += " [mote_id=0x"+Long.toHexString(get_mote_id())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } *************** *** 105,111 **** ///////////////////////////////////////////////////////// // Accessor methods for field: mote_id // Field type: int, unsigned ! // Offset (bits): 0 // Size (bits): 16 ///////////////////////////////////////////////////////// --- 108,177 ---- ///////////////////////////////////////////////////////// + // Accessor methods for field: magic + // Field type: short, unsigned + // Offset (bits): 0 + // Size (bits): 8 + ///////////////////////////////////////////////////////// + + /** + * Return whether the field 'magic' is signed (false). + */ + public static boolean isSigned_magic() { + return false; + } + + /** + * Return whether the field 'magic' is an array (false). + */ + public static boolean isArray_magic() { + return false; + } + + /** + * Return the offset (in bytes) of the field 'magic' + */ + public static int offset_magic() { + return (0 / 8); + } + + /** + * Return the offset (in bits) of the field 'magic' + */ + public static int offsetBits_magic() { + return 0; + } + + /** + * Return the value (as a short) of the field 'magic' + */ + public short get_magic() { + return (short)getUIntElement(offsetBits_magic(), 8); + } + + /** + * Set the value of the field 'magic' + */ + public void set_magic(short value) { + setUIntElement(offsetBits_magic(), 8, value); + } + + /** + * Return the size, in bytes, of the field 'magic' + */ + public static int size_magic() { + return (8 / 8); + } + + /** + * Return the size, in bits, of the field 'magic' + */ + public static int sizeBits_magic() { + return 8; + } + + ///////////////////////////////////////////////////////// // Accessor methods for field: mote_id // Field type: int, unsigned ! // Offset (bits): 8 // Size (bits): 16 ///////////////////////////////////////////////////////// *************** *** 129,133 **** */ public static int offset_mote_id() { ! return (0 / 8); } --- 195,199 ---- */ public static int offset_mote_id() { ! return (8 / 8); } *************** *** 136,140 **** */ public static int offsetBits_mote_id() { ! return 0; } --- 202,206 ---- */ public static int offsetBits_mote_id() { ! return 8; } *************** *** 170,174 **** // Accessor methods for field: count // Field type: int, unsigned ! // Offset (bits): 16 // Size (bits): 16 ///////////////////////////////////////////////////////// --- 236,240 ---- // Accessor methods for field: count // Field type: int, unsigned ! // Offset (bits): 24 // Size (bits): 16 ///////////////////////////////////////////////////////// *************** *** 192,196 **** */ public static int offset_count() { ! return (16 / 8); } --- 258,262 ---- */ public static int offset_count() { ! return (24 / 8); } *************** *** 199,203 **** */ public static int offsetBits_count() { ! return 16; } --- 265,269 ---- */ public static int offsetBits_count() { ! return 24; } *************** *** 233,237 **** // Accessor methods for field: rssi // Field type: int, unsigned ! // Offset (bits): 32 // Size (bits): 16 ///////////////////////////////////////////////////////// --- 299,303 ---- // Accessor methods for field: rssi // Field type: int, unsigned ! // Offset (bits): 40 // Size (bits): 16 ///////////////////////////////////////////////////////// *************** *** 255,259 **** */ public static int offset_rssi() { ! return (32 / 8); } --- 321,325 ---- */ public static int offset_rssi() { ! return (40 / 8); } *************** *** 262,266 **** */ public static int offsetBits_rssi() { ! return 32; } --- 328,332 ---- */ public static int offsetBits_rssi() { ! return 40; } *************** *** 296,300 **** // Accessor methods for field: voltage // Field type: int, unsigned ! // Offset (bits): 48 // Size (bits): 16 ///////////////////////////////////////////////////////// --- 362,366 ---- // Accessor methods for field: voltage // Field type: int, unsigned ! // Offset (bits): 56 // Size (bits): 16 ///////////////////////////////////////////////////////// *************** *** 318,322 **** */ public static int offset_voltage() { ! return (48 / 8); } --- 384,388 ---- */ public static int offset_voltage() { ! return (56 / 8); } *************** *** 325,329 **** */ public static int offsetBits_voltage() { ! return 48; } --- 391,395 ---- */ public static int offsetBits_voltage() { ! return 56; } Index: GGAMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/GGAMsg.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GGAMsg.java 11 Mar 2004 23:52:00 -0000 1.3 --- GGAMsg.java 27 Mar 2004 00:04:47 -0000 1.4 *************** *** 10,19 **** /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 20; /** The Active Message type associated with this message. */ ! public static final int AM_TYPE = 129; ! /** Create a new GGAMsg of size 20. */ public GGAMsg() { super(DEFAULT_MESSAGE_SIZE); --- 10,19 ---- /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 21; /** The Active Message type associated with this message. */ ! public static final int AM_TYPE = 130; ! /** Create a new GGAMsg of size 21. */ public GGAMsg() { super(DEFAULT_MESSAGE_SIZE); *************** *** 88,91 **** --- 88,94 ---- String s = "Message <GGAMsg> \n"; try { + s += " [magic=0x"+Long.toHexString(get_magic())+"]\n"; + } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } + try { s += " [mote_id=0x"+Long.toHexString(get_mote_id())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } *************** *** 123,129 **** ///////////////////////////////////////////////////////// // Accessor methods for field: mote_id // Field type: int, unsigned ! // Offset (bits): 0 // Size (bits): 16 ///////////////////////////////////////////////////////// --- 126,195 ---- ///////////////////////////////////////////////////////// + // Accessor methods for field: magic + // Field type: short, unsigned + // Offset (bits): 0 + // Size (bits): 8 + ///////////////////////////////////////////////////////// + + /** + * Return whether the field 'magic' is signed (false). + */ + public static boolean isSigned_magic() { + return false; + } + + /** + * Return whether the field 'magic' is an array (false). + */ + public static boolean isArray_magic() { + return false; + } + + /** + * Return the offset (in bytes) of the field 'magic' + */ + public static int offset_magic() { + return (0 / 8); + } + + /** + * Return the offset (in bits) of the field 'magic' + */ + public static int offsetBits_magic() { + return 0; + } + + /** + * Return the value (as a short) of the field 'magic' + */ + public short get_magic() { + return (short)getUIntElement(offsetBits_magic(), 8); + } + + /** + * Set the value of the field 'magic' + */ + public void set_magic(short value) { + setUIntElement(offsetBits_magic(), 8, value); + } + + /** + * Return the size, in bytes, of the field 'magic' + */ + public static int size_magic() { + return (8 / 8); + } + + /** + * Return the size, in bits, of the field 'magic' + */ + public static int sizeBits_magic() { + return 8; + } + + ///////////////////////////////////////////////////////// // Accessor methods for field: mote_id // Field type: int, unsigned ! // Offset (bits): 8 // Size (bits): 16 ///////////////////////////////////////////////////////// *************** *** 147,151 **** */ public static int offset_mote_id() { ! return (0 / 8); } --- 213,217 ---- */ public static int offset_mote_id() { ! return (8 / 8); } *************** *** 154,158 **** */ public static int offsetBits_mote_id() { ! return 0; } --- 220,224 ---- */ public static int offsetBits_mote_id() { ! return 8; } *************** *** 188,192 **** // Accessor methods for field: hours // Field type: short, unsigned ! // Offset (bits): 16 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 254,258 ---- // Accessor methods for field: hours // Field type: short, unsigned ! // Offset (bits): 24 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 210,214 **** */ public static int offset_hours() { ! return (16 / 8); } --- 276,280 ---- */ public static int offset_hours() { ! return (24 / 8); } *************** *** 217,221 **** */ public static int offsetBits_hours() { ! return 16; } --- 283,287 ---- */ public static int offsetBits_hours() { ! return 24; } *************** *** 251,255 **** // Accessor methods for field: minutes // Field type: short, unsigned ! // Offset (bits): 24 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 317,321 ---- // Accessor methods for field: minutes // Field type: short, unsigned ! // Offset (bits): 32 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 273,277 **** */ public static int offset_minutes() { ! return (24 / 8); } --- 339,343 ---- */ public static int offset_minutes() { ! return (32 / 8); } *************** *** 280,284 **** */ public static int offsetBits_minutes() { ! return 24; } --- 346,350 ---- */ public static int offsetBits_minutes() { ! return 32; } *************** *** 314,318 **** // Accessor methods for field: dec_sec // Field type: float, unsigned ! // Offset (bits): 32 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 380,384 ---- // Accessor methods for field: dec_sec // Field type: float, unsigned ! // Offset (bits): 40 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 336,340 **** */ public static int offset_dec_sec() { ! return (32 / 8); } --- 402,406 ---- */ public static int offset_dec_sec() { ! return (40 / 8); } *************** *** 343,347 **** */ public static int offsetBits_dec_sec() { ! return 32; } --- 409,413 ---- */ public static int offsetBits_dec_sec() { ! return 40; } *************** *** 377,381 **** // Accessor methods for field: Lat_deg // Field type: short, unsigned ! // Offset (bits): 64 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 443,447 ---- // Accessor methods for field: Lat_deg // Field type: short, unsigned ! // Offset (bits): 72 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 399,403 **** */ public static int offset_Lat_deg() { ! return (64 / 8); } --- 465,469 ---- */ public static int offset_Lat_deg() { ! return (72 / 8); } *************** *** 406,410 **** */ public static int offsetBits_Lat_deg() { ! return 64; } --- 472,476 ---- */ public static int offsetBits_Lat_deg() { ! return 72; } *************** *** 440,444 **** // Accessor methods for field: Lat_dec_min // Field type: float, unsigned ! // Offset (bits): 72 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 506,510 ---- // Accessor methods for field: Lat_dec_min // Field type: float, unsigned ! // Offset (bits): 80 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 462,466 **** */ public static int offset_Lat_dec_min() { ! return (72 / 8); } --- 528,532 ---- */ public static int offset_Lat_dec_min() { ! return (80 / 8); } *************** *** 469,473 **** */ public static int offsetBits_Lat_dec_min() { ! return 72; } --- 535,539 ---- */ public static int offsetBits_Lat_dec_min() { ! return 80; } *************** *** 503,507 **** // Accessor methods for field: Long_deg // Field type: short, unsigned ! // Offset (bits): 104 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 569,573 ---- // Accessor methods for field: Long_deg // Field type: short, unsigned ! // Offset (bits): 112 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 525,529 **** */ public static int offset_Long_deg() { ! return (104 / 8); } --- 591,595 ---- */ public static int offset_Long_deg() { ! return (112 / 8); } *************** *** 532,536 **** */ public static int offsetBits_Long_deg() { ! return 104; } --- 598,602 ---- */ public static int offsetBits_Long_deg() { ! return 112; } *************** *** 566,570 **** // Accessor methods for field: Long_dec_min // Field type: float, unsigned ! // Offset (bits): 112 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 632,636 ---- // Accessor methods for field: Long_dec_min // Field type: float, unsigned ! // Offset (bits): 120 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 588,592 **** */ public static int offset_Long_dec_min() { ! return (112 / 8); } --- 654,658 ---- */ public static int offset_Long_dec_min() { ! return (120 / 8); } *************** *** 595,599 **** */ public static int offsetBits_Long_dec_min() { ! return 112; } --- 661,665 ---- */ public static int offsetBits_Long_dec_min() { ! return 120; } *************** *** 629,633 **** // Accessor methods for field: NSEWind // Field type: short, unsigned ! // Offset (bits): 144 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 695,699 ---- // Accessor methods for field: NSEWind // Field type: short, unsigned ! // Offset (bits): 152 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 651,655 **** */ public static int offset_NSEWind() { ! return (144 / 8); } --- 717,721 ---- */ public static int offset_NSEWind() { ! return (152 / 8); } *************** *** 658,662 **** */ public static int offsetBits_NSEWind() { ! return 144; } --- 724,728 ---- */ public static int offsetBits_NSEWind() { ! return 152; } *************** *** 692,696 **** // Accessor methods for field: num_sats // Field type: short, unsigned ! // Offset (bits): 152 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 758,762 ---- // Accessor methods for field: num_sats // Field type: short, unsigned ! // Offset (bits): 160 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 714,718 **** */ public static int offset_num_sats() { ! return (152 / 8); } --- 780,784 ---- */ public static int offset_num_sats() { ! return (160 / 8); } *************** *** 721,725 **** */ public static int offsetBits_num_sats() { ! return 152; } --- 787,791 ---- */ public static int offsetBits_num_sats() { ! return 160; } |
From: David M. D. <do...@us...> - 2004-03-26 01:02:59
|
Update of /cvsroot/firebug/firebug/project/java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19533/project/java Modified Files: .cvsignore Log Message: Synching up from home. Index: .cvsignore =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 2 Apr 2003 00:58:57 -0000 1.1 --- .cvsignore 26 Mar 2004 00:52:06 -0000 1.2 *************** *** 1 **** ! classes dist *~ --- 1 ---- ! classes dist *~ xerces.jar |
From: David M. D. <do...@us...> - 2004-03-26 01:02:59
|
Update of /cvsroot/firebug/firebug/project/src/sensordata In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19533/project/src/sensordata Modified Files: mkmsg.sh Log Message: Synching up from home. Index: mkmsg.sh =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/sensordata/mkmsg.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mkmsg.sh 19 Feb 2004 17:06:53 -0000 1.2 --- mkmsg.sh 26 Mar 2004 00:52:07 -0000 1.3 *************** *** 11,12 **** --- 11,16 ---- mig java -java-classname=org.firebug.FireMsg -I. $HOME/firebug/fireboard/tos/sensorboards/xbow_mts420ca/fireboard.h Firedata_msg > FireMsg.java mig java -java-classname=org.firebug.GGAMsg -I. $HOME/firebug/fireboard/tos/sensors/leadtek9546/leadtek_9546.h GGAMsg > GGAMsg.java + mig java -java-classname=org.firebug.RangeMsg -I. $HOME/firebug/fireboard/tos/sensorboards/xbow_mts420ca/fireboard.h Rangedata_msg > RangeMsg.java + + + cp *.java ../../java/src/org/firebug |
From: David M. D. <do...@us...> - 2004-03-26 01:02:58
|
Update of /cvsroot/firebug/firebug/doc/spie2004 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19533/doc/spie2004 Modified Files: spie_2004.tex Log Message: Synching up from home. Index: spie_2004.tex =================================================================== RCS file: /cvsroot/firebug/firebug/doc/spie2004/spie_2004.tex,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** spie_2004.tex 23 Jan 2004 01:21:30 -0000 1.9 --- spie_2004.tex 26 Mar 2004 00:52:06 -0000 1.10 *************** *** 40,44 **** } ! \authorinfo{Further author information: (Send correspondence to A.A.A.)\\A.A.A.: E-mail: aa...@tb..., Telephone: 1 505 123 1234\\ B.B.A.: E-mail: bb...@cm..., Telephone: +33 (0)1 98 76 54 32} \begin{document} --- 40,47 ---- } ! \authorinfo{Further author information: ! (Send correspondence to A.A.A.)\\A.A.A.: E-mail: aa...@tb..., ! Telephone: 1 505 123 1234\\ B.B.A.: E-mail: bb...@cm..., ! Telephone: +33 (0)1 98 76 54 32} \begin{document} |