firebug-cvs Mailing List for FireBug: wireless wildfire monitoring (Page 38)
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: <cs...@us...> - 2003-05-23 15:33:19
|
Update of /cvsroot/firebug/firebug/project/java In directory sc8-pr-cvs1:/tmp/cvs-serv16453 Added Files: gpsrun.sh Log Message: gps shell added --- NEW FILE: gpsrun.sh --- #!/usr/bin/sh # Make sure JAVA_HOME is set. if [ -n "$JAVA_HOME" ] ; then # do nothing else echo "Please set JAVA_HOME to point to your JAVA installation." exit 1 fi export COMMJAR=$JAVA_HOME\\lib\\comm.jar export MSGPATH=C:\\tinyos-1.x\\tools\\java #java -cp ".\\dist\\firebug.jar;$JAVA_HOME\\lib\\comm.jar" \ java -cp ".\\dist\\firebug.jar;$COMMJAR;$MSGPATH" \ org.firebug.gps.gpsBcast |
From: <cs...@us...> - 2003-05-23 15:18:37
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug/gps In directory sc8-pr-cvs1:/tmp/cvs-serv8164/gps Log Message: Directory /cvsroot/firebug/firebug/project/java/src/org/firebug/gps added to the repository |
From: <do...@us...> - 2003-05-23 14:58:32
|
Update of /cvsroot/firebug/firebug/project/src/multihop In directory sc8-pr-cvs1:/tmp/cvs-serv32007 Modified Files: CollectDataFB.nc CollectDataMFB.nc Log Message: Added random number capability to collectdata for testing purposes. Index: CollectDataFB.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/CollectDataFB.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CollectDataFB.nc 19 May 2003 07:06:46 -0000 1.2 --- CollectDataFB.nc 23 May 2003 14:58:27 -0000 1.3 *************** *** 1,34 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ ! ! ! /** ! * Author: Terence Tong, Alec Woo, Max Min Chen ! */ ! ! ! includes RoutingStackShared; ! ! configuration CollectDataFB { ! ! } ! ! ! implementation { ! ! components Main, ! CollectDataMFB, ! MHDispatcher, ! TimerWrapper, ! LedsC, ! BcastCommand; ! ! ! ! Main.StdControl -> CollectDataMFB.StdControl; ! ! CollectDataMFB.MultiHopSend -> MHDispatcher.MultiHopSend[unique("MHDispathcer")]; ! CollectDataMFB.Timer -> TimerWrapper.Timer[unique("Timer")]; ! CollectDataMFB.Leds -> LedsC; ! CollectDataMFB.HandleBcast -> BcastCommand.HandleBcast; ! ! } --- 1,36 ---- ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ ! ! ! /** ! * Author: Terence Tong, Alec Woo, Max Min Chen ! */ ! ! ! includes RoutingStackShared; ! ! configuration CollectDataFB { ! ! } ! ! ! implementation { ! ! components Main, ! CollectDataMFB, ! MHDispatcher, ! TimerWrapper, ! LedsC, ! BcastCommand, ! RandomLFSR; ! ! ! ! Main.StdControl -> CollectDataMFB.StdControl; ! ! CollectDataMFB.MultiHopSend -> MHDispatcher.MultiHopSend[unique("MHDispathcer")]; ! CollectDataMFB.Timer -> TimerWrapper.Timer[unique("Timer")]; ! CollectDataMFB.Leds -> LedsC; ! CollectDataMFB.HandleBcast -> BcastCommand.HandleBcast; ! CollectDataMFB.Random -> RandomLFSR; ! ! } Index: CollectDataMFB.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/CollectDataMFB.nc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CollectDataMFB.nc 23 May 2003 00:57:14 -0000 1.5 --- CollectDataMFB.nc 23 May 2003 14:58:27 -0000 1.6 *************** *** 1,3 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** --- 1,3 ---- ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil; font-lock-mode: t -*- */ /** *************** *** 19,22 **** --- 19,29 ---- includes Routing; + + /** max int is 2^16 for the lfsr random + * number generation scheme used in tinyos. + */ + #define FB_RAND_MAX 256*256 + + module CollectDataMFB { *************** *** 32,35 **** --- 39,43 ---- interface Leds; interface HandleBcast; + interface Random; } *************** *** 79,90 **** float get_temp() { ! #if 0 ! int randnum; ! int max = RAND_MAX; float x1,x2,w,y1,y2; do { ! x1 = (2*(rand()/max)) - 1; ! x2 = (2*(rand()/max)) - 1; w = x1*x1 + x2*x2; } while (w >= 1.0); --- 87,96 ---- float get_temp() { ! //#if 0 float x1,x2,w,y1,y2; do { ! x1 = (2*((call Random.rand())/FB_RAND_MAX)) - 1; ! x2 = (2*((call Random.rand())/FB_RAND_MAX)) - 1; w = x1*x1 + x2*x2; } while (w >= 1.0); *************** *** 93,97 **** y1 = x1*w; y2 = x2*w; ! #endif return 72.1; --- 99,103 ---- y1 = x1*w; y2 = x2*w; ! //#endif return 72.1; |
From: <che...@us...> - 2003-05-23 00:57:18
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv14580/web Modified Files: table_select.php Log Message: sensor msg now parsed collectly into the DB Index: table_select.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/table_select.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** table_select.php 22 May 2003 21:48:45 -0000 1.5 --- table_select.php 23 May 2003 00:57:14 -0000 1.6 *************** *** 39,42 **** --- 39,44 ---- $dbname = $HTTP_SESSION_VARS["dbname"]; $tblname = $HTTP_SESSION_VARS["tblname"]; + print $dbname; + print $tblname; mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); |
From: <che...@us...> - 2003-05-23 00:57:17
|
Update of /cvsroot/firebug/firebug/project/src/multihop In directory sc8-pr-cvs1:/tmp/cvs-serv14580/project/src/multihop Modified Files: CollectDataMFB.nc Makefile Log Message: sensor msg now parsed collectly into the DB Index: CollectDataMFB.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/CollectDataMFB.nc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CollectDataMFB.nc 22 May 2003 22:39:51 -0000 1.4 --- CollectDataMFB.nc 23 May 2003 00:57:14 -0000 1.5 *************** *** 41,52 **** struct DataFormat_t { ! uint8_t addr; ! //uint8_t cnt; ! //uint8_t sampledata; ! ! //uint16_t temp; float temp; ! //uint16_t rel_hum; ! //uint16_t baro; }; --- 41,48 ---- struct DataFormat_t { ! uint16_t addr; float temp; ! float rel_hum; ! float baro_pres; }; *************** *** 80,86 **** * @url http://www.taygeta.com/random/gaussian.html */ float get_temp() { ! //#if 0 int randnum; int max = RAND_MAX; --- 76,83 ---- * @url http://www.taygeta.com/random/gaussian.html */ + float get_temp() { ! #if 0 int randnum; int max = RAND_MAX; *************** *** 96,104 **** y1 = x1*w; y2 = x2*w; ! //#endif ! return x1; } /** --- 93,108 ---- y1 = x1*w; y2 = x2*w; ! #endif ! return 72.1; } + float get_rel_hum() { + return 98.3; + } + + float get_baro_pres() { + return 29.1; + } /** *************** *** 130,133 **** --- 134,140 ---- //df->temp=0x04CE; df->temp = get_temp(); + df->rel_hum = get_rel_hum(); + df->baro_pres = get_baro_pres(); + sending = 1; result = call MultiHopSend.send(&msgToSend, sizeof(struct DataFormat_t)); Index: Makefile =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile 19 May 2003 20:03:30 -0000 1.9 --- Makefile 23 May 2003 00:57:14 -0000 1.10 *************** *** 20,25 **** MAIN_SREC= build/mica/main.srec ! #APPLICATION = CollectDataFB.nc ! APPLICATION = BaseStation.nc --- 20,25 ---- MAIN_SREC= build/mica/main.srec ! APPLICATION = CollectDataFB.nc ! #APPLICATION = BaseStation.nc |
From: <che...@us...> - 2003-05-23 00:57:17
|
Update of /cvsroot/firebug/firebug/project/src/sensordata In directory sc8-pr-cvs1:/tmp/cvs-serv14580/project/src/sensordata Modified Files: WeatherBoard.nc WeatherBoardM.nc Log Message: sensor msg now parsed collectly into the DB Index: WeatherBoard.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/sensordata/WeatherBoard.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WeatherBoard.nc 22 Apr 2003 18:36:37 -0000 1.2 --- WeatherBoard.nc 23 May 2003 00:57:14 -0000 1.3 *************** *** 66,71 **** TimerC, //Sensors SensirionHumidity; - --- 66,71 ---- TimerC, //Sensors + TaosPhoto, SensirionHumidity; *************** *** 75,84 **** WeatherBoardM.Timer1 -> TimerC.Timer[unique("Timer")]; WeatherBoardM.Leds -> LedsC; ! WeatherBoardM.SendMsg -> GenericComm.SendMsg[10]; //Humidity Sensor Wire WeatherBoardM.ADCControl_Humidity -> SensirionHumidity.StdControl; WeatherBoardM.Humidity -> SensirionHumidity.Humidity; - WeatherBoardM.Temperature_Humidity -> SensirionHumidity.Temperature; } --- 75,87 ---- WeatherBoardM.Timer1 -> TimerC.Timer[unique("Timer")]; WeatherBoardM.Leds -> LedsC; ! WeatherBoardM.SendMsg -> GenericComm.SendMsg[17]; //Humidity Sensor Wire WeatherBoardM.ADCControl_Humidity -> SensirionHumidity.StdControl; WeatherBoardM.Humidity -> SensirionHumidity.Humidity; + //Photo Sensor wire + WeatherBoardM.ADCControl_Photo -> TaosPhoto.StdControl; + WeatherBoardM.LightChannel0 -> TaosPhoto.ADC[0]; + } Index: WeatherBoardM.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/sensordata/WeatherBoardM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WeatherBoardM.nc 22 Apr 2003 18:36:37 -0000 1.2 --- WeatherBoardM.nc 23 May 2003 00:57:14 -0000 1.3 *************** *** 64,69 **** interface StdControl as ADCControl_Humidity; interface ADC as Humidity; ! interface ADC as Temperature_Humidity; ! } } --- 64,72 ---- interface StdControl as ADCControl_Humidity; interface ADC as Humidity; ! ! //Photo Sensor ! interface StdControl as ADCControl_Photo; ! interface ADC as LightChannel0; ! } } *************** *** 80,84 **** call Leds.init(); call ADCControl_Humidity.init(); ! msg=&msg_buf; return SUCCESS; --- 83,87 ---- call Leds.init(); call ADCControl_Humidity.init(); ! msg=&msg_buf; return SUCCESS; *************** *** 93,110 **** command result_t StdControl.stop() { call ADCControl_Humidity.stop(); call Timer1.stop(); return SUCCESS; } - - /** - * When the clock fired, The sensor begin to sample. - * - * @author: Max - * @param: void - * @return: always return success - */ event result_t Timer1.fired() { call Humidity.getData(); --- 96,107 ---- command result_t StdControl.stop() { + call ADCControl_Photo.stop(); call ADCControl_Humidity.stop(); call Timer1.stop(); return SUCCESS; } + event result_t Timer1.fired() { call Humidity.getData(); *************** *** 112,123 **** return SUCCESS; } - - /** - * Humidity sensor have data ready - * - * @author: Max - * @param: void - * @return: always return success - */ event result_t Humidity.dataReady(uint16_t data) --- 109,112 ---- *************** *** 125,144 **** SensorMsg * sdata = (SensorMsg *)(msg_buf.data); sdata->HumidityData = data; ! call Temperature_Humidity.getData(); return SUCCESS; } ! event result_t Temperature_Humidity.dataReady(uint16_t data) { ! SensorMsg * sdata = (SensorMsg *)(msg_buf.data); ! sdata->TempData = data; ! sdata->MoteID= TOS_LOCAL_ADDRESS; ! call SendMsg.send(TOS_BCAST_ADDR, 6, msg); call Leds.yellowToggle(); - return SUCCESS; ! } ! event result_t SendMsg.sendDone(TOS_MsgPtr sent_msgptr, result_t success){ call Leds.redOff(); --- 114,136 ---- SensorMsg * sdata = (SensorMsg *)(msg_buf.data); sdata->HumidityData = data; ! call Leds.redToggle(); ! call ADCControl_Photo.init(); ! call ADCControl_Photo.start(); ! call LightChannel0.getData(); return SUCCESS; } ! event result_t LightChannel0.dataReady(uint16_t data) { ! char newdata = (char)(data & 0x0FF); ! msg->data[14] = newdata; ! call Leds.yellowToggle(); return SUCCESS; ! } ! ! ! event result_t SendMsg.sendDone(TOS_MsgPtr sent_msgptr, result_t success){ call Leds.redOff(); |
From: <che...@us...> - 2003-05-23 00:57:17
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1:/tmp/cvs-serv14580/project/java/src/org/firebug Modified Files: DBLogger.java SensorMsg.java SensorPacket.java Log Message: sensor msg now parsed collectly into the DB Index: DBLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/DBLogger.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** DBLogger.java 22 May 2003 03:06:25 -0000 1.14 --- DBLogger.java 23 May 2003 00:57:14 -0000 1.15 *************** *** 6,9 **** --- 6,10 ---- import java.sql.*; import java.util.Random; + import net.tinyos.message.*; *************** *** 32,68 **** int baseID=packet[10]; - //int id=TestDBLogger.getRandomID(baseID); return baseID; //id; } - private float getTemp (byte [] packet) { - - //float temp = (float)(72.0 + (3*rand.nextGaussian())); - //return temp; - float basetemp=(float)((long)packet[12]*256+(long)packet[11]); - //float temp=TestDBLogger.getRandomTemp(basetemp); - return basetemp; //temp; - } - - - private float getRelHum (byte [] packet) { - - //float rel_hum = packet[0]; - //return rel_hum; - - float baserelhum=packet[14]*256+packet[13]; - //float rel_hum=TestDBLogger.getRandomRelHum(baserelhum); - return 0 ; //rel_hum; - } - - private float getBaroPres (byte [] packet) { - - //float baro_pres = packet[1]; - //return baro_pres; - - float basebaropres=packet[16]*256+packet[15]; - //float baro_pres=TestDBLogger.getRandomBaroPres(basebaropres); - return 0; //baro_pres; - } private int get_packet_type(byte [] packet) { --- 33,39 ---- *************** *** 89,92 **** --- 60,65 ---- // message. + SensorMsg msg = new SensorMsg(packet,10,24); + Connection conn = dbh.getConnection(); *************** *** 98,105 **** int time = (int)System.currentTimeMillis(); ! float temp = getTemp(packet); int mote_id = getMoteID(packet); ! float rel_hum = getRelHum(packet); ! float baro_pres = getBaroPres(packet); if (get_packet_type(packet) != 1){ --- 71,85 ---- int time = (int)System.currentTimeMillis(); ! int mote_id = getMoteID(packet); ! int mote_id_test = msg.get_MoteID(); ! ! if (mote_id != mote_id_test){ ! System.out.println(mote_id+ " "+ mote_id_test + "\n"); ! } ! ! float temp = msg.get_temp(); ! float rel_hum = msg.get_rel_hum(); ! float baro_pres = msg.get_baro_pres(); if (get_packet_type(packet) != 1){ Index: SensorMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/SensorMsg.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SensorMsg.java 22 May 2003 23:00:03 -0000 1.2 --- SensorMsg.java 23 May 2003 00:57:14 -0000 1.3 *************** *** 7,10 **** --- 7,11 ---- package org.firebug; + public class SensorMsg extends net.tinyos.message.Message { *************** *** 82,93 **** * message type name and the non-indexed field values. */ public String toString() { String s = "Message <SensorMsg> \n"; s += " [MoteID=0x"+Long.toHexString(get_MoteID())+"]\n"; ! s += " [temp=0x"+Long.toHexString(get_temp())+"]\n"; ! s += " [rel_hum=0x"+Long.toHexString(get_rel_hum())+"]\n"; ! s += " [baro_pres=0x"+Long.toHexString(get_baro_pres())+"]\n"; return s; } // Message-type-specific access methods appear below. --- 83,96 ---- * message type name and the non-indexed field values. */ + /* public String toString() { String s = "Message <SensorMsg> \n"; s += " [MoteID=0x"+Long.toHexString(get_MoteID())+"]\n"; ! s += " [temp=0x" + Float.intBitsToFloat(get_temp()) + "]\n"; ! s += " [rel_hum=0x"+Float.toHexString(get_rel_hum())+"]\n"; ! s += " [baro_pres=0x"+Float.toHexString(get_baro_pres())+"]\n"; return s; } + */ // Message-type-specific access methods appear below. Index: SensorPacket.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/SensorPacket.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SensorPacket.java 22 May 2003 03:06:25 -0000 1.6 --- SensorPacket.java 23 May 2003 00:57:14 -0000 1.7 *************** *** 87,93 **** s += " [MoteID="+Long.toString(packet[10])+ "]\n"; //Humidity ! s += " [Humidity Data="+Long.toString(packet[12]*256)+Long.toString(packet[11])+"]"; //Temperature ! s += " [TempData="+Long.toString(packet[14]*256)+ Long.toString(packet[13])+"]"; } return s; --- 87,94 ---- s += " [MoteID="+Long.toString(packet[10])+ "]\n"; //Humidity ! //s += " [Humidity Data="+Long.toString(packet[12]*256)+Long.toString(packet[11])+"]"; //Temperature ! //s += " [TempData="+Long.toString(packet[14]*256)+ Long.toString(packet[13])+"]"; ! s += " [TempData="+Long.toString(packet[14])+ " " + Long.toString(packet[13])+"]"; } return s; |
From: <che...@us...> - 2003-05-23 00:57:17
|
Update of /cvsroot/firebug/firebug/project/java In directory sc8-pr-cvs1:/tmp/cvs-serv14580/project/java Modified Files: build.xml mhrun.sh Log Message: sensor msg now parsed collectly into the DB Index: build.xml =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/build.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** build.xml 14 May 2003 01:25:11 -0000 1.7 --- build.xml 23 May 2003 00:57:14 -0000 1.8 *************** *** 24,27 **** --- 24,28 ---- <property name="servletlib" value="./jar/jsdk22.jar"/> <property name="dblib" value="./jar/mm.mysql-2.0.4-bin.jar"/> + <property name="messagepath" value="c:\\tinyos-1.x\\tools\\java"/> Index: mhrun.sh =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/mhrun.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mhrun.sh 15 May 2003 23:10:45 -0000 1.4 --- mhrun.sh 23 May 2003 00:57:14 -0000 1.5 *************** *** 13,18 **** export COMMJAR=$JAVA_HOME\\lib\\comm.jar export MYSQLJAR=.\\jar\\mm.mysql-2.0.4-bin.jar #java -cp ".\\dist\\firebug.jar;$JAVA_HOME\\lib\\comm.jar" \ ! java -cp ".\\dist\\firebug.jar;$COMMJAR;$MYSQLJAR" \ org.firebug.ListenFB -e COM1 --- 13,19 ---- export COMMJAR=$JAVA_HOME\\lib\\comm.jar export MYSQLJAR=.\\jar\\mm.mysql-2.0.4-bin.jar + export MSGPATH=C:\\tinyos-1.x\\tools\\java #java -cp ".\\dist\\firebug.jar;$JAVA_HOME\\lib\\comm.jar" \ ! java -cp ".\\dist\\firebug.jar;$COMMJAR;$MYSQLJAR;$MSGPATH" \ org.firebug.ListenFB -e COM1 |
From: <che...@us...> - 2003-05-22 23:00:08
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1:/tmp/cvs-serv11372 Modified Files: SensorMsg.java Log Message: Updated SensorMsg to use floats instead of shorts. Index: SensorMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/SensorMsg.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SensorMsg.java 22 Apr 2003 20:41:26 -0000 1.1 --- SensorMsg.java 22 May 2003 23:00:03 -0000 1.2 *************** *** 10,19 **** /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 6; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 128; ! /** Create a new SensorMsg of size 6. */ public SensorMsg() { super(DEFAULT_MESSAGE_SIZE); --- 10,19 ---- /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 14; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 128; ! /** Create a new SensorMsg of size 14. */ public SensorMsg() { super(DEFAULT_MESSAGE_SIZE); *************** *** 85,90 **** String s = "Message <SensorMsg> \n"; s += " [MoteID=0x"+Long.toHexString(get_MoteID())+"]\n"; ! s += " [HumidityData=0x"+Long.toHexString(get_HumidityData())+"]\n"; ! s += " [TempData=0x"+Long.toHexString(get_TempData())+"]\n"; return s; } --- 85,91 ---- String s = "Message <SensorMsg> \n"; s += " [MoteID=0x"+Long.toHexString(get_MoteID())+"]\n"; ! s += " [temp=0x"+Long.toHexString(get_temp())+"]\n"; ! s += " [rel_hum=0x"+Long.toHexString(get_rel_hum())+"]\n"; ! s += " [baro_pres=0x"+Long.toHexString(get_baro_pres())+"]\n"; return s; } *************** *** 94,98 **** ///////////////////////////////////////////////////////// // Accessor methods for field: MoteID ! // Field type: int, unsigned // Offset (bits): 0 // Size (bits): 16 --- 95,99 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: MoteID ! // Field type: int // Offset (bits): 0 // Size (bits): 16 *************** *** 100,107 **** /** ! * Return whether the field 'MoteID' is signed (false). */ public static boolean isSigned_MoteID() { ! return false; } --- 101,108 ---- /** ! * Return whether the field 'MoteID' is signed (true). */ public static boolean isSigned_MoteID() { ! return true; } *************** *** 156,282 **** ///////////////////////////////////////////////////////// ! // Accessor methods for field: HumidityData ! // Field type: int, unsigned // Offset (bits): 16 ! // Size (bits): 16 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'HumidityData' is signed (false). */ ! public static boolean isSigned_HumidityData() { ! return false; } /** ! * Return whether the field 'HumidityData' is an array (false). */ ! public static boolean isArray_HumidityData() { return false; } /** ! * Return the offset (in bytes) of the field 'HumidityData' */ ! public static int offset_HumidityData() { return (16 / 8); } /** ! * Return the offset (in bits) of the field 'HumidityData' */ ! public static int offsetBits_HumidityData() { return 16; } /** ! * Return the value (as a int) of the field 'HumidityData' */ ! public int get_HumidityData() { ! return (int)getUIntElement(offsetBits_HumidityData(), 16); } /** ! * Set the value of the field 'HumidityData' */ ! public void set_HumidityData(int value) { ! setUIntElement(offsetBits_HumidityData(), 16, value); } /** ! * Return the size, in bytes, of the field 'HumidityData' */ ! public static int size_HumidityData() { ! return (16 / 8); } /** ! * Return the size, in bits, of the field 'HumidityData' */ ! public static int sizeBits_HumidityData() { ! return 16; } ///////////////////////////////////////////////////////// ! // Accessor methods for field: TempData ! // Field type: int, unsigned ! // Offset (bits): 32 ! // Size (bits): 16 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'TempData' is signed (false). */ ! public static boolean isSigned_TempData() { ! return false; } /** ! * Return whether the field 'TempData' is an array (false). */ ! public static boolean isArray_TempData() { return false; } /** ! * Return the offset (in bytes) of the field 'TempData' */ ! public static int offset_TempData() { return (32 / 8); } /** ! * Return the offset (in bits) of the field 'TempData' */ ! public static int offsetBits_TempData() { return 32; } /** ! * Return the value (as a int) of the field 'TempData' */ ! public int get_TempData() { ! return (int)getUIntElement(offsetBits_TempData(), 16); } /** ! * Set the value of the field 'TempData' */ ! public void set_TempData(int value) { ! setUIntElement(offsetBits_TempData(), 16, value); } /** ! * Return the size, in bytes, of the field 'TempData' */ ! public static int size_TempData() { ! return (16 / 8); } /** ! * Return the size, in bits, of the field 'TempData' */ ! public static int sizeBits_TempData() { ! return 16; } --- 157,346 ---- ///////////////////////////////////////////////////////// ! // Accessor methods for field: temp ! // Field type: float // Offset (bits): 16 ! // Size (bits): 32 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'temp' is signed (true). */ ! public static boolean isSigned_temp() { ! return true; } /** ! * Return whether the field 'temp' is an array (false). */ ! public static boolean isArray_temp() { return false; } /** ! * Return the offset (in bytes) of the field 'temp' */ ! public static int offset_temp() { return (16 / 8); } /** ! * Return the offset (in bits) of the field 'temp' */ ! public static int offsetBits_temp() { return 16; } /** ! * Return the value (as a float) of the field 'temp' */ ! public float get_temp() { ! return (float)getFloatElement(offsetBits_temp(), 32); } /** ! * Set the value of the field 'temp' */ ! public void set_temp(float value) { ! setFloatElement(offsetBits_temp(), 32, value); } /** ! * Return the size, in bytes, of the field 'temp' */ ! public static int size_temp() { ! return (32 / 8); } /** ! * Return the size, in bits, of the field 'temp' */ ! public static int sizeBits_temp() { ! return 32; } ///////////////////////////////////////////////////////// ! // Accessor methods for field: rel_hum ! // Field type: float ! // Offset (bits): 48 ! // Size (bits): 32 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'rel_hum' is signed (true). */ ! public static boolean isSigned_rel_hum() { ! return true; } /** ! * Return whether the field 'rel_hum' is an array (false). */ ! public static boolean isArray_rel_hum() { return false; } /** ! * Return the offset (in bytes) of the field 'rel_hum' */ ! public static int offset_rel_hum() { ! return (48 / 8); ! } ! ! /** ! * Return the offset (in bits) of the field 'rel_hum' ! */ ! public static int offsetBits_rel_hum() { ! return 48; ! } ! ! /** ! * Return the value (as a float) of the field 'rel_hum' ! */ ! public float get_rel_hum() { ! return (float)getFloatElement(offsetBits_rel_hum(), 32); ! } ! ! /** ! * Set the value of the field 'rel_hum' ! */ ! public void set_rel_hum(float value) { ! setFloatElement(offsetBits_rel_hum(), 32, value); ! } ! ! /** ! * Return the size, in bytes, of the field 'rel_hum' ! */ ! public static int size_rel_hum() { return (32 / 8); } /** ! * Return the size, in bits, of the field 'rel_hum' */ ! public static int sizeBits_rel_hum() { return 32; } + ///////////////////////////////////////////////////////// + // Accessor methods for field: baro_pres + // Field type: float + // Offset (bits): 80 + // Size (bits): 32 + ///////////////////////////////////////////////////////// + /** ! * Return whether the field 'baro_pres' is signed (true). */ ! public static boolean isSigned_baro_pres() { ! return true; } /** ! * Return whether the field 'baro_pres' is an array (false). */ ! public static boolean isArray_baro_pres() { ! return false; } /** ! * Return the offset (in bytes) of the field 'baro_pres' */ ! public static int offset_baro_pres() { ! return (80 / 8); } /** ! * Return the offset (in bits) of the field 'baro_pres' */ ! public static int offsetBits_baro_pres() { ! return 80; ! } ! ! /** ! * Return the value (as a float) of the field 'baro_pres' ! */ ! public float get_baro_pres() { ! return (float)getFloatElement(offsetBits_baro_pres(), 32); ! } ! ! /** ! * Set the value of the field 'baro_pres' ! */ ! public void set_baro_pres(float value) { ! setFloatElement(offsetBits_baro_pres(), 32, value); ! } ! ! /** ! * Return the size, in bytes, of the field 'baro_pres' ! */ ! public static int size_baro_pres() { ! return (32 / 8); ! } ! ! /** ! * Return the size, in bits, of the field 'baro_pres' ! */ ! public static int sizeBits_baro_pres() { ! return 32; } |
From: <do...@us...> - 2003-05-22 22:39:55
|
Update of /cvsroot/firebug/firebug/project/src/multihop In directory sc8-pr-cvs1:/tmp/cvs-serv3965 Modified Files: BaseStationM.nc CollectDataMFB.nc Log Message: Added Gaussian density generation to multihop for simulation. Index: BaseStationM.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/BaseStationM.nc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** BaseStationM.nc 19 May 2003 20:03:30 -0000 1.6 --- BaseStationM.nc 22 May 2003 22:39:51 -0000 1.7 *************** *** 92,120 **** * @return: void */ - /* Some temporary code for generating gaussian density. - * This can be moved out of here later. However, it - * does compile. - * @url http://www.taygeta.com/random/gaussian.html - */ event void MultiHopSend.sendDone(TOS_MsgPtr msg, uint8_t success) { - #if 0 - int randnum; - int max = RAND_MAX; - float x1,x2,w,y1,y2; - - do { - x1 = (2*(rand()/max)) - 1; - x2 = (2*(rand()/max)) - 1; - w = x1*x1 + x2*x2; - } while (w >= 1.0); - - w = sqrt( (-2.0*log(w))/w); - y1 = x1*w; - y2 = x2*w; - #endif - sending = 0; - } --- 92,98 ---- Index: CollectDataMFB.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/CollectDataMFB.nc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CollectDataMFB.nc 21 May 2003 22:39:15 -0000 1.3 --- CollectDataMFB.nc 22 May 2003 22:39:51 -0000 1.4 *************** *** 44,48 **** //uint8_t cnt; //uint8_t sampledata; ! uint16_t temp; //uint16_t rel_hum; //uint16_t baro; --- 44,50 ---- //uint8_t cnt; //uint8_t sampledata; ! ! //uint16_t temp; ! float temp; //uint16_t rel_hum; //uint16_t baro; *************** *** 73,76 **** --- 75,104 ---- + /* Some temporary code for generating gaussian density. + * This can be moved out of here later. However, it + * does compile. + * @url http://www.taygeta.com/random/gaussian.html + */ + float get_temp() { + + //#if 0 + int randnum; + int max = RAND_MAX; + float x1,x2,w,y1,y2; + + do { + x1 = (2*(rand()/max)) - 1; + x2 = (2*(rand()/max)) - 1; + w = x1*x1 + x2*x2; + } while (w >= 1.0); + + w = sqrt( (-2.0*log(w))/w); + y1 = x1*w; + y2 = x2*w; + //#endif + + return x1; + } + /** *************** *** 98,105 **** //df->cnt = counter++; //df->sampledata=TOS_LOCAL_ADDRESS; ! //more sensor data put here //.... ! df->temp=0x04CE; ! sending = 1; result = call MultiHopSend.send(&msgToSend, sizeof(struct DataFormat_t)); --- 126,133 ---- //df->cnt = counter++; //df->sampledata=TOS_LOCAL_ADDRESS; ! //put more sensor data here //.... ! //df->temp=0x04CE; ! df->temp = get_temp(); sending = 1; result = call MultiHopSend.send(&msgToSend, sizeof(struct DataFormat_t)); |
Update of /cvsroot/firebug/firebug/project/src/gps In directory sc8-pr-cvs1:/tmp/cvs-serv1355a Removed Files: Packet.nc ProcessCmd.nc SimpleCmd.nc SimpleCmdM.nc gps_packet.nc gps_packetM.nc gps_uart.nc gps_uartM.nc Log Message: remove old gps code --- Packet.nc DELETED --- --- ProcessCmd.nc DELETED --- --- SimpleCmd.nc DELETED --- --- SimpleCmdM.nc DELETED --- --- gps_packet.nc DELETED --- --- gps_packetM.nc DELETED --- --- gps_uart.nc DELETED --- --- gps_uartM.nc DELETED --- |
From: <cs...@us...> - 2003-05-22 22:29:50
|
Update of /cvsroot/firebug/firebug/project/src/gps In directory sc8-pr-cvs1:/tmp/cvs-serv32544 Modified Files: gps.nc gpsM.nc Added Files: LogMsg.class LogMsg.java gpsBcast.class gpsBcast.java gpsCmd.nc gpsCmdM.nc gpsCmdMsg.class gpsCmdMsg.h gpsCmdMsg.java gpsRetrieve.nc Removed Files: Makefile Log Message: gps only runs on mica2 --- NEW FILE: LogMsg.class --- (This appears to be a binary file; contents omitted.) --- NEW FILE: LogMsg.java --- /** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'LogMsg' * message type. */ package net.tinyos.gps_mig; public class LogMsg extends net.tinyos.message.Message { /** The default size of this message type in bytes. */ public static final int DEFAULT_MESSAGE_SIZE = 18; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 9; /** Create a new LogMsg of size 18. */ public LogMsg() { super(DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** Create a new LogMsg of the given data_length. */ public LogMsg(int data_length) { super(data_length); amTypeSet(AM_TYPE); } /** * Create a new LogMsg with the given data_length * and base offset. */ public LogMsg(int data_length, int base_offset) { super(data_length, base_offset); amTypeSet(AM_TYPE); } /** * Create a new LogMsg using the given byte array * as backing store. */ public LogMsg(byte[] data) { super(data); amTypeSet(AM_TYPE); } /** * Create a new LogMsg using the given byte array * as backing store, with the given base offset. */ public LogMsg(byte[] data, int base_offset) { super(data, base_offset); amTypeSet(AM_TYPE); } /** * Create a new LogMsg using the given byte array * as backing store, with the given base offset and data length. */ public LogMsg(byte[] data, int base_offset, int data_length) { super(data, base_offset, data_length); amTypeSet(AM_TYPE); } /** * Create a new LogMsg embedded in the given message * at the given base offset. */ public LogMsg(net.tinyos.message.Message msg, int base_offset) { super(msg, base_offset, DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** * Create a new LogMsg embedded in the given message * at the given base offset and length. */ public LogMsg(net.tinyos.message.Message msg, int base_offset, int data_length) { super(msg, base_offset, data_length); amTypeSet(AM_TYPE); } /** /* Return a String representation of this message. Includes the * message type name and the non-indexed field values. */ public String toString() { String s = "Message <LogMsg> \n"; try { s += " [sourceaddr=0x"+Long.toHexString(get_sourceaddr())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [log="; for (int i = 0; i < 16; i++) { s += "0x"+Long.toHexString(getElement_log(i) & 0xff)+" "; } s += "]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } // Message-type-specific access methods appear below. ///////////////////////////////////////////////////////// // Accessor methods for field: sourceaddr // Field type: int, unsigned // Offset (bits): 0 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'sourceaddr' is signed (false). */ public static boolean isSigned_sourceaddr() { return false; } /** * Return whether the field 'sourceaddr' is an array (false). */ public static boolean isArray_sourceaddr() { return false; } /** * Return the offset (in bytes) of the field 'sourceaddr' */ public static int offset_sourceaddr() { return (0 / 8); } /** * Return the offset (in bits) of the field 'sourceaddr' */ public static int offsetBits_sourceaddr() { return 0; } /** * Return the value (as a int) of the field 'sourceaddr' */ public int get_sourceaddr() { return (int)getUIntElement(offsetBits_sourceaddr(), 16); } /** * Set the value of the field 'sourceaddr' */ public void set_sourceaddr(int value) { setUIntElement(offsetBits_sourceaddr(), 16, value); } /** * Return the size, in bytes, of the field 'sourceaddr' */ public static int size_sourceaddr() { return (16 / 8); } /** * Return the size, in bits, of the field 'sourceaddr' */ public static int sizeBits_sourceaddr() { return 16; } ///////////////////////////////////////////////////////// // Accessor methods for field: log // Field type: short[], unsigned // Offset (bits): 16 // Size of each element (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'log' is signed (false). */ public static boolean isSigned_log() { return false; } /** * Return whether the field 'log' is an array (true). */ public static boolean isArray_log() { return true; } /** * Return the offset (in bytes) of the field 'log' */ public static int offset_log(int index1) { int offset = 16; if (index1 < 0 || index1 >= 16) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return (offset / 8); } /** * Return the offset (in bits) of the field 'log' */ public static int offsetBits_log(int index1) { int offset = 16; if (index1 < 0 || index1 >= 16) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return offset; } /** * Return the entire array 'log' as a short[] */ public short[] get_log() { short[] tmp = new short[16]; for (int index0 = 0; index0 < numElements_log(0); index0++) { tmp[index0] = getElement_log(index0); } return tmp; } /** * Set the contents of the array 'log' from the given short[] */ public void set_log(short[] value) { for (int index0 = 0; index0 < value.length; index0++) { setElement_log(index0, value[index0]); } } /** * Return an element (as a short) of the array 'log' */ public short getElement_log(int index1) { return (short)getUIntElement(offsetBits_log(index1), 8); } /** * Set an element of the array 'log' */ public void setElement_log(int index1, short value) { setUIntElement(offsetBits_log(index1), 8, value); } /** * Return the total size, in bytes, of the array 'log' */ public static int totalSize_log() { return (128 / 8); } /** * Return the total size, in bits, of the array 'log' */ public static int totalSizeBits_log() { return 128; } /** * Return the size, in bytes, of each element of the array 'log' */ public static int elementSize_log() { return (8 / 8); } /** * Return the size, in bits, of each element of the array 'log' */ public static int elementSizeBits_log() { return 8; } /** * Return the number of dimensions in the array 'log' */ public static int numDimensions_log() { return 1; } /** * Return the number of elements in the array 'log' */ public static int numElements_log() { return 16; } /** * Return the number of elements in the array 'log' * for the given dimension. */ public static int numElements_log(int dimension) { int array_dims[] = { 16, }; if (dimension < 0 || dimension >= 1) throw new ArrayIndexOutOfBoundsException(); if (array_dims[dimension] == 0) throw new IllegalArgumentException("Array dimension "+dimension+" has unknown size"); return array_dims[dimension]; } /** * Fill in the array 'log' with a String */ public void setString_log(String s) { int len = s.length(); int i; for (i = 0; i < len; i++) { setElement_log(i, (short)s.charAt(i)); } setElement_log(i, (short)0); //null terminate } /** * Read the array 'log' as a String */ public String getString_log() { char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,16)]; int i; for (i = 0; i < carr.length; i++) { if ((char)getElement_log(i) == (char)0) break; carr[i] = (char)getElement_log(i); } return new String(carr,0,i); } } --- NEW FILE: gpsBcast.class --- (This appears to be a binary file; contents omitted.) --- NEW FILE: gpsBcast.java --- package net.tinyos.gps_mig; import net.tinyos.util.*; import java.io.*; import java.util.Properties; import net.tinyos.message.*; public class gpsBcast implements MessageListener { static Properties p = new Properties(); public static final byte UTC = 1; public static final byte LONGITUDE = 2; public static final byte NS_INDICATOR = 3; public static final byte LATITUDE = 4; public static final byte EW_INDICATOR = 5; public boolean read_log_done = false; public static final short TOS_BCAST_ADDR = (short) 0xffff; public static void usage() { System.err.println("Usage: java net.tinyos.tools.gpsBcast"+ " <group_id> <command> [arguments]"); System.err.println("\twhere <command> and [arguments] can be one of the following:"); System.err.println("\t\tUTC [dest_address]"); System.err.println("\t\tLONGITUDE [dest_address]"); System.err.println("\t\tNS_INDICATOR [dest_address]"); System.err.println("\t\tLATITUDE [dest_address]"); System.err.println("\t\tEW_INDICATOR [dest_address]"); } public static byte restoreSequenceNo() { try { FileInputStream fis = new FileInputStream("bcast.properties"); p.load(fis); byte i = (byte)Integer.parseInt(p.getProperty("sequenceNo", "1")); fis.close(); return i; } catch (IOException e) { p.setProperty("sequenceNo", "1"); return 1; } } public static void saveSequenceNo(int i) { try { FileOutputStream fos = new FileOutputStream("bcast.properties"); p.setProperty("sequenceNo", Integer.toString(i)); p.store(fos, "#Properties for gpsBcast\n"); } catch (IOException e) { System.err.println("Exception while saving sequence number" + e); e.printStackTrace(); } } public static void main(String[] argv) throws IOException{ String cmd; byte group_id = 0; byte sequenceNo = 0; if (argv.length < 2) { usage(); System.exit(-1); } try { group_id = (byte)(Integer.parseInt(argv[0]) & 0xff); } catch (NumberFormatException nfe) { usage(); System.exit(-1); } cmd = argv[1]; gpsCmdMsg packet = new gpsCmdMsg(); sequenceNo = restoreSequenceNo(); packet.set_seqno(sequenceNo); packet.set_hop_count((short)0); packet.set_source(0); if (cmd.equals("UTC")) { packet.set_action(UTC); short address = (short)Integer.parseInt(argv[2]); packet.set_args_rl_args_destaddr(address); } else if (cmd.equals("LONGITUDE")) { packet.set_action(LONGITUDE); short address = (short)Integer.parseInt(argv[2]); packet.set_args_rl_args_destaddr(address); } else if (cmd.equals("NS_INDICATOR")) { packet.set_action(NS_INDICATOR); short address = (short)Integer.parseInt(argv[2]); packet.set_args_rl_args_destaddr(address); } else if (cmd.equals("LATITUDE")) { packet.set_action(LATITUDE); short address = (short)Integer.parseInt(argv[2]); packet.set_args_rl_args_destaddr(address); } else if (cmd.equals("EW_INDICATOR")) { packet.set_action(EW_INDICATOR); short address = (short)Integer.parseInt(argv[2]); packet.set_args_rl_args_destaddr(address); } else { usage(); System.exit(-1); } try { System.err.print("Sending payload: "); for (int i = 0; i < packet.dataLength(); i++) { System.err.print(Integer.toHexString(packet.dataGet()[i] & 0xff)+ " "); } System.err.println(); MoteIF mote = new MoteIF("127.0.0.1", 9000, group_id); gpsBcast bc = null; bc = new gpsBcast(); mote.registerListener(new LogMsg(), bc); mote.start(); mote.send(TOS_BCAST_ADDR, packet); synchronized (bc) { if (bc.read_log_done == false) { System.err.println("Waiting for response to read_log..."); bc.wait(10000); } if (bc.read_log_done == false) { System.err.println("Warning: Timed out waiting for response to read_log command!"); } } saveSequenceNo(sequenceNo+1); System.exit(0); } catch(Exception e) { e.printStackTrace(); } } public void messageReceived(int dest_addr, Message m) { LogMsg lm = (LogMsg) m; System.err.println("Received log message: "+lm); System.err.print("Log values: "); for (int i = 0; i < lm.numElements_log(); i++) { short val = lm.getElement_log(i); System.err.print(Integer.toHexString((int)val)+" "); } System.err.println(""); synchronized (this) { read_log_done = true; this.notifyAll(); } } } --- NEW FILE: gpsCmd.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /* tab:4 * Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * */ /* * This file is part of the FireBug project. * * FireBug is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any * later version. * * FireBug is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * You should have received a copy of the GNU Lesser General Public License * along with Geotechnica; see the file COPYING. If not, write to the Free * Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ includes gpsCmdMsg; configuration gpsCmd { provides interface gpsRetrieve; } implementation { components Main, gpsCmdM, gps, Logger, GenericComm as Comm, PotC, LedsC; Main.StdControl -> gpsCmdM; SimpleCmdM.Leds -> LedsC; gpsRetrive = gpsCmdM.gpsRetrieve; gpsCmdM.CommControl -> Comm; gpsCmdM.ReceiveCmdMsg -> Comm.ReceiveMsg[AM_GPSCMDMSG]; gpsCmdM.SendLogMsg -> Comm.SendMsg[AM_LOGMSG]; gpsCmdM.LoggerRead -> Logger; gpsCmdM.Pot -> PotC; } --- NEW FILE: gpsCmdM.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /* tab:4 * Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * */ /* * This file is part of the FireBug project. * * FireBug is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any * later version. * * FireBug is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * You should have received a copy of the GNU Lesser General Public License * along with Geotechnica; see the file COPYING. If not, write to the Free * Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ includes gpsCmdMsg; module gpsCmdM { provides { interface StdControl; interface gpsRetrieve; } uses { interface Leds; interface Pot; interface ReceiveMsg as ReceiveCmdMsg; interface StdControl as CommControl; interface LoggerRead; interface SendMsg as SendLogMsg; } } implementation { // declare module static variables here TOS_MsgPtr cur_msg; // The current command message TOS_Msg log_msg; // The current log message bool send_pending; // TRUE if a message send is pending bool eeprom_read_pending; // TRUE if an EEPROM read is pending TOS_Msg buf; // Free buffer for message reception task void cmdInterpret() { struct gpsCmdMsg *cmd = (struct gpsCmdMsg *)cur_msg->data; result_t status = SUCCESS; // do local packet modifications: update the hop count and packet source cmd->hop_count++; cmd->source = TOS_LOCAL_ADDRESS; // Execute the command if ((cmd->args.rl_args.destaddr == TOS_LOCAL_ADDRESS) && (eeprom_read_pending == FALSE)) { if (call LoggerRead.read(24+(cmd->action),((struct LogMsg *)log_msg.data)->log)) { eeprom_read_pending = TRUE; } } signal ProcessCmd.done(cur_msg, status); } command result_t StdControl.init() { cur_msg = &buf; send_pending = FALSE; eeprom_read_pending = FALSE; return rcombine(call CommControl.init(), call Leds.init()); } command result_t StdControl.start(){ return SUCCESS; } command result_t StdControl.stop(){ return SUCCESS; } event result_t LoggerRead.readDone(uint8_t * packet, result_t success) { struct LogMsg *lm; if (success && eeprom_read_pending && !send_pending) { lm = (struct LogMsg *)(log_msg.data); lm->sourceaddr = TOS_LOCAL_ADDRESS; if (call SendLogMsg.send(TOS_BCAST_ADDR, sizeof(struct LogMsg), &log_msg)) { call Leds.redOn(); send_pending = TRUE; } } eeprom_read_pending = FALSE; call Leds.yellowOff(); return SUCCESS; } command result_t gpsRetrieve.execute(TOS_MsgPtr pmsg) { cur_msg = pmsg; post cmdInterpret(); return SUCCESS; } event TOS_MsgPtr ReceiveCmdMsg.receive(TOS_MsgPtr pmsg){ result_t retval; TOS_MsgPtr ret = cur_msg; call Leds.greenToggle(); retval = call gpsRetrieve.execute(pmsg); if (retval==SUCCESS) { return ret; } else { return pmsg; } } default event result_t gpsRetrieve.done(TOS_MsgPtr pmsg, result_t status) { return status; } event result_t SendLogMsg.sendDone(TOS_MsgPtr pmsg, result_t status) { call Leds.redOff(); send_pending = FALSE; return status; } } // end of implementation --- NEW FILE: gpsCmdMsg.class --- (This appears to be a binary file; contents omitted.) --- NEW FILE: gpsCmdMsg.h --- enum { AM_GPSCMDMSG = 8, AM_LOGMSG=9 }; enum { UTC = 1, LONGITUDE = 2, NS_INDICATOR = 3, LATITUDE = 4, EW_INDICATOR = 5, }; typedef struct { int nsamples; uint32_t interval; } start_sense_args; typedef struct { uint16_t destaddr; } read_log_args; typedef struct gpsCmdMsg { int8_t seqno; int8_t action; uint16_t source; uint8_t hop_count; union { start_sense_args ss_args; read_log_args rl_args; uint8_t untyped_args[0]; } args; } gpsCmdMsg; // Log message structure typedef struct LogMsg { uint16_t sourceaddr; uint8_t log[16]; } LogMsg; --- NEW FILE: gpsCmdMsg.java --- /** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'gpsCmdMsg' * message type. */ package net.tinyos.gps_mig; public class gpsCmdMsg extends net.tinyos.message.Message { /** The default size of this message type in bytes. */ public static final int DEFAULT_MESSAGE_SIZE = 11; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 8; /** Create a new gpsCmdMsg of size 11. */ public gpsCmdMsg() { super(DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** Create a new gpsCmdMsg of the given data_length. */ public gpsCmdMsg(int data_length) { super(data_length); amTypeSet(AM_TYPE); } /** * Create a new gpsCmdMsg with the given data_length * and base offset. */ public gpsCmdMsg(int data_length, int base_offset) { super(data_length, base_offset); amTypeSet(AM_TYPE); } /** * Create a new gpsCmdMsg using the given byte array * as backing store. */ public gpsCmdMsg(byte[] data) { super(data); amTypeSet(AM_TYPE); } /** * Create a new gpsCmdMsg using the given byte array * as backing store, with the given base offset. */ public gpsCmdMsg(byte[] data, int base_offset) { super(data, base_offset); amTypeSet(AM_TYPE); } /** * Create a new gpsCmdMsg using the given byte array * as backing store, with the given base offset and data length. */ public gpsCmdMsg(byte[] data, int base_offset, int data_length) { super(data, base_offset, data_length); amTypeSet(AM_TYPE); } /** * Create a new gpsCmdMsg embedded in the given message * at the given base offset. */ public gpsCmdMsg(net.tinyos.message.Message msg, int base_offset) { super(msg, base_offset, DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** * Create a new gpsCmdMsg embedded in the given message * at the given base offset and length. */ public gpsCmdMsg(net.tinyos.message.Message msg, int base_offset, int data_length) { super(msg, base_offset, data_length); amTypeSet(AM_TYPE); } /** /* Return a String representation of this message. Includes the * message type name and the non-indexed field values. */ public String toString() { String s = "Message <gpsCmdMsg> \n"; try { s += " [seqno=0x"+Long.toHexString(get_seqno())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [action=0x"+Long.toHexString(get_action())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [source=0x"+Long.toHexString(get_source())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [hop_count=0x"+Long.toHexString(get_hop_count())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [args.ss_args.nsamples=0x"+Long.toHexString(get_args_ss_args_nsamples())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [args.ss_args.interval=0x"+Long.toHexString(get_args_ss_args_interval())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [args.rl_args.destaddr=0x"+Long.toHexString(get_args_rl_args_destaddr())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } // Message-type-specific access methods appear below. ///////////////////////////////////////////////////////// // Accessor methods for field: seqno // Field type: byte // Offset (bits): 0 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'seqno' is signed (false). */ public static boolean isSigned_seqno() { return false; } /** * Return whether the field 'seqno' is an array (false). */ public static boolean isArray_seqno() { return false; } /** * Return the offset (in bytes) of the field 'seqno' */ public static int offset_seqno() { return (0 / 8); } /** * Return the offset (in bits) of the field 'seqno' */ public static int offsetBits_seqno() { return 0; } /** * Return the value (as a byte) of the field 'seqno' */ public byte get_seqno() { return (byte)getSIntElement(offsetBits_seqno(), 8); } /** * Set the value of the field 'seqno' */ public void set_seqno(byte value) { setSIntElement(offsetBits_seqno(), 8, value); } /** * Return the size, in bytes, of the field 'seqno' */ public static int size_seqno() { return (8 / 8); } /** * Return the size, in bits, of the field 'seqno' */ public static int sizeBits_seqno() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: action // Field type: byte // Offset (bits): 8 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'action' is signed (false). */ public static boolean isSigned_action() { return false; } /** * Return whether the field 'action' is an array (false). */ public static boolean isArray_action() { return false; } /** * Return the offset (in bytes) of the field 'action' */ public static int offset_action() { return (8 / 8); } /** * Return the offset (in bits) of the field 'action' */ public static int offsetBits_action() { return 8; } /** * Return the value (as a byte) of the field 'action' */ public byte get_action() { return (byte)getSIntElement(offsetBits_action(), 8); } /** * Set the value of the field 'action' */ public void set_action(byte value) { setSIntElement(offsetBits_action(), 8, value); } /** * Return the size, in bytes, of the field 'action' */ public static int size_action() { return (8 / 8); } /** * Return the size, in bits, of the field 'action' */ public static int sizeBits_action() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: source // Field type: int // Offset (bits): 16 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'source' is signed (false). */ public static boolean isSigned_source() { return false; } /** * Return whether the field 'source' is an array (false). */ public static boolean isArray_source() { return false; } /** * Return the offset (in bytes) of the field 'source' */ public static int offset_source() { return (16 / 8); } /** * Return the offset (in bits) of the field 'source' */ public static int offsetBits_source() { return 16; } /** * Return the value (as a int) of the field 'source' */ public int get_source() { return (int)getUIntElement(offsetBits_source(), 16); } /** * Set the value of the field 'source' */ public void set_source(int value) { setUIntElement(offsetBits_source(), 16, value); } /** * Return the size, in bytes, of the field 'source' */ public static int size_source() { return (16 / 8); } /** * Return the size, in bits, of the field 'source' */ public static int sizeBits_source() { return 16; } ///////////////////////////////////////////////////////// // Accessor methods for field: hop_count // Field type: short // Offset (bits): 32 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'hop_count' is signed (false). */ public static boolean isSigned_hop_count() { return false; } /** * Return whether the field 'hop_count' is an array (false). */ public static boolean isArray_hop_count() { return false; } /** * Return the offset (in bytes) of the field 'hop_count' */ public static int offset_hop_count() { return (32 / 8); } /** * Return the offset (in bits) of the field 'hop_count' */ public static int offsetBits_hop_count() { return 32; } /** * Return the value (as a short) of the field 'hop_count' */ public short get_hop_count() { return (short)getUIntElement(offsetBits_hop_count(), 8); } /** * Set the value of the field 'hop_count' */ public void set_hop_count(short value) { setUIntElement(offsetBits_hop_count(), 8, value); } /** * Return the size, in bytes, of the field 'hop_count' */ public static int size_hop_count() { return (8 / 8); } /** * Return the size, in bits, of the field 'hop_count' */ public static int sizeBits_hop_count() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: args.ss_args.nsamples // Field type: short // Offset (bits): 40 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'args.ss_args.nsamples' is signed (false). */ public static boolean isSigned_args_ss_args_nsamples() { return false; } /** * Return whether the field 'args.ss_args.nsamples' is an array (false). */ public static boolean isArray_args_ss_args_nsamples() { return false; } /** * Return the offset (in bytes) of the field 'args.ss_args.nsamples' */ public static int offset_args_ss_args_nsamples() { return (40 / 8); } /** * Return the offset (in bits) of the field 'args.ss_args.nsamples' */ public static int offsetBits_args_ss_args_nsamples() { return 40; } /** * Return the value (as a short) of the field 'args.ss_args.nsamples' */ public short get_args_ss_args_nsamples() { return (short)getSIntElement(offsetBits_args_ss_args_nsamples(), 16); } /** * Set the value of the field 'args.ss_args.nsamples' */ public void set_args_ss_args_nsamples(short value) { setSIntElement(offsetBits_args_ss_args_nsamples(), 16, value); } /** * Return the size, in bytes, of the field 'args.ss_args.nsamples' */ public static int size_args_ss_args_nsamples() { return (16 / 8); } /** * Return the size, in bits, of the field 'args.ss_args.nsamples' */ public static int sizeBits_args_ss_args_nsamples() { return 16; } ///////////////////////////////////////////////////////// // Accessor methods for field: args.ss_args.interval // Field type: long // Offset (bits): 56 // Size (bits): 32 ///////////////////////////////////////////////////////// /** * Return whether the field 'args.ss_args.interval' is signed (false). */ public static boolean isSigned_args_ss_args_interval() { return false; } /** * Return whether the field 'args.ss_args.interval' is an array (false). */ public static boolean isArray_args_ss_args_interval() { return false; } /** * Return the offset (in bytes) of the field 'args.ss_args.interval' */ public static int offset_args_ss_args_interval() { return (56 / 8); } /** * Return the offset (in bits) of the field 'args.ss_args.interval' */ public static int offsetBits_args_ss_args_interval() { return 56; } /** * Return the value (as a long) of the field 'args.ss_args.interval' */ public long get_args_ss_args_interval() { return (long)getUIntElement(offsetBits_args_ss_args_interval(), 32); } /** * Set the value of the field 'args.ss_args.interval' */ public void set_args_ss_args_interval(long value) { setUIntElement(offsetBits_args_ss_args_interval(), 32, value); } /** * Return the size, in bytes, of the field 'args.ss_args.interval' */ public static int size_args_ss_args_interval() { return (32 / 8); } /** * Return the size, in bits, of the field 'args.ss_args.interval' */ public static int sizeBits_args_ss_args_interval() { return 32; } ///////////////////////////////////////////////////////// // Accessor methods for field: args.rl_args.destaddr // Field type: int // Offset (bits): 40 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'args.rl_args.destaddr' is signed (false). */ public static boolean isSigned_args_rl_args_destaddr() { return false; } /** * Return whether the field 'args.rl_args.destaddr' is an array (false). */ public static boolean isArray_args_rl_args_destaddr() { return false; } /** * Return the offset (in bytes) of the field 'args.rl_args.destaddr' */ public static int offset_args_rl_args_destaddr() { return (40 / 8); } /** * Return the offset (in bits) of the field 'args.rl_args.destaddr' */ public static int offsetBits_args_rl_args_destaddr() { return 40; } /** * Return the value (as a int) of the field 'args.rl_args.destaddr' */ public int get_args_rl_args_destaddr() { return (int)getUIntElement(offsetBits_args_rl_args_destaddr(), 16); } /** * Set the value of the field 'args.rl_args.destaddr' */ public void set_args_rl_args_destaddr(int value) { setUIntElement(offsetBits_args_rl_args_destaddr(), 16, value); } /** * Return the size, in bytes, of the field 'args.rl_args.destaddr' */ public static int size_args_rl_args_destaddr() { return (16 / 8); } /** * Return the size, in bits, of the field 'args.rl_args.destaddr' */ public static int sizeBits_args_rl_args_destaddr() { return 16; } ///////////////////////////////////////////////////////// // Accessor methods for field: args.untyped_args // Field type: short[] // Offset (bits): 40 // Size of each element (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'args.untyped_args' is signed (false). */ public static boolean isSigned_args_untyped_args() { return false; } /** * Return whether the field 'args.untyped_args' is an array (true). */ public static boolean isArray_args_untyped_args() { return true; } /** * Return the offset (in bytes) of the field 'args.untyped_args' */ public static int offset_args_untyped_args(int index1) { int offset = 40; if (index1 < 0) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return (offset / 8); } /** * Return the offset (in bits) of the field 'args.untyped_args' */ public static int offsetBits_args_untyped_args(int index1) { int offset = 40; if (index1 < 0) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return offset; } /** * Return the entire array 'args.untyped_args' as a short[] */ public short[] get_args_untyped_args() { throw new IllegalArgumentException("Cannot get field as array - unknown size"); } /** * Set the contents of the array 'args.untyped_args' from the given short[] */ public void set_args_untyped_args(short[] value) { for (int index0 = 0; index0 < value.length; index0++) { setElement_args_untyped_args(index0, value[index0]); } } /** * Return an element (as a short) of the array 'args.untyped_args' */ public short getElement_args_untyped_args(int index1) { return (short)getUIntElement(offsetBits_args_untyped_args(index1), 8); } /** * Set an element of the array 'args.untyped_args' */ public void setElement_args_untyped_args(int index1, short value) { setUIntElement(offsetBits_args_untyped_args(index1), 8, value); } /** * Return the size, in bytes, of each element of the array 'args.untyped_args' */ public static int elementSize_args_untyped_args() { return (8 / 8); } /** * Return the size, in bits, of each element of the array 'args.untyped_args' */ public static int elementSizeBits_args_untyped_args() { return 8; } /** * Return the number of dimensions in the array 'args.untyped_args' */ public static int numDimensions_args_untyped_args() { return 1; } /** * Return the number of elements in the array 'args.untyped_args' * for the given dimension. */ public static int numElements_args_untyped_args(int dimension) { int array_dims[] = { 0, }; if (dimension < 0 || dimension >= 1) throw new ArrayIndexOutOfBoundsException(); if (array_dims[dimension] == 0) throw new IllegalArgumentException("Array dimension "+dimension+" has unknown size"); return array_dims[dimension]; } /** * Fill in the array 'args.untyped_args' with a String */ public void setString_args_untyped_args(String s) { int len = s.length(); int i; for (i = 0; i < len; i++) { setElement_args_untyped_args(i, (short)s.charAt(i)); } setElement_args_untyped_args(i, (short)0); //null terminate } /** * Read the array 'args.untyped_args' as a String */ public String getString_args_untyped_args() { char carr[] = new char[net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH]; int i; for (i = 0; i < carr.length; i++) { if ((char)getElement_args_untyped_args(i) == (char)0) break; carr[i] = (char)getElement_args_untyped_args(i); } return new String(carr,0,i); } } --- NEW FILE: gpsRetrieve.nc --- includes AM; interface gpsRetrieve { command result_t execute(TOS_MsgPtr pmsg); event result_t done(TOS_MsgPtr pmsg, result_t status); } Index: gps.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/gps/gps.nc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gps.nc 14 Apr 2003 18:24:56 -0000 1.12 --- gps.nc 22 May 2003 22:29:47 -0000 1.13 *************** *** 1,87 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ ! ! ! /* tab:4 ! * Copyright (c) 2000-2002 The Regents of the University of California. ! * All rights reserved. ! * ! * Permission to use, copy, modify, and distribute this software and its ! * documentation for any purpose, without fee, and without written agreement is ! * hereby granted, provided that the above copyright notice, the following ! * two paragraphs and the author appear in all copies of this software. ! * ! * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR ! * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT ! * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF ! * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! * ! * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, ! * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY ! * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ! * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO ! * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." ! * ! */ ! ! /* ! * This file is part of the FireBug project. ! * ! * FireBug is free software; you can redistribute it and/or modify it ! * under the terms of the GNU Lesser General Public License as published by the ! * Free Software Foundation; either version 2, or (at your option) any ! * later version. ! * ! * FireBug is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License ! * for more details. ! ! * You should have received a copy of the GNU Lesser General Public License ! * along with Geotechnica; see the file COPYING. If not, write to the Free ! * Software Foundation, 59 Temple Place - Suite 330, Boston, ! * MA 02111-1307, USA. ! */ ! ! /* ! * @authors C Majidi ! * @date $Date$ ! * ! */ ! ! /* ! * Logs GPS data into mote's EEPROM ! */ ! ! ! includes AM; ! ! configuration gps { ! } ! ! ! implementation { ! ! components Main, ! LedsC, ! ClockC, ! SimpleCmd, ! gpsM, ! //gps_uartM, ! gps_packet; ! ! components GenericComm as Comm; ! ! Main.StdControl -> gpsM; ! ! gpsM.Leds -> LedsC; ! ! gpsM.Clock -> ClockC; ! ! //gpsM.gps_uart -> gps_uartM; ! ! gpsM.SubControl -> Comm; ! ! gpsM.Packet -> gps_packet.Packet; ! ! } ! --- 1,80 ---- ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ ! ! ! /* tab:4 ! * Copyright (c) 2000-2002 The Regents of the University of California. ! * All rights reserved. ! * ! * Permission to use, copy, modify, and distribute this software and its ! * documentation for any purpose, without fee, and without written agreement is ! * hereby granted, provided that the above copyright notice, the following ! * two paragraphs and the author appear in all copies of this software. ! * ! * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR ! * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT ! * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF ! * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! * ! * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, ! * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY ! * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ! * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO ! * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." ! * ! */ ! ! /* ! * This file is part of the FireBug project. ! * ! * FireBug is free software; you can redistribute it and/or modify it ! * under the terms of the GNU Lesser General Public License as published by the ! * Free Software Foundation; either version 2, or (at your option) any ! * later version. ! * ! * FireBug is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License ! * for more details. ! ! * You should have received a copy of the GNU Lesser General Public License ! * along with Geotechnica; see the file COPYING. If not, write to the Free ! * Software Foundation, 59 Temple Place - Suite 330, Boston, ! * MA 02111-1307, USA. ! */ ! ! /* ! * @authors C Majidi ! * @date $Date$ ! * ! */ ! ! /* ! * Logs GPS data into mote's EEPROM ! * Only runs on the mica2 platform ! */ ! ! ! includes AM; ! ! configuration gps { ! } ! ! ! implementation { ! ! components Main, ! LedsC, ! gpsM; ! ! components GenericComm as Comm, Logger; ! ! Main.StdControl -> gpsM; ! ! gpsM.Leds -> LedsC; ! gpsM.LoggerWrite -> Logger.LoggerWrite; ! gpsM.LoggerRead -> Logger; ! ! gpsM.SubControl -> Comm; ! gpsM.SubControl -> Logger; ! } ! Index: gpsM.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/gps/gpsM.nc,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** gpsM.nc 18 Apr 2003 20:47:55 -0000 1.25 --- gpsM.nc 22 May 2003 22:29:47 -0000 1.26 *************** *** 1,270 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ ! ! /* tab:4 ! * Copyright (c) 2000-2002 The Regents of the University of California. ! * All rights reserved. ! * ! * Permission to use, copy, modify, and distribute this software and its ! * documentation for any purpose, without fee, and without written agreement is ! * hereby granted, provided that the above copyright notice, the following ! * two paragraphs and the author appear in all copies of this software. ! * ! * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR ! * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT ! * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF ! * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! * ! * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, ! * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY ! * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ! * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO ! * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." ! * ! */ ! ! /* ! * This file is part of the FireBug project. ! * ! * FireBug is free software; you can redistribute it and/or modify it ! * under the terms of the GNU Lesser General Public License as published by the ! * Free Software Foundation; either version 2, or (at your option) any ! * later version. ! * ! * FireBug is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License ! * for more details. ! ! * You should have received a copy of the GNU Lesser General Public License ! * along with Geotechnica; see the file COPYING. If not, write to the Free ! * Software Foundation, 59 Temple Place - Suite 330, Boston, ! * MA 02111-1307, USA. ! */ ! /* ! * @authors C Majidi ! * @date $Date$ ! * ! */ ! ! /* Collects location data from a GPS receiver ! * stores it into a mote's EEPROM ! */ ! ! /* Set-up: ! * 1. mount receiver board onto mote ! * 2. power on mote ! * 3. mote collects GPS data and logs it in EEPROM ! * ! * 4. to retrieve data, perform the following: ! * a. load a second mote w/ genericbase ! * b. leave genericbase mote on programming board ! * c. open serial forward on PC: ! * java net.tinyos.sf.SerialForward ! * d. broadcast retrieve command over the radio: ! * java net.tinyos.tools.BcastInject ... ! * <group ID> read_log <gps mote ID> ! * e. packet is sent to the base station via radio ! */ ! ! /* Implementation: ! * 1. Initialize UART at 4800 baud ! * 2. Powerup GPS ! * 3. Set GPS to 9600 and NMEA data format ! * 4. Switch UART to 9600 baud ! * 5. NMEA message received on UART RX (interrupt handler) ! * via gps_packet module ! * 6. Filter for GGA Message and Parse ! * 7. If data valid, store in EEPROM ! * 8. Poweroff GPS ! */ ! ! /* Debugging: ! * Green Light Toggle - GPS receiver initialization ! * Red Light Toggle - UART RX Event ! * Yellow Light Toggle - GPSMsg stored in EEPROM ! */ ! ! includes gps; ! ! //GPS States ! #define GPS_IDLE 0 ! #define GPS_POWERON 1 ! #define GPS_WAKEUP 2 ! #define GPS_INIT 3 //GPS initialization state ! #define GPS_SENDMSG 4 //Send GGA query, not in original code ! #define GPS_LOCATE 5 //GPS searching ! #define GPS_POWEROFF 6 ! ! #define TOS_CLK_DIV 32 ! #define TICS_PER_100MSEC 12 ! ! #define GPS_BAUD4800 50 //GPS NMEA default (does 50 correspond to 4800?) ! #define GPS_BAUD9600 25 //4MHz System Clock rate ! ! ! module gpsM { ! ! provides { ! ! interface StdControl; ! ! // following not needed if gps_uart used ! command result_t SetBaud(char rate); ! } ! ! uses { ! ! interface StdControl as SubControl; ! interface Leds; ! interface Packet; ! interface Clock; ! //interface gps_uart; ! } ! } ! ! ! implementation { ! ! /* ! ****************** ! *Define Variables* ! ****************** ! */ ! ! char cGPSState; ! char NextGPSState; ! char Ticksper100mSec; ! char ClockTickDivider; ! ! /* ! ******************* ! *Initialize Client* ! ******************* ! */ ! ! command result_t StdControl.init() { ! TOSH_SET_PW1_PIN(); // poweroff GPS ! //call gps_uart.init2(GPS_BAUD4800); //init UART at 4800 baud ! call SetBaud(GPS_BAUD4800); //init UART at 4800 baud ! return rcombine(call SubControl.init(), call Leds.init()); ! } ! ! /* ! ******************* ! *Start/Stop Client* ! ******************* ! */ ! ! command result_t StdControl.start() { ! ClockTickDivider = 0; ! Ticksper100mSec = TICS_PER_100MSEC; ! cGPSState = GPS_POWERON; ! call Clock.setRate(TOS_CLK_DIV,2); ! return call SubControl.start(); ! } ! ! command result_t StdControl.stop() { ! cGPSState = GPS_POWEROFF; ! return call SubControl.stop(); ! } ! ! /* ! ******************* ! *Event: Clock Tick* ! ******************* ! */ ! ! event result_t Clock.fire() { ! ! if (cGPSState == GPS_IDLE) { ! return SUCCESS; ! } ! ! //Handler for high rate user clocks ! ClockTickDivider++; ! if (ClockTickDivider < Ticksper100mSec){ ! return SUCCESS; ! } ! ClockTickDivider = 0; ! ! ! /* Most of the switch statement exists to ! * allow a delay between processing successive ! * commands issued to the GPS hardware. ! * Everything between POWERON and POWEROFF ! * could probably be replaced with a function ! * using time delays between calls. ! */ ! switch (cGPSState) { ! ! case GPS_POWERON: ! TOSH_CLR_PW1_PIN(); // Poweron GPS ! //call gps_uart.init2(GPS_BAUD4800); ! //call SetBaud(GPS_BAUD4800); ! NextGPSState = GPS_WAKEUP; ! break; ! ! case GPS_WAKEUP: ! //call Packet.gpsSet(); // set GPS to 9600 baud, NMEA format ! NextGPSState = GPS_INIT; ! break; ! ! case GPS_INIT: ! //call gps_uart.init2(GPS_BAUD9600); ! call SetBaud(GPS_BAUD9600); ! call Leds.greenOn(); // DEBUG: GPS Initialized ! //NextGPSState = GPS_LOCATE; ! NextGPSState = GPS_SENDMSG; ! break; ! ! // NOTE: GPS_SENDMSG not part of original code ! case GPS_SENDMSG: ! call Packet.gpsGGA(); ! NextGPSState = GPS_LOCATE; ! break; ! ! case GPS_LOCATE: ! if (call Packet.nmeaReady()) { ! call Packet.gpsLog(); ! NextGPSState = GPS_POWEROFF; ! } ! break; ! ! case GPS_POWEROFF: ! TOSH_SET_PW1_PIN(); // Poweroff GPS ! NextGPSState = GPS_IDLE; ! break; ! } ! ! cGPSState = NextGPSState; ! return SUCCESS; ! } ! ! /* ! ************************* ! *Set Baud on Client UART* ! ************************* ! * ! *NOTE: not required if gps_uart is used ! * instead, call gps_uart.init2(rate) ! */ ! ! command result_t SetBaud(char rate) { ! //FIXME: Document ! outp(rate, UBRR); //what does this do? ! inp(UDR); //what does this do? ! outp(0xd8, UCR); //what does this do? ! sei(); //what does this do? ! return SUCCESS; ! } ! ! event result_t Packet.rxByteReady(uint8_t data) { ! return SUCCESS; ! } ! ! event result_t Packet.txByteReady(char success) { ! return SUCCESS; ! } ! ! } ! --- 1,407 ---- ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ ! ! /* tab:4 ! * Copyright (c) 2000-2002 The Regents of the University of California. ! * All rights reserved. ! * ! * Permission to use, copy, modify, and distribute this software and its ! * documentation for any purpose, without fee, and without written agreement is ! * hereby granted, provided that the above copyright notice, the following ! * two paragraphs and the author appear in all copies of this software. ! * ! * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR ! * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT ! * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF ! * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! * ! * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, ! * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY ! * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ! * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO ! * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." ! * ! */ ! ! /* ! * This file is part of the FireBug project. ! * ! * FireBug is free software; you can redistribute it and/or modify it ! * under the terms of the GNU Lesser General Public License as published by the ! * Free Software Foundation; either version 2, or (at your option) any ! * later version. ! * ! * FireBug is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License ! * for more details. ! ! * You should have received a copy of the GNU Lesser General Public License ! * along with Geotechnica; see the file COPYING. If not, write to the Free ! * Software Foundation, 59 Temple Place - Suite 330, Boston, ! * MA 02111-1307, USA. ! */ ! /* ! * @authors C Majidi ! * @date $Date$ ! * ! */ ! ! /* Collects location data from a GPS receiver ! * stores it into a mote's EEPROM. ! * Only runs on the mica2 platform. ! */ ! ! /* Set-up: ! * 1. mount receiver board onto mote ! * 2. power on mote ! * 3. mote collects GPS data and logs it in EEPROM ! * ! * 4. to retrieve data, perform the following: ! * a. load a second mote w/ genericbase ! * b. leave genericbase mote on programming board ! * c. open serial forward on PC: ! * java net.tinyos.sf.SerialForward ! * d. broadcast retrieve command over the radio: ! * java net.tinyos.tools.BcastInject ... ! * <group ID> read_log <gps mote ID> ! * e. packet is sent to the base station via radio ! */ ! ! /* Implementation: ! * 1. Powerup GPS ! * 2. Set UART1 to 4800 baud ! * 3. Command GPS to output GGA message once per second ! * 4. When # of satellites used > 3, store message ! * a) store each field in a separate line of EEPROM ! * b) data stored in lines 25 to 38 (i.e. 14 fields) ! * 5. Poweroff GPS ! */ ! ! includes gps; ! ! #define MSG_LENGTH 100 ! #define DELIMITER ',' ! ! // MICA 2 UART baud rates ! #define GPS_BAUD_MICA2_57600 15 ! #define GPS_BAUD_MICA2_19200 47 ! #define GPS_BAUD_MICA2_9600 95 ! #define GPS_BAUD_MICA2_4800 191 ! ! ! module gpsM { ! ! provides { ! interface StdControl; ! command result_t getGPS(); ! command result_t waitGPS(); ! command result_t logGPS(uint8_t NMEAstr[MSG_LENGTH]); ! command result_t clearGPS(); ! } ! ! uses { ! interface StdControl as SubControl; ! interface Leds; ! interface LoggerWrite; ! interface LoggerRead; ! } ! } ! ! ! implementation { ! ! uint16_t j; ! uint8_t cmd_msg[MSG_LENGTH]; ! ! /* ! ******************* ! *Initialize Client* ! ******************* ! */ ! ! command result_t StdControl.init() { ! TOSH_MAKE_PW0_OUTPUT(); //make PW1 an output ! //TOSH_SET_PW0_PIN(); //turn on GPS power ! TOSH_CLR_PW0_PIN(); //turn on GPS power ! ! //uart1 also connected to serial flash,.. disable it ! TOSH_MAKE_FLASH_SELECT_OUTPUT(); //make flash memory enable an output ! TOSH_SET_FLASH_SELECT_PIN(); //disable serial flash ! ! // configure uart1 for 4800 baud ! outp(0,UBRR1H); ! outp(GPS_BAUD_MICA2_4800, UBRR1L); ! outp((1<<U2X),UCSR1A); // Set UART double speed ! outp(((1 << UCSZ1) | (1 << UCSZ0)) , UCSR1C); // Set frame format: 8 data-bits, 1 stop-bit ! // Enable reciever and transmitter, disabletheir interrupts ! inp(UDR1); ! outp(((0 << RXCIE) | (0 << TXCIE) | (1 << RXEN) | (1 << TXEN)) ,UCSR1B); ! ! // configure uart0 for 4800 baud (still runs at 57,6 !!) ! outp(0,UBRR0H); ! outp(GPS_BAUD_MICA2_4800, UBRR0L); ! outp((1<<U2X),UCSR0A); // Set UART double speed ! outp(((1 << UCSZ1) | (1 << UCSZ0)) , UCSR0C); // Set frame format: 8 data-bits, 1 stop-bit ! inp(UDR0); ! // Enable reciever and transmitter, disabletheir interrupts ! outp(((0 << RXCIE) | (0 << TXCIE) | (1 << RXE... [truncated message content] |
From: <che...@us...> - 2003-05-22 22:20:20
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv28822 Modified Files: fbmsg.html Log Message: . Index: fbmsg.html =================================================================== RCS file: /cvsroot/firebug/firebug/web/fbmsg.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fbmsg.html 22 May 2003 04:40:32 -0000 1.2 --- fbmsg.html 22 May 2003 22:20:17 -0000 1.3 *************** *** 22,29 **** <li> <b>Payload</b> (up to 29 bytes):</li> <ul> ! <li> <b>source mote ID</b> (2 bytes)</li> ! <li> <b>sample counter</b> (2 bytes)</li> ! <li> <b>ADC channel</b> (2 bytes)</li> ! <li> <b>ADC data readings</b> (10 readings of 2 bytes each)</li> </ul> </ul> --- 22,28 ---- <li> <b>Payload</b> (up to 29 bytes):</li> <ul> ! <li> <b>VirtualComm Header</b> (2 bytes)</li> ! <li> <b>Mhsender Header</b> (3 bytes)</li> ! <li> <b>Sensor data readings</b> (10 readings of 2 bytes each)</li> </ul> </ul> *************** *** 36,40 **** <tr class="msg_header"> <td colspan=4><b>TOS HEADER</b></td> ! <td colspan=3><b>MH6 INFO</b></td> <td colspan=1><b>FIREBUG DATA</b></td> </tr> --- 35,39 ---- <tr class="msg_header"> <td colspan=4><b>TOS HEADER</b></td> ! <td colspan=2><b>MH6 INFO</b></td> <td colspan=1><b>FIREBUG DATA</b></td> </tr> *************** *** 44,50 **** <td><b>groupID</b></td> <td><b>msg len</b></td> ! <td><b>source addr</b></td> ! <td><b>counter</b></td> ! <td><b>channel</b></td> <td><b>readings</b><td> </tr> --- 43,48 ---- <td><b>groupID</b></td> <td><b>msg len</b></td> ! <td><b>VirtualComm Header</b></td> ! <td><b>Mhsender Header</b></td> <td><b>readings</b><td> </tr> *************** *** 55,60 **** <td bgcolor="#d0d0ff">1a</td> <td bgcolor="#d0ffd0">01 00</td> ! <td bgcolor="#d0ffd0">14 00</td> ! <td bgcolor="#d0ffd0">01 00</td> <td bgcolor="#ffd0d0">96 03 97 03 97 03 98 03 97 03 96 03 97 03 96 03 96 03 96 03</td> </tr> --- 53,57 ---- <td bgcolor="#d0d0ff">1a</td> <td bgcolor="#d0ffd0">01 00</td> ! <td bgcolor="#d0ffd0">14 00 01</td> <td bgcolor="#ffd0d0">96 03 97 03 97 03 98 03 97 03 96 03 97 03 96 03 96 03 96 03</td> </tr> |
From: <che...@us...> - 2003-05-22 21:48:48
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv15181 Modified Files: db_create.php table_select.php Log Message: fix the global variable bug. Index: db_create.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/db_create.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** db_create.php 21 May 2003 21:58:15 -0000 1.5 --- db_create.php 22 May 2003 21:48:45 -0000 1.6 *************** *** 56,59 **** --- 56,60 ---- print "<br />"; print $statement; + mysql_query($statement) or die("Error: ".mysql_error()." in inserting current atable"); } ?> Index: table_select.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/table_select.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** table_select.php 15 May 2003 23:46:34 -0000 1.4 --- table_select.php 22 May 2003 21:48:45 -0000 1.5 *************** *** 1,4 **** --- 1,6 ---- <?php> session_start(); + session_register("dbname"); + session_register("tblname"); ?> *************** *** 29,39 **** <?php ! session_register("dbname"); ! session_register("tblname"); ! ! if (!isset($HTTP_SESSION_VARS["tblname"])) { ! $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; ! $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; ! } --- 31,38 ---- <?php ! //if (!isset($HTTP_SESSION_VARS["tblname"])) { ! if ($HTTP_POST_VARS["tbl1"]!=Null){ ! $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; ! $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; } |
From: <do...@us...> - 2003-05-22 19:07:30
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv30593a Modified Files: db_drop.php list_db.php Log Message: Simplified array handling for the database dropping php script.This change needs to be propogated into list_db.php. Index: db_drop.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/db_drop.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_drop.php 14 May 2003 22:40:18 -0000 1.1 --- db_drop.php 22 May 2003 19:07:27 -0000 1.2 *************** *** 25,29 **** $dblink=mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); ! $system_dbs = array(1 => "mysql", 2 => "test"); $db_list = mysql_list_dbs($dblink); --- 25,30 ---- $dblink=mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); ! /* Add the names of other databases here. */ ! $system_dbs = array("mysql","test"); $db_list = mysql_list_dbs($dblink); Index: list_db.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/list_db.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** list_db.php 15 May 2003 23:38:28 -0000 1.5 --- list_db.php 22 May 2003 19:07:28 -0000 1.6 *************** *** 24,28 **** <?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); --- 24,29 ---- <?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); |
From: <do...@us...> - 2003-05-22 04:40:35
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv13689 Modified Files: fbmsg.html firebug.css Log Message: Added headers, css extension. Index: fbmsg.html =================================================================== RCS file: /cvsroot/firebug/firebug/web/fbmsg.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fbmsg.html 22 May 2003 01:51:28 -0000 1.1 --- fbmsg.html 22 May 2003 04:40:32 -0000 1.2 *************** *** 14,21 **** <h1>FireBug Active Message definition</h1> - - - - <p> <ul> --- 14,17 ---- *************** *** 38,43 **** <p> <table cellspacing=10 cellpadding=0 border=0 hspace=0> ! <tr bgcolor="#d0d0d0" > ! <td colspan=4><b>TOS AM</b></td> </tr> <tr bgcolor="#d0d0d0"> --- 34,41 ---- <p> <table cellspacing=10 cellpadding=0 border=0 hspace=0> ! <tr class="msg_header"> ! <td colspan=4><b>TOS HEADER</b></td> ! <td colspan=3><b>MH6 INFO</b></td> ! <td colspan=1><b>FIREBUG DATA</b></td> </tr> <tr bgcolor="#d0d0d0"> Index: firebug.css =================================================================== RCS file: /cvsroot/firebug/firebug/web/firebug.css,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** firebug.css 20 May 2003 21:01:53 -0000 1.9 --- firebug.css 22 May 2003 04:40:32 -0000 1.10 *************** *** 25,28 **** --- 25,33 ---- } + tr.msg_header { + background-color:#ffcc00; + text-align:center; + } + td.code { padding:5px; |
From: <che...@us...> - 2003-05-22 03:06:28
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1:/tmp/cvs-serv20558 Modified Files: DBLogger.java SensorPacket.java Log Message: filter out the non-data packet Index: DBLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/DBLogger.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** DBLogger.java 21 May 2003 23:51:51 -0000 1.13 --- DBLogger.java 22 May 2003 03:06:25 -0000 1.14 *************** *** 40,44 **** //float temp = (float)(72.0 + (3*rand.nextGaussian())); //return temp; ! float basetemp=(float)(packet[12]*256+packet[11]); //float temp=TestDBLogger.getRandomTemp(basetemp); return basetemp; //temp; --- 40,44 ---- //float temp = (float)(72.0 + (3*rand.nextGaussian())); //return temp; ! float basetemp=(float)((long)packet[12]*256+(long)packet[11]); //float temp=TestDBLogger.getRandomTemp(basetemp); return basetemp; //temp; *************** *** 66,69 **** --- 66,85 ---- } + private int get_packet_type(byte [] packet) { + + return (int)packet[2]; + } + + private void print_packet_raw(byte [] packet) { + + //int size = packet.size; + + for (int i = 0; i < 15; i++) { + System.out.print(packet[i] + " "); + } + System.out.println("\n"); + } + + /** Put everything in print for now. */ *************** *** 87,95 **** float baro_pres = getBaroPres(packet); try { ResultSet rs; Statement stmt = conn.createStatement(); ! String updatequery = "UPDATE current " + "SET time=" + time + ", " --- 103,131 ---- float baro_pres = getBaroPres(packet); + if (get_packet_type(packet) != 1){ + dbh.return_connection(conn); + return; + } + + + if ( get_packet_type(packet) == 1 && + packet[7] == -1) { + dbh.return_connection(conn); + return; + } + + print_packet_raw(packet); + + //base station ID is 1; + if (mote_id == 1) { + dbh.return_connection(conn); + return; + } + try { ResultSet rs; Statement stmt = conn.createStatement(); ! String updatequery = "UPDATE current " + "SET time=" + time + ", " *************** *** 161,187 **** * example packets to be fed into the DBLogger class. */ ! //class TestDBLogger { /** "test" is the _only_public_method_ in this * class. */ ! // public static boolean test(DBLogger dbl) { ! /* ! byte [] packet = {0x7e,0,0x0a,0x7d,0x1a, ! 0x01,0x01, ! 0x01,0x02,0x03, ! 0x01, //mote_id ! 0x12,0x67, //temp ! 0x37,0x2d, //rel_hum ! 0x4a,0x22 //baro ! }; ! dbl.print(packet); ! return false; } ! */ ! // getRandomID, getRandomTime, getRandomRelHum, etc. /** All of the following methods are private --- 197,231 ---- * example packets to be fed into the DBLogger class. */ ! class TestDBLogger { /** "test" is the _only_public_method_ in this * class. */ ! public static boolean test(DBLogger dbl) { ! ! byte mote_id = (byte)0xff; ! ! byte [] packet = {0x7e, //header ! 0x0, //header ! 0x0a, //packet type ! 0x7d, //header ! 0x1a, //header ! 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); ! return false; } ! /** All of the following methods are private *************** *** 189,193 **** * class. */ ! /* private static int getRandomID(int baseID) { --- 233,237 ---- * class. */ ! private static int getRandomID(int baseID) { *************** *** 217,219 **** } - */ --- 261,262 ---- Index: SensorPacket.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/SensorPacket.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SensorPacket.java 21 May 2003 22:32:23 -0000 1.5 --- SensorPacket.java 22 May 2003 03:06:25 -0000 1.6 *************** *** 84,88 **** s += " [="+Long.toString((long)tempF)+" Fahrenheit Degree]\n"; */ ! if (packet[2]==1 && packet[5]!=1){ s += " [MoteID="+Long.toString(packet[10])+ "]\n"; //Humidity --- 84,88 ---- s += " [="+Long.toString((long)tempF)+" Fahrenheit Degree]\n"; */ ! if (packet[2]==1 && packet[7]!=-1 && packet[10]!=1){ s += " [MoteID="+Long.toString(packet[10])+ "]\n"; //Humidity |
From: <do...@us...> - 2003-05-22 01:51:34
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv13492 Added Files: fbmsg.html Log Message: Added a web page detailing message layout. --- NEW FILE: fbmsg.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <link type="text/css" rel="stylesheet" href="firebug.css"> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <title>FireBug Active Message definition</title> </head> <body> <h1>FireBug Active Message definition</h1> <p> <ul> <li> <b>Destination address</b> (2 bytes)</li> <li> <b>Active Message handler ID</b> (1 byte)</li> <li> <b>Group ID</b> (1 byte)</li> <li> <b>Message length</b> (1 byte)</li> <li> <b>Payload</b> (up to 29 bytes):</li> <ul> <li> <b>source mote ID</b> (2 bytes)</li> <li> <b>sample counter</b> (2 bytes)</li> <li> <b>ADC channel</b> (2 bytes)</li> <li> <b>ADC data readings</b> (10 readings of 2 bytes each)</li> </ul> </ul> <p> So we can interpret the data packet as follows: <p> <table cellspacing=10 cellpadding=0 border=0 hspace=0> <tr bgcolor="#d0d0d0" > <td colspan=4><b>TOS AM</b></td> </tr> <tr bgcolor="#d0d0d0"> <td><b>dest addr</b></td> <td><b>handlerID</b></td> <td><b>groupID</b></td> <td><b>msg len</b></td> <td><b>source addr</b></td> <td><b>counter</b></td> <td><b>channel</b></td> <td><b>readings</b><td> </tr> <tr> <td bgcolor="#d0d0ff">7e 00</td> <td bgcolor="#d0d0ff">0a</td> <td bgcolor="#d0d0ff">7d</td> <td bgcolor="#d0d0ff">1a</td> <td bgcolor="#d0ffd0">01 00</td> <td bgcolor="#d0ffd0">14 00</td> <td bgcolor="#d0ffd0">01 00</td> <td bgcolor="#ffd0d0">96 03 97 03 97 03 98 03 97 03 96 03 97 03 96 03 96 03 96 03</td> </tr> </table> </body> </html> |
From: <do...@us...> - 2003-05-21 23:51:55
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug/database In directory sc8-pr-cvs1:/tmp/cvs-serv16587/src/org/firebug/database Modified Files: MysqlDBHandler.java Log Message: Working out a bug in db connection. Index: MysqlDBHandler.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/database/MysqlDBHandler.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MysqlDBHandler.java 21 May 2003 23:30:40 -0000 1.6 --- MysqlDBHandler.java 21 May 2003 23:51:51 -0000 1.7 *************** *** 69,72 **** --- 69,74 ---- } else { this.use_c_pool = false; + connectionqueue = new LinkedList(); + initializeCQueue(1); } } *************** *** 158,165 **** * popped off the top. */ - connectionqueue.add(connection); ! if (debug) { ! System.out.println("Connection returned to queue..."); } --- 160,171 ---- * popped off the top. */ ! if (use_c_pool) { ! connectionqueue.add(connection); ! if (debug) { ! System.out.println("Connection returned to queue..."); ! } ! } else { ! closeConnection(connection); } *************** *** 248,253 **** con.close(); closed = true; ! if (debug) System.out.println("Connection closed."); } catch (SQLException sqle) { System.out.println("Can't close the connection."); --- 254,260 ---- con.close(); closed = true; ! if (debug) { System.out.println("Connection closed."); + } } catch (SQLException sqle) { System.out.println("Can't close the connection."); |
From: <do...@us...> - 2003-05-21 23:51:55
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1:/tmp/cvs-serv16587/src/org/firebug Modified Files: DBLogger.java Log Message: Working out a bug in db connection. Index: DBLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/DBLogger.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** DBLogger.java 21 May 2003 23:06:38 -0000 1.12 --- DBLogger.java 21 May 2003 23:51:51 -0000 1.13 *************** *** 74,77 **** --- 74,78 ---- Connection conn = dbh.getConnection(); + // Ugh what a kludge. The GPS date/time format // is not compatible with java. The date/time |
From: <do...@us...> - 2003-05-21 23:30:43
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug/database In directory sc8-pr-cvs1:/tmp/cvs-serv4362/src/org/firebug/database Modified Files: MysqlDBHandler.java Log Message: More cleanup in the database handler. Index: MysqlDBHandler.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/database/MysqlDBHandler.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MysqlDBHandler.java 21 May 2003 23:06:38 -0000 1.5 --- MysqlDBHandler.java 21 May 2003 23:30:40 -0000 1.6 *************** *** 40,50 **** setDebug(); ! setDBHost("localhost"); ! setDBPort("3306"); ! setDBUser("root"); ! setDBPass(""); ! ! connectionqueue = new LinkedList(); ! initializeCQueue(number_of_connections); } --- 40,45 ---- setDebug(); ! setDBProperties("localhost","","3306","root",""); ! set_c_pool(use_c_pool); } *************** *** 53,63 **** setDebug(); ! setDBHost(host); ! setDBPort(port); ! setDBUser(user); ! setDBPass(passwd); ! ! connectionqueue = new LinkedList(); ! initializeCQueue(number_of_connections); } --- 48,53 ---- setDebug(); ! setDBProperties(host,"",port,user,passwd); ! set_c_pool(use_c_pool); } *************** *** 66,80 **** setDebug(); ! setDBHost(host); ! setDBPort(port); ! setDBUser(user); ! setDBPass(passwd); ! ! connectionqueue = new LinkedList(); ! initializeCQueue(number_of_connections); ! use_c_pool = true; } --- 56,74 ---- setDebug(); ! setDBProperties(host,"",port,user,passwd); ! set_c_pool(use_c_pool); } + private void set_c_pool(boolean use_c_pool) { + + if (use_c_pool) { + this.use_c_pool = true; + connectionqueue = new LinkedList(); + initializeCQueue(number_of_connections); + } else { + this.use_c_pool = false; + } + } *************** *** 131,137 **** * instead of throwing. This should make it a bit easier * to write cleaner code in the classes that invoke it. ! * Since everything is basically going to the same oracle ! * server, and is called by one class at a time (multipass ! * algorithm and the Categorizer runs by itself), * this should not present a big problem. */ --- 125,130 ---- * instead of throwing. This should make it a bit easier * to write cleaner code in the classes that invoke it. ! * Since everything is going to the same database ! * server, and is called by one class at a time, * this should not present a big problem. */ |
From: <do...@us...> - 2003-05-21 23:06:41
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug/database In directory sc8-pr-cvs1:/tmp/cvs-serv23562/src/org/firebug/database Modified Files: MysqlDBHandler.java Log Message: Added support for using connection queue Index: MysqlDBHandler.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/database/MysqlDBHandler.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MysqlDBHandler.java 14 May 2003 01:25:12 -0000 1.4 --- MysqlDBHandler.java 21 May 2003 23:06:38 -0000 1.5 *************** *** 13,17 **** /** FIXME: Move number_of_connections to the properties file. */ ! private int number_of_connections = 2; private LinkedList connectionqueue; --- 13,17 ---- /** FIXME: Move number_of_connections to the properties file. */ ! private int number_of_connections = 10; private LinkedList connectionqueue; *************** *** 62,65 **** --- 62,79 ---- } + public MysqlDBHandler(String host, String port, + String user, String passwd, boolean use_c_pool) { + + setDebug(); + setDBHost(host); + setDBPort(port); + setDBUser(user); + setDBPass(passwd); + + connectionqueue = new LinkedList(); + initializeCQueue(number_of_connections); + use_c_pool = true; + } + *************** *** 70,73 **** --- 84,88 ---- connectionqueue = new LinkedList(); initializeCQueue(number_of_connections); + } |
From: <do...@us...> - 2003-05-21 23:06:41
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1:/tmp/cvs-serv23562/src/org/firebug Modified Files: DBLogger.java Log Message: Added support for using connection queue Index: DBLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/DBLogger.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** DBLogger.java 21 May 2003 22:32:23 -0000 1.11 --- DBLogger.java 21 May 2003 23:06:38 -0000 1.12 *************** *** 16,20 **** public DBLogger () { ! dbh = new MysqlDBHandler("localhost","3306","root",""); } --- 16,20 ---- public DBLogger () { ! dbh = new MysqlDBHandler("localhost","3306","root","",true); } |
From: <che...@us...> - 2003-05-21 22:42:53
|
Update of /cvsroot/firebug/firebug/project/src/multihop In directory sc8-pr-cvs1:/tmp/cvs-serv6463 Modified Files: CollectDataMFB.nc Log Message: add temp into packet Index: CollectDataMFB.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/CollectDataMFB.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CollectDataMFB.nc 19 May 2003 07:06:46 -0000 1.2 --- CollectDataMFB.nc 21 May 2003 22:39:15 -0000 1.3 *************** *** 42,47 **** struct DataFormat_t { uint8_t addr; ! uint8_t cnt; ! uint8_t sampledata; }; --- 42,51 ---- struct DataFormat_t { uint8_t addr; ! //uint8_t cnt; ! //uint8_t sampledata; ! uint16_t temp; ! //uint16_t rel_hum; ! //uint16_t baro; ! }; *************** *** 90,100 **** dataPortion = call MultiHopSend.getUsablePortion(msgToSend.data); - df = (struct DataFormat_t *) dataPortion; df->addr = TOS_LOCAL_ADDRESS; ! df->cnt = counter++; ! df->sampledata=TOS_LOCAL_ADDRESS; //more sensor data put here //.... sending = 1; result = call MultiHopSend.send(&msgToSend, sizeof(struct DataFormat_t)); --- 94,105 ---- dataPortion = call MultiHopSend.getUsablePortion(msgToSend.data); df = (struct DataFormat_t *) dataPortion; df->addr = TOS_LOCAL_ADDRESS; ! //df->cnt = counter++; ! //df->sampledata=TOS_LOCAL_ADDRESS; //more sensor data put here //.... + df->temp=0x04CE; + sending = 1; result = call MultiHopSend.send(&msgToSend, sizeof(struct DataFormat_t)); |
From: <che...@us...> - 2003-05-21 22:32:27
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1:/tmp/cvs-serv2398 Modified Files: DBLogger.java SensorPacket.java Log Message: . Index: DBLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/DBLogger.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DBLogger.java 20 May 2003 16:30:45 -0000 1.10 --- DBLogger.java 21 May 2003 22:32:23 -0000 1.11 *************** *** 33,37 **** int baseID=packet[10]; //int id=TestDBLogger.getRandomID(baseID); ! return 0; //id; } --- 33,37 ---- int baseID=packet[10]; //int id=TestDBLogger.getRandomID(baseID); ! return baseID; //id; } *************** *** 40,46 **** //float temp = (float)(72.0 + (3*rand.nextGaussian())); //return temp; ! float basetemp=packet[12]*256+packet[11]; //float temp=TestDBLogger.getRandomTemp(basetemp); ! return 0; //temp; } --- 40,46 ---- //float temp = (float)(72.0 + (3*rand.nextGaussian())); //return temp; ! float basetemp=(float)(packet[12]*256+packet[11]); //float temp=TestDBLogger.getRandomTemp(basetemp); ! return basetemp; //temp; } *************** *** 160,171 **** * example packets to be fed into the DBLogger class. */ ! class TestDBLogger { /** "test" is the _only_public_method_ in this * class. */ ! public static boolean test(DBLogger dbl) { ! ! byte [] packet = {0x7e,0,0x0a,0x7d,0x1a, 0x01,0x01, 0x01,0x02,0x03, --- 160,171 ---- * example packets to be fed into the DBLogger class. */ ! //class TestDBLogger { /** "test" is the _only_public_method_ in this * class. */ ! // public static boolean test(DBLogger dbl) { ! /* ! byte [] packet = {0x7e,0,0x0a,0x7d,0x1a, 0x01,0x01, 0x01,0x02,0x03, *************** *** 175,184 **** 0x4a,0x22 //baro }; ! ! dbl.print(packet); return false; } ! // getRandomID, getRandomTime, getRandomRelHum, etc. --- 175,185 ---- 0x4a,0x22 //baro }; ! ! ! dbl.print(packet); return false; } ! */ // getRandomID, getRandomTime, getRandomRelHum, etc. *************** *** 187,190 **** --- 188,192 ---- * class. */ + /* private static int getRandomID(int baseID) { *************** *** 214,215 **** --- 216,218 ---- } + */ Index: SensorPacket.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/SensorPacket.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SensorPacket.java 15 May 2003 23:03:20 -0000 1.4 --- SensorPacket.java 21 May 2003 22:32:23 -0000 1.5 *************** *** 84,93 **** s += " [="+Long.toString((long)tempF)+" Fahrenheit Degree]\n"; */ ! if (packet[2]==1){ ! s += " [MoteID="+Long.toString(packet[1])+Long.toString(packet[0])+ "]\n"; //Humidity ! s += " [Humidity Data="+Long.toString(packet[2])+"]"; //Temperature ! s += " [TempData="+Long.toString(packet[3])+ Long.toString(packet[4])+"]"; } return s; --- 84,93 ---- s += " [="+Long.toString((long)tempF)+" Fahrenheit Degree]\n"; */ ! if (packet[2]==1 && packet[5]!=1){ ! s += " [MoteID="+Long.toString(packet[10])+ "]\n"; //Humidity ! s += " [Humidity Data="+Long.toString(packet[12]*256)+Long.toString(packet[11])+"]"; //Temperature ! s += " [TempData="+Long.toString(packet[14]*256)+ Long.toString(packet[13])+"]"; } return s; |