firebug-cvs Mailing List for FireBug: wireless wildfire monitoring (Page 20)
Brought to you by:
doolin
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(36) |
Jun
(45) |
Jul
(108) |
Aug
(31) |
Sep
(2) |
Oct
(4) |
Nov
(113) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(63) |
Feb
(37) |
Mar
(24) |
Apr
(6) |
May
(5) |
Jun
(5) |
Jul
(71) |
Aug
(42) |
Sep
(7) |
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(64) |
Jun
(71) |
Jul
(51) |
Aug
(89) |
Sep
(24) |
Oct
(1) |
Nov
(1) |
Dec
(2) |
2006 |
Jan
|
Feb
|
Mar
(3) |
Apr
(2) |
May
|
Jun
|
Jul
(21) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: David M. D. <do...@us...> - 2004-03-26 00:55:42
|
Update of /cvsroot/firebug/fireboard/fireboard/apps/TestIntersema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18150/TestIntersema Modified Files: testintersema.nc testintersemaM.nc Log Message: Updated test applications for HLSensor. Index: testintersemaM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestIntersema/testintersemaM.nc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testintersemaM.nc 3 Feb 2004 19:09:54 -0000 1.3 --- testintersemaM.nc 26 Mar 2004 00:44:33 -0000 1.4 *************** *** 1,3 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ --- 1,2 ---- *************** *** 17,21 **** uses { ! interface Sensor as Intersema5534AP; interface Leds; } --- 16,20 ---- uses { ! interface HLSensor as Intersema5534AP; interface Leds; } Index: testintersema.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestIntersema/testintersema.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testintersema.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- testintersema.nc 26 Mar 2004 00:44:33 -0000 1.2 *************** *** 1,3 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** --- 1,2 ---- *************** *** 30,35 **** testintersemaM.Leds -> LedsC; ! testintersemaM.Intersema5534AP -> Intersema.Sensor; ! } --- 29,33 ---- testintersemaM.Leds -> LedsC; ! testintersemaM.Intersema5534AP -> Intersema.HLSensor; } |
From: David M. D. <do...@us...> - 2004-03-26 00:55:42
|
Update of /cvsroot/firebug/fireboard/fireboard/apps/TestTaos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18150/TestTaos Modified Files: testtaos.nc testtaosM.nc Log Message: Updated test applications for HLSensor. Index: testtaosM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestTaos/testtaosM.nc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testtaosM.nc 3 Feb 2004 19:09:54 -0000 1.3 --- testtaosM.nc 26 Mar 2004 00:44:34 -0000 1.4 *************** *** 1,4 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ - /** --- 1,2 ---- *************** *** 17,21 **** uses { ! interface Sensor as TAOS; interface Leds; } --- 15,19 ---- uses { ! interface HLSensor as TAOS; interface Leds; } *************** *** 32,35 **** --- 30,34 ---- init_debug(); call Leds.init(); + return SUCCESS; } *************** *** 37,42 **** command result_t StdControl.start() { ! call TAOS.setSamplingInterval(2500); ! call TAOS.startSampling(); return SUCCESS; } --- 36,42 ---- command result_t StdControl.start() { ! call TAOS.powerOn(TAOS_POWER_ON); ! //call TAOS.setSamplingInterval(2500); ! //call TAOS.startSampling(); return SUCCESS; } Index: testtaos.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestTaos/testtaos.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testtaos.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- testtaos.nc 26 Mar 2004 00:44:34 -0000 1.2 *************** *** 1,3 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** --- 1,3 ---- ! /** *************** *** 30,34 **** testtaosM.Leds -> LedsC; ! testtaosM.TAOS -> taos.Sensor; } --- 30,34 ---- testtaosM.Leds -> LedsC; ! testtaosM.TAOS -> taos.HLSensor; } |
From: David M. D. <do...@us...> - 2004-03-26 00:55:42
|
Update of /cvsroot/firebug/fireboard/fireboard/apps/TestADXL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18150/TestADXL Modified Files: testadxl.nc testadxlM.nc Log Message: Updated test applications for HLSensor. Index: testadxlM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestADXL/testadxlM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testadxlM.nc 3 Feb 2004 18:58:06 -0000 1.2 --- testadxlM.nc 26 Mar 2004 00:44:33 -0000 1.3 *************** *** 1,3 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** --- 1,2 ---- *************** *** 16,20 **** uses { ! interface Sensor as ADXL202JE; interface Leds; } --- 15,19 ---- uses { ! interface HLSensor as ADXL202JE; interface Leds; } Index: testadxl.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestADXL/testadxl.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testadxl.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- testadxl.nc 26 Mar 2004 00:44:33 -0000 1.2 *************** *** 1,4 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ - /** * Parts of this code were written or modified for FireBug project --- 1,2 ---- *************** *** 30,34 **** testadxlM.Leds -> LedsC; ! testadxlM.ADXL202JE -> adxl.Sensor; } --- 28,32 ---- testadxlM.Leds -> LedsC; ! testadxlM.ADXL202JE -> adxl.HLSensor; } |
From: David M. D. <do...@us...> - 2004-03-26 00:55:42
|
Update of /cvsroot/firebug/fireboard/fireboard/apps/TestSensirion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18150/TestSensirion Modified Files: testsensirion.nc testsensirionM.nc Log Message: Updated test applications for HLSensor. Index: testsensirion.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestSensirion/testsensirion.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testsensirion.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- testsensirion.nc 26 Mar 2004 00:44:33 -0000 1.2 *************** *** 1,3 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** --- 1,3 ---- ! /** *************** *** 31,35 **** testsensirionM.Leds -> LedsC; ! testsensirionM.SHT11 -> Sensirion.Sensor; } --- 31,35 ---- testsensirionM.Leds -> LedsC; ! testsensirionM.SHT11 -> Sensirion.HLSensor; } Index: testsensirionM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestSensirion/testsensirionM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testsensirionM.nc 21 Jan 2004 20:42:06 -0000 1.2 --- testsensirionM.nc 26 Mar 2004 00:44:33 -0000 1.3 *************** *** 1,3 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** --- 1,3 ---- ! /** *************** *** 16,20 **** uses { ! interface Sensor as SHT11; interface Leds; } --- 16,20 ---- uses { ! interface HLSensor as SHT11; interface Leds; } *************** *** 67,71 **** call Leds.greenToggle(); ! SODbg(DBG_USR2, "Humidity: Temp(adc): %i Humidity(adc): %i Temp(degCx10): %i Humidity(%): %i \n",tempdata,rel_humdata,(int)temp, (int)rel_hum); return SUCCESS; } --- 67,71 ---- call Leds.greenToggle(); ! SODbg(DBG_USR2, "$Humidity: Temp(adc): %i Humidity(adc): %i Temp(degCx10): %i Humidity(%): %i \r\n",tempdata,rel_humdata,(int)temp, (int)rel_hum); return SUCCESS; } |
From: David M. D. <do...@us...> - 2004-03-26 00:55:42
|
Update of /cvsroot/firebug/fireboard/fireboard/apps/TestGPS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18150/TestGPS Modified Files: testgps.nc testgpsM.nc Log Message: Updated test applications for HLSensor. Index: testgps.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestGPS/testgps.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testgps.nc 14 Jan 2004 17:20:28 -0000 1.2 --- testgps.nc 26 Mar 2004 00:44:33 -0000 1.3 *************** *** 30,34 **** testgpsM.Leds -> LedsC; ! testgpsM.LeadTek -> gps_driver.Sensor; } --- 30,34 ---- testgpsM.Leds -> LedsC; ! testgpsM.LeadTek -> gps_driver.HLSensor; } Index: testgpsM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestGPS/testgpsM.nc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** testgpsM.nc 3 Feb 2004 18:58:06 -0000 1.6 --- testgpsM.nc 26 Mar 2004 00:44:33 -0000 1.7 *************** *** 1,5 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ - - /** * Parts of this code were written or modified for FireBug project --- 1,2 ---- *************** *** 19,23 **** interface Leds; ! interface Sensor as LeadTek; } } --- 16,20 ---- interface Leds; ! interface HLSensor as LeadTek; } } *************** *** 39,47 **** command result_t StdControl.start() { ! call LeadTek.powerOn(); // Loading programs doesn't work yet. //call LeadTek.loadProgram((void*)gps_test); ! call LeadTek.loadProgram((uint8_t*)gps_syncmode_off); #if 0 --- 36,44 ---- command result_t StdControl.start() { ! call LeadTek.powerOn(LEADTEK_POWER_ON); // Loading programs doesn't work yet. //call LeadTek.loadProgram((void*)gps_test); ! call LeadTek.loadProgram((uint8_t*)vtg_disable); #if 0 *************** *** 69,73 **** ! #define RAW_DATA 0 event result_t LeadTek.dataReady(void * userdata) { --- 66,70 ---- ! #define RAW_DATA 1 event result_t LeadTek.dataReady(void * userdata) { |
From: David M. D. <do...@us...> - 2004-03-26 00:50:20
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17017/taos_tsl250rd Modified Files: TaosPhoto.nc TaosPhotoM.nc taos.nc taosM.nc taos_tsl250rd.h Log Message: Changed to HLSensor. Index: TaosPhoto.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd/TaosPhoto.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TaosPhoto.nc 3 Feb 2004 20:06:44 -0000 1.2 --- TaosPhoto.nc 26 Mar 2004 00:39:27 -0000 1.3 *************** *** 63,67 **** * Authors: Joe Polastre * - * $Id$ */ --- 63,66 ---- Index: taosM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd/taosM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** taosM.nc 22 Jan 2004 21:59:22 -0000 1.2 --- taosM.nc 26 Mar 2004 00:39:28 -0000 1.3 *************** *** 1,3 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ --- 1,2 ---- *************** *** 19,23 **** provides { interface StdControl; ! interface Sensor; } --- 18,22 ---- provides { interface StdControl; ! interface HLSensor; } *************** *** 41,45 **** uint16_t TaosData; ! uint16_t sampling_interval = 2000; taos_tsl250rd_data_msg data_msg = {0}; --- 40,44 ---- uint16_t TaosData; ! uint16_t sampling_interval;// = 2000; taos_tsl250rd_data_msg data_msg = {0}; *************** *** 58,65 **** --- 57,67 ---- command result_t StdControl.start() { + call TaosControl.start(); return SUCCESS; } command result_t StdControl.stop() { + call TaosControl.stop(); + signal HLSensor.powerOffDone(); return SUCCESS; } *************** *** 67,76 **** event result_t Timer.fired() { ! SODbg(DBG_USR2, "taosM.Timer.fired() \r\n") ; ! call TaosControl.start(); return SUCCESS; } /** * Taos- tsl2250 light sensor --- 69,82 ---- event result_t Timer.fired() { ! SODbg(DBG_USR2, "$taosM.Timer.fired() \r\n") ; return SUCCESS; } + task void signalDataready() { + + signal HLSensor.dataReady(&data_msg); + } + /** * Taos- tsl2250 light sensor *************** *** 108,112 **** atomic { if (TaosData == 0xff) { ! signal Sensor.error(0); SODbg(DBG_USR2, "Taos Ch0 data: OVERFLOW \n") ; } --- 114,118 ---- atomic { if (TaosData == 0xff) { ! signal HLSensor.error(0); SODbg(DBG_USR2, "Taos Ch0 data: OVERFLOW \n") ; } *************** *** 123,127 **** } ! signal Sensor.dataReady(&data_msg); //SODbg(DBG_USR2, "Taos Ch0 data: %i Cord: %i Step: %i ADC Counts: %i \n", TaosData & 0x0FF, CH1,ST1,ACNT0); --- 129,134 ---- } ! signal HLSensor.dataReady(&data_msg); ! //post signalDataready(); //SODbg(DBG_USR2, "Taos Ch0 data: %i Cord: %i Step: %i ADC Counts: %i \n", TaosData & 0x0FF, CH1,ST1,ACNT0); *************** *** 136,140 **** Lux = (float)ACNT0*0.46/exp(3.13*R); if (data == 0xff) { ! signal Sensor.error(0); SODbg(DBG_USR2, "Taos Ch1 data: OVERFLOW \n"); } --- 143,147 ---- Lux = (float)ACNT0*0.46/exp(3.13*R); if (data == 0xff) { ! signal HLSensor.error(0); SODbg(DBG_USR2, "Taos Ch1 data: OVERFLOW \n"); } *************** *** 149,157 **** } ! signal Sensor.dataReady(&data_msg); //SODbg(DBG_USR2, "Taos Ch1 data: %i Cord: %i Step: %i ADC Counts: %i Light(lux): %i \n", data & 0x0FF, CH1,ST1,ACNT1,(int)Lux); ! call TaosControl.stop(); return SUCCESS; } --- 156,165 ---- } ! signal HLSensor.dataReady(&data_msg); ! //post signalDataready(); //SODbg(DBG_USR2, "Taos Ch1 data: %i Cord: %i Step: %i ADC Counts: %i Light(lux): %i \n", data & 0x0FF, CH1,ST1,ACNT1,(int)Lux); ! //call TaosControl.stop(); return SUCCESS; } *************** *** 176,180 **** event result_t TaosControl.stopDone() { ! signal Sensor.powerOffDone(); return SUCCESS; } --- 184,188 ---- event result_t TaosControl.stopDone() { ! signal HLSensor.powerOffDone(); return SUCCESS; } *************** *** 182,186 **** /////////////////////////////////////////////////////////// ! command result_t Sensor.powerOn() { call TaosControl.start(); --- 190,194 ---- /////////////////////////////////////////////////////////// ! command result_t HLSensor.powerOn(uint8_t power_level) { call TaosControl.start(); *************** *** 188,210 **** } ! default event result_t Sensor.powerOnDone() { return SUCCESS; } ! command result_t Sensor.init() { return SUCCESS; } ! command result_t Sensor.powerOff() { call TaosControl.stop(); return SUCCESS; } ! default event result_t Sensor.powerOffDone() { return SUCCESS; } ! command result_t Sensor.setSamplingInterval(uint16_t interval) { atomic { --- 196,219 ---- } ! default event result_t HLSensor.powerOnDone() { return SUCCESS; } ! command result_t HLSensor.init() { return SUCCESS; } ! command result_t HLSensor.powerOff() { call TaosControl.stop(); + signal HLSensor.powerOffDone(); return SUCCESS; } ! default event result_t HLSensor.powerOffDone() { return SUCCESS; } ! command result_t HLSensor.setSamplingInterval(uint16_t interval) { atomic { *************** *** 214,244 **** } ! command result_t Sensor.getSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t Sensor.startSampling() { ! SODbg(DBG_USR2, "taosM.Sensor.startSampling() \r\n") ; call Timer.start(TIMER_REPEAT, sampling_interval); return SUCCESS; } ! command result_t Sensor.stopSampling() { return SUCCESS; } ! command result_t Sensor.sampleOnce() { return SUCCESS; } ! default event result_t Sensor.dataReady(void * userdata) { return SUCCESS; } ! default async event result_t Sensor.error(uint16_t error_code) { return SUCCESS; } ! command result_t Sensor.loadProgram(uint8_t * program) { return SUCCESS; } --- 223,254 ---- } ! command result_t HLSensor.getSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t HLSensor.startSampling() { ! SODbg(DBG_USR2, "$taosM.Sensor.startSampling() \r\n") ; ! call TaosControl.start(); call Timer.start(TIMER_REPEAT, sampling_interval); return SUCCESS; } ! command result_t HLSensor.stopSampling() { return SUCCESS; } ! command result_t HLSensor.sampleOnce() { return SUCCESS; } ! default event result_t HLSensor.dataReady(void * userdata) { return SUCCESS; } ! default async event result_t HLSensor.error(uint16_t error_code) { return SUCCESS; } ! command result_t HLSensor.loadProgram(uint8_t * program,uint8_t length) { return SUCCESS; } Index: TaosPhotoM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd/TaosPhotoM.nc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TaosPhotoM.nc 3 Feb 2004 20:06:44 -0000 1.3 --- TaosPhotoM.nc 26 Mar 2004 00:39:28 -0000 1.4 *************** *** 1,3 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /* tab:4 --- 1,3 ---- ! /* tab:4 *************** *** 65,69 **** * Authors: Joe Polastre * - * $Id$ */ --- 65,68 ---- *************** *** 97,100 **** --- 96,102 ---- norace char state; norace char tempvalue; + + result_t switch_write_result; + bool power; char data_adc; *************** *** 211,214 **** --- 213,235 ---- + task void readChannel0() { + + tempvalue = 0x43; + state = READ_0; + atomic { + switch_write_result = call I2CPacket.writePacket(1,(char*)&tempvalue,0x01); + } + } + + task void readChannel1() { + + tempvalue = 0x83; + state = READ_1; + atomic { + switch_write_result = call I2CPacket.writePacket(1,(char*)&tempvalue,0x01); + } + } + + /** * Read Taos adc data *************** *** 223,226 **** --- 244,248 ---- if (id == 0) { + /* //read channel 0 atomic { *************** *** 229,233 **** --- 251,259 ---- } return call I2CPacket.writePacket(1,(char*)&tempvalue,0x01); + */ + post readChannel0(); + } else if (id == 1) { + /* //read channel 1 atomic { *************** *** 236,240 **** --- 262,269 ---- } return call I2CPacket.writePacket(1,(char*)&tempvalue,0x01); + */ + post readChannel1(); } + return switch_write_result; } state = IDLE; Index: taos.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd/taos.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** taos.nc 22 Jan 2004 00:40:07 -0000 1.2 --- taos.nc 26 Mar 2004 00:39:28 -0000 1.3 *************** *** 1,6 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ - - - /** --- 1,2 ---- *************** *** 18,22 **** configuration taos { provides interface StdControl; ! provides interface Sensor; } --- 14,18 ---- configuration taos { provides interface StdControl; ! provides interface HLSensor; } *************** *** 24,28 **** components taosM, ! //MicaWbSwitch, TimerC, NoLeds, --- 20,24 ---- components taosM, ! MicaWbSwitch, TimerC, NoLeds, *************** *** 34,38 **** taosM.StdControl = StdControl; ! Sensor = taosM; StdControl = TimerC; --- 30,34 ---- taosM.StdControl = StdControl; ! HLSensor = taosM; StdControl = TimerC; Index: taos_tsl250rd.h =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd/taos_tsl250rd.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** taos_tsl250rd.h 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- taos_tsl250rd.h 26 Mar 2004 00:39:28 -0000 1.2 *************** *** 12,15 **** --- 12,16 ---- */ + const uint8_t TAOS_POWER_ON = 1; typedef struct _taos_tsl250rd { |
Update of /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17017/sensirion_sht11 Modified Files: Sensirion.nc SensirionHumidity.nc SensirionHumidityM.nc SensirionM.nc TempHum.nc TempHumM.nc sensirion_sht11.h Log Message: Changed to HLSensor. Index: Sensirion.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/Sensirion.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Sensirion.nc 6 Jan 2004 16:29:47 -0000 1.2 --- Sensirion.nc 26 Mar 2004 00:39:27 -0000 1.3 *************** *** 1,5 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ - - --- 1,2 ---- *************** *** 94,98 **** provides interface StdControl; ! provides interface Sensor; } --- 91,95 ---- provides interface StdControl; ! provides interface HLSensor; } *************** *** 107,111 **** SensirionM.StdControl = StdControl; ! Sensor = SensirionM; StdControl = TimerC; --- 104,108 ---- SensirionM.StdControl = StdControl; ! HLSensor = SensirionM; StdControl = TimerC; Index: sensirion_sht11.h =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/sensirion_sht11.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** sensirion_sht11.h 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- sensirion_sht11.h 26 Mar 2004 00:39:27 -0000 1.2 *************** *** 1,3 **** --- 1,5 ---- + #ifndef SENSIRION_SHT11_H + #define SENSIRION_SHT11_H /** *************** *** 13,16 **** --- 15,20 ---- + const uint8_t SENSIRION_POWER_ON = 1; + typedef struct _sht11data { *************** *** 20,21 **** --- 24,27 ---- float rel_hum; } sht11data_msg; + + #endif /* SENSIRION_SHT11_H */ Index: SensirionHumidity.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/SensirionHumidity.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SensirionHumidity.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- SensirionHumidity.nc 26 Mar 2004 00:39:27 -0000 1.2 *************** *** 5,9 **** * Authors: Joe Polastre * - * $Id$ */ --- 5,8 ---- Index: TempHum.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/TempHum.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TempHum.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- TempHum.nc 26 Mar 2004 00:39:27 -0000 1.2 *************** *** 63,67 **** * Authors: Mohammad Rahmim, Joe Polastre * - * $Id$ */ --- 63,66 ---- Index: TempHumM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/TempHumM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TempHumM.nc 21 Jan 2004 20:42:35 -0000 1.2 --- TempHumM.nc 26 Mar 2004 00:39:27 -0000 1.3 *************** *** 1,3 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /* --- 1,3 ---- ! /* *************** *** 65,69 **** * Authors: Mohammad Rahmim, Joe Polastre * - * $Id$ */ --- 65,68 ---- *************** *** 212,216 **** if(HUMIDITY_GET_DATA()) { //if SDA hi then Sensirion is not responding ! SODbg(DBG_USR2, "TempHumM.processCommand: No response from Sensirion \n"); reset(); --- 211,215 ---- if(HUMIDITY_GET_DATA()) { //if SDA hi then Sensirion is not responding ! SODbg(DBG_USR2, "TempHumM.processCommand: No response from Sensirion \n"); reset(); *************** *** 233,237 **** if ((CMD == TOSH_HUMIDITY_ADDR) && (humerror == TRUE)) { ! SODbg(DBG_USR2, "TempHumM.processCommand: cmd complete, starting timer for measurement \n"); atomic { --- 232,236 ---- if ((CMD == TOSH_HUMIDITY_ADDR) && (humerror == TRUE)) { ! SODbg(DBG_USR2, "TempHumM.processCommand: cmd complete, starting timer for measurement \n"); atomic { *************** *** 394,402 **** ! /****************************************************************************** * TOSH_SIGNAL(HUMIDITY_INTERRUPT) * -Enter here when Sensirion completes measurement * -Sensirion SDA line goes low when it completes measurement ! ******************************************************************************/ // #ifndef PLATFORM_PC TOSH_SIGNAL(HUMIDITY_INTERRUPT) { --- 393,401 ---- ! /****************************************************************************** * TOSH_SIGNAL(HUMIDITY_INTERRUPT) * -Enter here when Sensirion completes measurement * -Sensirion SDA line goes low when it completes measurement ! ******************************************************************************/ // #ifndef PLATFORM_PC TOSH_SIGNAL(HUMIDITY_INTERRUPT) { *************** *** 413,417 **** HUMIDITY_INT_DISABLE(); ! SODbg(DBG_USR2, "TempHumM.TOSH_SIGNAL(HUMIDITY INTERRUPT): measurment complete \n"); call Leds.redOff(); call Leds.yellowOff(); --- 412,416 ---- HUMIDITY_INT_DISABLE(); ! SODbg(DBG_USR2, "TempHumM.TOSH_SIGNAL(HUMIDITY INTERRUPT): measurment complete \n"); call Leds.redOff(); call Leds.yellowOff(); *************** *** 460,464 **** } ! SODbg(DBG_USR2, "TempHumM.getData: starting to get humidity data \n"); //call Leds.yellowOn(); atomic { --- 459,463 ---- } ! SODbg(DBG_USR2, "TempHumM.getData: starting to get humidity data \n"); //call Leds.yellowOn(); atomic { Index: SensirionHumidityM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/SensirionHumidityM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SensirionHumidityM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- SensirionHumidityM.nc 26 Mar 2004 00:39:27 -0000 1.2 *************** *** 1,3 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ --- 1,3 ---- ! *************** *** 6,10 **** * Authors: Joe Polastre * - * $Id$ */ --- 6,9 ---- *************** *** 172,176 **** if (id == MICAWB_HUMIDITY) { ! SODbg(DBG_USR2, "SensirionHumidityM.Timer.fired: get humidity data \n"); return call HumSensor.getData(); --- 171,175 ---- if (id == MICAWB_HUMIDITY) { ! SODbg(DBG_USR2, "SensirionHumidityM.Timer.fired: get humidity data \n"); return call HumSensor.getData(); *************** *** 251,255 **** } ! /****************************************************************************** * HumSensor.dataReady * -Data ready from humidity sensor --- 250,254 ---- } ! /****************************************************************************** * HumSensor.dataReady * -Data ready from humidity sensor *************** *** 258,262 **** async event result_t HumSensor.dataReady(uint16_t data) { ! SODbg(DBG_USR2, "SensirionHumidityM.HumSensor.dataReady: data ready \n"); atomic { --- 257,261 ---- async event result_t HumSensor.dataReady(uint16_t data) { ! //SODbg(DBG_USR2, "SensirionHumidityM.HumSensor.dataReady: data ready \n"); atomic { Index: SensirionM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/SensirionM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SensirionM.nc 21 Jan 2004 20:42:35 -0000 1.2 --- SensirionM.nc 26 Mar 2004 00:39:27 -0000 1.3 *************** *** 1,4 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ - /****************************************************************************** --- 1,2 ---- *************** *** 34,38 **** interface StdControl; ! interface Sensor; } --- 32,36 ---- interface StdControl; ! interface HLSensor; } *************** *** 108,111 **** --- 106,113 ---- + task void sensorDataready() { + + signal HLSensor.dataReady(&data_msg); + } *************** *** 139,143 **** } ! signal Sensor.dataReady(&data_msg); fTemp = 10*fTemp; --- 141,147 ---- } ! signal HLSensor.dataReady(&data_msg); ! ! //post sensorDataready(); fTemp = 10*fTemp; *************** *** 146,150 **** //call TempHumControl.stop(); ! //call Sensor.powerOff(); return SUCCESS; --- 150,154 ---- //call TempHumControl.stop(); ! //call HLSensor.powerOff(); return SUCCESS; *************** *** 189,193 **** /////////////////////////////////////////////////////////// ! command result_t Sensor.powerOn() { call StdControl.start(); --- 193,197 ---- /////////////////////////////////////////////////////////// ! command result_t HLSensor.powerOn(uint8_t power_level) { call StdControl.start(); *************** *** 196,204 **** } ! default event result_t Sensor.powerOnDone() { return SUCCESS; } ! command result_t Sensor.init() { //call StdControl.init(); --- 200,208 ---- } ! default event result_t HLSensor.powerOnDone() { return SUCCESS; } ! command result_t HLSensor.init() { //call StdControl.init(); *************** *** 207,211 **** } ! command result_t Sensor.powerOff() { SODbg(DBG_USR2, "SensirionM.Sensor.powerOff()...\n"); --- 211,215 ---- } ! command result_t HLSensor.powerOff() { SODbg(DBG_USR2, "SensirionM.Sensor.powerOff()...\n"); *************** *** 214,233 **** call TempHumControl.stop(); } ! signal Sensor.powerOffDone(); return SUCCESS; } ! default event result_t Sensor.powerOffDone() { return SUCCESS; } ! command result_t Sensor.setSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t Sensor.getSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t Sensor.startSampling() { call Timer.start(TIMER_REPEAT, 2000); --- 218,237 ---- call TempHumControl.stop(); } ! signal HLSensor.powerOffDone(); return SUCCESS; } ! default event result_t HLSensor.powerOffDone() { return SUCCESS; } ! command result_t HLSensor.setSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t HLSensor.getSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t HLSensor.startSampling() { call Timer.start(TIMER_REPEAT, 2000); *************** *** 235,255 **** } ! command result_t Sensor.stopSampling() { return SUCCESS; } ! command result_t Sensor.sampleOnce() { return SUCCESS; } ! default event result_t Sensor.dataReady(void * userdata) { return SUCCESS; } ! async default event result_t Sensor.error(uint16_t) { return SUCCESS; } ! command result_t Sensor.loadProgram(uint8_t * program) { return SUCCESS; } --- 239,259 ---- } ! command result_t HLSensor.stopSampling() { return SUCCESS; } ! command result_t HLSensor.sampleOnce() { return SUCCESS; } ! default event result_t HLSensor.dataReady(void * userdata) { return SUCCESS; } ! async default event result_t HLSensor.error(uint16_t) { return SUCCESS; } ! command result_t HLSensor.loadProgram(uint8_t * program,uint8_t length) { return SUCCESS; } |
Update of /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17017/intersema5534ap Modified Files: Intersema.nc IntersemaLower.nc IntersemaLowerM.nc IntersemaM.nc IntersemaPressure.nc IntersemaPressureM.nc intersema_5534ap.h Log Message: Changed to HLSensor. Index: IntersemaPressure.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap/IntersemaPressure.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IntersemaPressure.nc 3 Feb 2004 20:06:44 -0000 1.2 --- IntersemaPressure.nc 26 Mar 2004 00:39:27 -0000 1.3 *************** *** 63,67 **** * Authors: Joe Polastre * - * $Id$ */ --- 63,66 ---- Index: IntersemaLower.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap/IntersemaLower.nc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IntersemaLower.nc 3 Feb 2004 20:06:44 -0000 1.3 --- IntersemaLower.nc 26 Mar 2004 00:39:27 -0000 1.4 *************** *** 31,35 **** * Authors: Joe Polastre * - * $Id$ */ --- 31,34 ---- Index: IntersemaPressureM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap/IntersemaPressureM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IntersemaPressureM.nc 3 Feb 2004 20:06:44 -0000 1.2 --- IntersemaPressureM.nc 26 Mar 2004 00:39:27 -0000 1.3 *************** *** 1,3 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ --- 1,2 ---- *************** *** 6,10 **** * Authors: Joe Polastre * - * $Id$ */ --- 5,8 ---- *************** *** 74,78 **** ! /** The #define'd MICAWB_PRESSURE_* are in sensorboard.h. * iostate is IOON = 1, IOOF = 0. Somehow, this is --- 72,76 ---- ! #if 1 /** The #define'd MICAWB_PRESSURE_* are in sensorboard.h. * iostate is IOON = 1, IOOF = 0. Somehow, this is *************** *** 84,98 **** --- 82,102 ---- state = SWITCH_IO1; + atomic { call IOSwitch.set(MICAWB_PRESSURE_SCLK, iostate); } + } else if (state == SWITCH_IO1) { SODbg(DBG_USR2, "IntersemaPressure.IoBus.SCLK switch set \n"); state = SWITCH_IO2; + atomic { call IOSwitch.set(MICAWB_PRESSURE_DIN, iostate); } + } else if (state == SWITCH_IO2) { SODbg(DBG_USR2, "IntersemaPressure.IoBus.Din switch set \n"); state = SWITCH_IO3; + atomic { call IOSwitch.set(MICAWB_PRESSURE_DOUT, iostate); + } } else if (state == SWITCH_IO3) { *************** *** 120,124 **** } ! command result_t SplitControl.init() { --- 124,128 ---- } ! #endif command result_t SplitControl.init() { *************** *** 234,237 **** --- 238,245 ---- + task void startLowerTemp() { + call LowerControl.start(); + call LowerTemp.getData(); + } /****************************************************************************** *************** *** 242,247 **** { state = BUSY; ! call LowerControl.start(); ! call LowerTemp.getData(); return SUCCESS; } --- 250,257 ---- { state = BUSY; ! ! //call LowerControl.start(); ! //call LowerTemp.getData(); ! post startLowerTemp(); return SUCCESS; } *************** *** 258,261 **** --- 268,278 ---- } + + task void startLowerPressure() { + + call LowerControl.start(); + call LowerPressure.getData(); + } + async command result_t Pressure.getData() { *************** *** 267,272 **** iostate = IOON; } ! call LowerControl.start(); ! call LowerPressure.getData(); return SUCCESS; } --- 284,290 ---- iostate = IOON; } ! //call LowerControl.start(); ! //call LowerPressure.getData(); ! post startLowerPressure(); return SUCCESS; } *************** *** 340,344 **** } - } --- 358,361 ---- Index: IntersemaM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap/IntersemaM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IntersemaM.nc 22 Jan 2004 00:40:06 -0000 1.2 --- IntersemaM.nc 26 Mar 2004 00:39:27 -0000 1.3 *************** *** 1,3 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ --- 1,3 ---- ! *************** *** 38,42 **** provides { interface StdControl; ! interface Sensor; } --- 38,42 ---- provides { interface StdControl; ! interface HLSensor; } *************** *** 105,108 **** --- 105,114 ---- } + task void signalDataReady() { + + signal HLSensor.dataReady(&data_msg); + } + + /****************************************************************************** * Intersema MS5534A barometric pressure/temperature sensor *************** *** 141,145 **** data_msg.baro_pres = Press; ! signal Sensor.dataReady(&data_msg); SODbg(DBG_USR2, "Pressure: Temp(adc): %i Press(adc): %i Temp(degCx10): %i Press(mbar): %i \n", --- 147,151 ---- data_msg.baro_pres = Press; ! post signalDataReady(); SODbg(DBG_USR2, "Pressure: Temp(adc): %i Press(adc): %i Temp(degCx10): %i Press(mbar): %i \n", *************** *** 206,262 **** } /////////////////////////////////////////////////////////// ! command result_t Sensor.powerOn() { call PressureControl.start(); return SUCCESS; } ! default event result_t Sensor.powerOnDone() { return SUCCESS; } ! command result_t Sensor.init() { call PressureControl.init(); return SUCCESS; } ! command result_t Sensor.powerOff() { ! signal Sensor.powerOffDone(); return SUCCESS; } ! default event result_t Sensor.powerOffDone() { return SUCCESS; } ! command result_t Sensor.setSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t Sensor.getSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t Sensor.startSampling() { call Timer.start(TIMER_REPEAT, 1500); return SUCCESS; } ! command result_t Sensor.stopSampling() { return SUCCESS; } ! command result_t Sensor.sampleOnce() { return SUCCESS; } ! default event result_t Sensor.dataReady(void * userdata) { return SUCCESS; } ! command result_t Sensor.loadProgram(uint8_t * program) { return SUCCESS; } ! async default event result_t Sensor.error(uint16_t error_code) { return SUCCESS; } --- 212,268 ---- } /////////////////////////////////////////////////////////// ! command result_t HLSensor.powerOn(uint8_t power_level) { call PressureControl.start(); return SUCCESS; } ! default event result_t HLSensor.powerOnDone() { return SUCCESS; } ! command result_t HLSensor.init() { call PressureControl.init(); return SUCCESS; } ! command result_t HLSensor.powerOff() { ! signal HLSensor.powerOffDone(); return SUCCESS; } ! default event result_t HLSensor.powerOffDone() { return SUCCESS; } ! command result_t HLSensor.setSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t HLSensor.getSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t HLSensor.startSampling() { call Timer.start(TIMER_REPEAT, 1500); return SUCCESS; } ! command result_t HLSensor.stopSampling() { return SUCCESS; } ! command result_t HLSensor.sampleOnce() { return SUCCESS; } ! default event result_t HLSensor.dataReady(void * userdata) { return SUCCESS; } ! command result_t HLSensor.loadProgram(uint8_t * program,uint8_t length) { return SUCCESS; } ! async default event result_t HLSensor.error(uint16_t error_code) { return SUCCESS; } Index: Intersema.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap/Intersema.nc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Intersema.nc 22 Jan 2004 00:40:06 -0000 1.3 --- Intersema.nc 26 Mar 2004 00:39:27 -0000 1.4 *************** *** 1,3 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ --- 1,3 ---- ! *************** *** 70,74 **** provides { interface StdControl; ! interface Sensor; } } --- 70,74 ---- provides { interface StdControl; ! interface HLSensor; } } *************** *** 84,88 **** IntersemaM.StdControl = StdControl; ! Sensor = IntersemaM; StdControl = TimerC; --- 84,88 ---- IntersemaM.StdControl = StdControl; ! HLSensor = IntersemaM; StdControl = TimerC; Index: IntersemaLowerM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap/IntersemaLowerM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IntersemaLowerM.nc 3 Feb 2004 20:06:44 -0000 1.2 --- IntersemaLowerM.nc 26 Mar 2004 00:39:27 -0000 1.3 *************** *** 1,5 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ - - /* tab:4 * --- 1,2 ---- *************** *** 66,70 **** * Authors: Joe Polastre * - * $Id$ */ --- 63,66 ---- *************** *** 90,96 **** enum { IDLE=7, RESET=8, CALIBRATE=9, TEMP=10, PRESSURE=11, DATA_READY=12 }; ! //FIXME: Remove the norace and fix the rest of the atomic r/w warnings norace char state; ! norace char sensor; uint16_t calibration[4]; --- 86,92 ---- enum { IDLE=7, RESET=8, CALIBRATE=9, TEMP=10, PRESSURE=11, DATA_READY=12 }; ! norace char state; ! char sensor; uint16_t calibration[4]; *************** *** 239,242 **** --- 235,240 ---- write_bit(TRUE); } + + atomic { if (sensor == PRESSURE) { write_bit(TRUE); *************** *** 251,254 **** --- 249,254 ---- write_bit(TRUE); } + } + for (i = 0; i < 5; i++) { write_bit(FALSE); *************** *** 273,276 **** --- 273,277 ---- if (timeout > PRESSURE_TIMEOUT_TRIES) { + atomic { if ((sensor == PRESSURE) && (presserror == TRUE)) { errornum = 1; *************** *** 278,282 **** state = IDLE; post signalPressError(); ! return SUCCESS; } else if ((sensor == TEMP) && (temperror == TRUE)) { --- 279,283 ---- state = IDLE; post signalPressError(); ! //return SUCCESS; } else if ((sensor == TEMP) && (temperror == TRUE)) { *************** *** 285,292 **** state = IDLE; post signalTempError(); return SUCCESS; } - - } call Timer.start(TIMER_ONE_SHOT, 20); } --- 286,294 ---- state = IDLE; post signalTempError(); + //return SUCCESS; + } + } return SUCCESS; } call Timer.start(TIMER_ONE_SHOT, 20); } *************** *** 302,305 **** --- 304,309 ---- } + + task void SPITask() { char i; *************** *** 308,311 **** --- 312,316 ---- // if calibration is on, grab the calibration data + atomic { if (sensor == CALIBRATE) { *************** *** 320,328 **** // send the calibration data up to the application ! for (i = 0; i < 4; i++) signal Calibration.dataReady(i+1, calibration[(int)i]); - return; } ! else { // reset the device spi_reset(); --- 325,333 ---- // send the calibration data up to the application ! for (i = 0; i < 4; i++) { signal Calibration.dataReady(i+1, calibration[(int)i]); } ! //return; ! } else { // reset the device spi_reset(); *************** *** 333,336 **** --- 338,344 ---- } } + } + + command result_t StdControl.init() { *************** *** 393,397 **** --- 401,407 ---- if (state == IDLE) { state = RESET; + atomic { sensor = TEMP; + } post SPITask(); return SUCCESS; Index: intersema_5534ap.h =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap/intersema_5534ap.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** intersema_5534ap.h 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- intersema_5534ap.h 26 Mar 2004 00:39:27 -0000 1.2 *************** *** 13,16 **** --- 13,17 ---- */ + const uint8_t INTERSEMA_POWER_ON = 1; typedef struct _intersema5534ap_data_msg { |
From: David M. D. <do...@us...> - 2004-03-26 00:50:19
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17017/leadtek9546 Modified Files: gps_driver.nc gps_driverM.nc leadtek_9546.c leadtek_9546.h Log Message: Changed to HLSensor. Index: leadtek_9546.h =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/leadtek_9546.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** leadtek_9546.h 3 Feb 2004 20:06:44 -0000 1.5 --- leadtek_9546.h 26 Mar 2004 00:39:27 -0000 1.6 *************** *** 63,67 **** * Authors: * - * $Id$ */ --- 63,66 ---- *************** *** 81,84 **** --- 80,86 ---- #define LEADTEK_9546_H + const uint8_t LEADTEK_POWER_ON = 1; + + // The actual values for each of these may vary, // especially characters per field, which may be *************** *** 102,106 **** #define NMEA_END2 "\n" //0x0A //ultimate byte of NMEA string - #define NMEA_GSV_MASK "0x0001" #define NMEA_GSA_MASK "0x0002" --- 104,107 ---- *************** *** 139,146 **** const uint8_t gps_syncmode_off[] = {" ""$LTC,SYNCMODE,0*6F" NMEA_END1 NMEA_END2}; ! const uint8_t gps_test[] = {" ""$LTC,1552,1*69" NMEA_END1 NMEA_END2}; ! const uint8_t gps_test1[] = {" ""$LTC,1551,3,4*70" NMEA_END1 NMEA_END2}; ! typedef struct _gga_msg GGA_Msg; typedef struct _gps_msg GPS_Msg; --- 140,150 ---- const uint8_t gps_syncmode_off[] = {" ""$LTC,SYNCMODE,0*6F" NMEA_END1 NMEA_END2}; ! const uint8_t gps_test[] = {" ""$LTC,1552,1*69" NMEA_END1 NMEA_END2}; ! const uint8_t gps_test1[] = {" ""$LTC,1551,3,4*70" NMEA_END1 NMEA_END2}; ! ! const uint8_t vtg_disable[] = {" ""$PSRF103,05,00,00,01*21" NMEA_END1 NMEA_END2}; ! ! //typedef struct _gga_msg GGA_Msg; typedef struct _gps_msg GPS_Msg; *************** *** 159,164 **** // 18 bytes. ! struct _gga_msg { uint8_t hours; uint8_t minutes; --- 163,169 ---- // 18 bytes. ! typedef struct GGAMsg { + uint16_t mote_id; uint8_t hours; uint8_t minutes; *************** *** 170,175 **** uint8_t NSEWind; uint8_t num_sats; ! }; #endif /* LEADTEK_9546_H */ --- 175,184 ---- uint8_t NSEWind; uint8_t num_sats; ! } GGAMsg; ! + enum { + AM_GGAMSG = 129 + }; #endif /* LEADTEK_9546_H */ Index: leadtek_9546.c =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/leadtek_9546.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** leadtek_9546.c 29 Jan 2004 14:53:36 -0000 1.1 --- leadtek_9546.c 26 Mar 2004 00:39:27 -0000 1.2 *************** *** 22,25 **** --- 22,40 ---- } + + unsigned char + leadtek_crc(char * message, int size) { + + unsigned char cs = 0; + int index = 1; + + while (message[index] != '*') { + + cs = cs ^ message[index++]; + } + + return cs; + } + int main(int argc, char ** argv) { *************** *** 28,31 **** --- 43,55 ---- char data2[] = {"$GPGGA,023129.762,3754.1755,N,12218.2682,W,1,08,1.1,-19.4,M,,,,0000"}; + + /////////////////////// Leadtek stuff + char vtg_enable_1_Hz[] = {"$PSRF103,05,00,01,01*"}; + char vtg_disable[] = {"$PSRF103,05,00,00,01*"}; + char gga_query_cs[] = {"$PSRF103,00,01,00,01*"}; + char debug_on[] ={"$PSRF105,1*"}; + char debug_off[] ={"$PSRF105,0*"}; + + ///////////////////////////// const uint8_t gps_gga_mask_crc[] = {"$LTC,NMEA," NMEA_GGA_MASK}; const uint8_t gps_rmc_mask_crc[] = {"$LTC,NMEA," NMEA_RMC_MASK}; *************** *** 39,45 **** --- 63,76 ---- printf("string: %s, crc: %x\n",data2,crc(data2,strlen(data2))); + printf("string: %s, crc: %x\n",gps_syncmode_off_crc,crc(gps_syncmode_off_crc,strlen(gps_syncmode_off_crc))); printf("string: %s, crc: %x\n",gps_test_crc,crc(gps_test_crc,strlen(gps_test_crc))); + printf("vtg_enable_1_Hz: %s cs: %x\n",vtg_enable_1_Hz,leadtek_crc(vtg_enable_1_Hz,strlen(vtg_enable_1_Hz))); + printf("vtg_disable: %s cs: %x\n",vtg_disable,leadtek_crc(vtg_disable,strlen(vtg_disable))); + printf("gga_query_cs: %s cs: %x\n",gga_query_cs,leadtek_crc(gga_query_cs,strlen(gga_query_cs))); + printf("debug_on: %s cs: %x\n",debug_on,leadtek_crc(debug_on,strlen(debug_on))); + printf("debug_off: %s cs: %x\n",debug_off,leadtek_crc(debug_off,strlen(debug_off))); + return 0; Index: gps_driverM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/gps_driverM.nc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gps_driverM.nc 3 Feb 2004 20:06:44 -0000 1.8 --- gps_driverM.nc 26 Mar 2004 00:39:27 -0000 1.9 *************** *** 1,5 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ - - /** * Parts of this code were written or modified for FireBug project --- 1,2 ---- *************** *** 19,23 **** interface StdControl; ! interface Sensor; command void readGps(); --- 16,20 ---- interface StdControl; ! interface HLSensor; command void readGps(); *************** *** 43,47 **** command result_t load_gga_struct(char gga_fields[GGA_FIELDS][GPS_CHAR_PER_FIELD]); ! command result_t log_gga_data_to_eeprom(GGA_Msg * pGGA); } --- 40,44 ---- command result_t load_gga_struct(char gga_fields[GGA_FIELDS][GPS_CHAR_PER_FIELD]); ! command result_t log_gga_data_to_eeprom(GGAMsg * pGGA); } *************** *** 70,74 **** uint8_t gps_state; ! GGA_Msg gga_msg = {0}; /** This is essentially thread safe, because once it is --- 67,71 ---- uint8_t gps_state; ! GGAMsg gga_msg = {0}; /** This is essentially thread safe, because once it is *************** *** 84,88 **** command result_t StdControl.init() { ! init_debug(); call Leds.init(); /** Control.init in GpsPacket.nc */ --- 81,85 ---- command result_t StdControl.init() { ! //init_debug(); call Leds.init(); /** Control.init in GpsPacket.nc */ *************** *** 185,189 **** ! command result_t log_gga_data_to_eeprom(GGA_Msg * pGGA) { #if 0 --- 182,186 ---- ! command result_t log_gga_data_to_eeprom(GGAMsg * pGGA) { #if 0 *************** *** 246,261 **** GPS_MsgPtr gps_data = (GPS_MsgPtr)data; ! signal Sensor.dataReady(gps_data); ! #if 0 if ((call isGGA(gps_data->data))) { call parse_gga(gps_data); ! //if (have_gps_fix) { ! //signal Sensor.dataReady(gps_data); ! call spew_to_uart(gps_data); ! signal Sensor.dataReady(&gga_msg); ! //} } #endif --- 243,258 ---- GPS_MsgPtr gps_data = (GPS_MsgPtr)data; ! #if DBG_USR2 ! signal HLSensor.dataReady(gps_data); ! #else if ((call isGGA(gps_data->data))) { call parse_gga(gps_data); ! if (have_gps_fix) { ! //call spew_to_uart(gps_data); ! signal HLSensor.dataReady(&gga_msg); ! } } #endif *************** *** 436,446 **** /////////////////////////////////////////////////////////// ! command result_t Sensor.init() { ! //SODbg(DBG_USR2, "gps_driverM.Sensor.init()\n"); return SUCCESS; } ! command result_t Sensor.powerOn() { //SODbg(DBG_USR2, "gps_driverM.Sensor.powerOn()\n"); --- 433,443 ---- /////////////////////////////////////////////////////////// ! command result_t HLSensor.init() { ! //SODbg(DBG_USR2, "gps_driverM.HLSensor.init()\n"); return SUCCESS; } ! command result_t HLSensor.powerOn(uint8_t power_level) { //SODbg(DBG_USR2, "gps_driverM.Sensor.powerOn()\n"); *************** *** 450,458 **** } ! default event result_t Sensor.powerOnDone() { return SUCCESS; } ! command result_t Sensor.powerOff() { //call stopGps(); --- 447,455 ---- } ! default event result_t HLSensor.powerOnDone() { return SUCCESS; } ! command result_t HLSensor.powerOff() { //call stopGps(); *************** *** 463,471 **** } have_gps_fix = 0; ! signal Sensor.powerOffDone(); return SUCCESS; } ! default event result_t Sensor.powerOffDone() { return SUCCESS; } --- 460,468 ---- } have_gps_fix = 0; ! signal HLSensor.powerOffDone(); return SUCCESS; } ! default event result_t HLSensor.powerOffDone() { return SUCCESS; } *************** *** 474,478 **** * NMEA string. */ ! command result_t Sensor.setSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } --- 471,475 ---- * NMEA string. */ ! command result_t HLSensor.setSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } *************** *** 481,501 **** * NMEA string. */ ! command result_t Sensor.getSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t Sensor.startSampling() { return SUCCESS; } ! command result_t Sensor.stopSampling() { return SUCCESS; } ! command result_t Sensor.sampleOnce() { return SUCCESS; } ! default event result_t Sensor.dataReady(void * userdata) { return SUCCESS; } --- 478,498 ---- * NMEA string. */ ! command result_t HLSensor.getSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t HLSensor.startSampling() { return SUCCESS; } ! command result_t HLSensor.stopSampling() { return SUCCESS; } ! command result_t HLSensor.sampleOnce() { return SUCCESS; } ! default event result_t HLSensor.dataReady(void * userdata) { return SUCCESS; } *************** *** 508,512 **** * the UART and loading into the LeadTek. */ ! command result_t Sensor.loadProgram(uint8_t * program) { TOS_Msg msg = {0}; --- 505,509 ---- * the UART and loading into the LeadTek. */ ! command result_t HLSensor.loadProgram(uint8_t * program, uint8_t length) { TOS_Msg msg = {0}; *************** *** 520,524 **** ! signal Sensor.dataReady((void*)program); return call GpsSend.send(&msg); --- 517,521 ---- ! signal HLSensor.dataReady((void*)program); return call GpsSend.send(&msg); *************** *** 531,535 **** * and signaled. */ ! async default event result_t Sensor.error(uint16_t error_code) { return SUCCESS; } --- 528,532 ---- * and signaled. */ ! async default event result_t HLSensor.error(uint16_t error_code) { return SUCCESS; } Index: gps_driver.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/gps_driver.nc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gps_driver.nc 3 Feb 2004 20:06:44 -0000 1.6 --- gps_driver.nc 26 Mar 2004 00:39:27 -0000 1.7 *************** *** 1,3 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** --- 1,2 ---- *************** *** 44,48 **** interface StdControl; ! interface Sensor; } } --- 43,47 ---- interface StdControl; ! interface HLSensor; } } *************** *** 57,61 **** gps_driverM.StdControl = StdControl; ! Sensor = gps_driverM; StdControl = MicaWbSwitch; --- 56,60 ---- gps_driverM.StdControl = StdControl; ! HLSensor = gps_driverM; StdControl = MicaWbSwitch; |
From: David M. D. <do...@us...> - 2004-03-26 00:50:18
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/adxl202je In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17017/adxl202je Modified Files: adxl.nc adxl202je.h adxlM.nc Log Message: Changed to HLSensor. Index: adxlM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/adxl202je/adxlM.nc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** adxlM.nc 3 Feb 2004 20:06:44 -0000 1.3 --- adxlM.nc 26 Mar 2004 00:39:26 -0000 1.4 *************** *** 1,3 **** ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** --- 1,3 ---- ! /** *************** *** 34,38 **** provides { interface StdControl; ! interface Sensor; } --- 34,38 ---- provides { interface StdControl; ! interface HLSensor; } *************** *** 127,131 **** data_msg.ydata = ydata; } ! signal Sensor.dataReady(&data_msg); call AccelCmd.PowerSwitch(ACCEL_POWER_OFF); --- 127,131 ---- data_msg.ydata = ydata; } ! signal HLSensor.dataReady(&data_msg); call AccelCmd.PowerSwitch(ACCEL_POWER_OFF); *************** *** 152,203 **** } /////////////////////////////////////////////////////////// ! command result_t Sensor.powerOn() { return SUCCESS; } ! default event result_t Sensor.powerOnDone() { return SUCCESS; } ! command result_t Sensor.init() { return SUCCESS; } ! command result_t Sensor.powerOff() { return SUCCESS; } ! default event result_t Sensor.powerOffDone() { return SUCCESS; } ! command result_t Sensor.setSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t Sensor.getSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t Sensor.startSampling() { return SUCCESS; } ! command result_t Sensor.stopSampling() { return SUCCESS; } ! command result_t Sensor.sampleOnce() { return SUCCESS; } ! default event result_t Sensor.dataReady(void * userdata) { return SUCCESS; } ! async default event result_t Sensor.error(uint16_t) { return SUCCESS; } ! command result_t Sensor.loadProgram(uint8_t * program) { return SUCCESS; } --- 152,203 ---- } /////////////////////////////////////////////////////////// ! command result_t HLSensor.powerOn(uint8_t power_level) { return SUCCESS; } ! default event result_t HLSensor.powerOnDone() { return SUCCESS; } ! command result_t HLSensor.init() { return SUCCESS; } ! command result_t HLSensor.powerOff() { return SUCCESS; } ! default event result_t HLSensor.powerOffDone() { return SUCCESS; } ! command result_t HLSensor.setSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t HLSensor.getSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } ! command result_t HLSensor.startSampling() { return SUCCESS; } ! command result_t HLSensor.stopSampling() { return SUCCESS; } ! command result_t HLSensor.sampleOnce() { return SUCCESS; } ! default event result_t HLSensor.dataReady(void * userdata) { return SUCCESS; } ! async default event result_t HLSensor.error(uint16_t) { return SUCCESS; } ! command result_t HLSensor.loadProgram(uint8_t * program, uint8_t length) { return SUCCESS; } Index: adxl.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/adxl202je/adxl.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** adxl.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- adxl.nc 26 Mar 2004 00:39:26 -0000 1.2 *************** *** 1,4 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ - /** --- 1,2 ---- *************** *** 19,23 **** provides { interface StdControl; ! interface Sensor; } } --- 17,21 ---- provides { interface StdControl; ! interface HLSensor; } } *************** *** 37,41 **** adxlM.StdControl = StdControl; ! Sensor = adxlM; StdControl = TimerC; --- 35,39 ---- adxlM.StdControl = StdControl; ! HLSensor = adxlM; StdControl = TimerC; Index: adxl202je.h =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/adxl202je/adxl202je.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** adxl202je.h 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- adxl202je.h 26 Mar 2004 00:39:26 -0000 1.2 *************** *** 15,20 **** * @author David. M. Doolin */ ! ! typedef struct _adxl202je_data { --- 15,20 ---- * @author David. M. Doolin */ ! const uint8_t ADXL202JE_POWER_OFF = 0; ! const uint8_t ADXL202JE_POWER_ON = 1; typedef struct _adxl202je_data { |
From: David M. D. <do...@us...> - 2004-03-26 00:50:18
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/adg715 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17017/adg715 Modified Files: MicaWbSwitch.nc MicaWbSwitchM.nc Switch.nc Log Message: Changed to HLSensor. Index: Switch.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/adg715/Switch.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Switch.nc 3 Feb 2004 19:27:51 -0000 1.2 --- Switch.nc 26 Mar 2004 00:39:26 -0000 1.3 *************** *** 31,40 **** * Authors: Joe Polastre * - * $Id$ */ interface Switch { command result_t get(); ! command result_t set(char position, char value); command result_t setAll(char value); --- 31,39 ---- * Authors: Joe Polastre * */ interface Switch { command result_t get(); ! async command result_t set(char position, char value); command result_t setAll(char value); Index: MicaWbSwitchM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/adg715/MicaWbSwitchM.nc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MicaWbSwitchM.nc 3 Feb 2004 19:27:51 -0000 1.3 --- MicaWbSwitchM.nc 26 Mar 2004 00:39:26 -0000 1.4 *************** *** 31,35 **** * Authors: Joe Polastre * - * $Id$ */ --- 31,34 ---- *************** *** 53,60 **** char sw_state; /* current state of the switch */ ! char state; /* current state of the i2c request */ char addr; /* destination address */ ! char position; ! char value; command result_t StdControl.init() { --- 52,60 ---- char sw_state; /* current state of the switch */ ! // FIXME: remove the norace ! norace char state; /* current state of the i2c request */ char addr; /* destination address */ ! norace char position; ! norace char value; command result_t StdControl.init() { *************** *** 84,88 **** } ! command result_t Switch.set[uint8_t id](char l_position, char l_value) { if (state == IDLE) { --- 84,88 ---- } ! async command result_t Switch.set[uint8_t id](char l_position, char l_value) { if (state == IDLE) { Index: MicaWbSwitch.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/adg715/MicaWbSwitch.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MicaWbSwitch.nc 3 Feb 2004 19:27:51 -0000 1.2 --- MicaWbSwitch.nc 26 Mar 2004 00:39:26 -0000 1.3 *************** *** 31,35 **** * Authors: Joe Polastre * - * $Id$ */ --- 31,34 ---- |
From: David M. D. <do...@us...> - 2004-03-26 00:49:19
|
Update of /cvsroot/firebug/fireboard/fireboard/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16669 Modified Files: ADCError.nc Data.nc Added Files: HLSensor.nc Log Message: Added HLSensor, removed Sensor. Index: Data.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/interfaces/Data.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Data.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- Data.nc 26 Mar 2004 00:38:27 -0000 1.2 *************** *** 24,30 **** */ ! /** ! * $Id$ ! */ /** --- 24,28 ---- */ ! /** Index: ADCError.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/interfaces/ADCError.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ADCError.nc 3 Feb 2004 19:16:29 -0000 1.1 --- ADCError.nc 26 Mar 2004 00:38:16 -0000 1.2 *************** *** 63,67 **** * Authors: Joe Polastre * - * $Id$ * */ --- 63,66 ---- --- NEW FILE: HLSensor.nc --- /** * "Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * */ /** */ /** * Parts of this code were written or modified for FireBug project * funded by the NSF Information Technology Research * initiative. Copyright Regents of the University of * of California, 2003. * * @author David. M. Doolin */ /** * A standard interface for Sensors driven by TinyOS * programs. Sensors come with a wide variety of * capabilities, and this interface is designed to * allow the programmer to wire a sensor without * worrying about whether it needs UART, I2C, ADC * or whatever capabilities. * * The interface reflects the mechanical operation * of the sensor, thus powering on a sensor need not * result in immediate sampling. * * @author David M. Doolin */ interface HLSensor { /** * Turn on the power, but do not collect data. If the * sensor provides data given power, this command should * set a state where that data is only fired back through * dataReady when the user is ready for it. Any system * bus, I/O state, whatever should be left in a consistent * state. Implementation should be idempotent. * * @return Whether powering on was successful. */ /* Note: All the calls for power handling mirror a future * PowerControl interface, when the details have been * worked out. At that point all the power handling can * be removed from this interface. */ command result_t powerOn(uint8_t power_level); /** * Notify components that the component has been started * and is ready to receive other commands. Implementation * should be idempotent. */ event result_t powerOnDone(); /** init() might be used to send a default * programming string to the sensor. */ command result_t init(); /** * Stop the component cleanly, without leaving * the system in an inconsistent state. * * @return Whether stopping was successful. */ command result_t powerOff(); /** * Notify components that the component has been stopped. */ event result_t powerOffDone(); command result_t setSamplingInterval(uint16_t sampling_rate); command result_t getSamplingInterval(uint16_t sampling_rate); /** startSampling puts the sensor into a state such that * the dataReady event will fire when data is ready to * to be collected from the sensor. */ command result_t startSampling(); /** Stop the sensor from sampling. */ command result_t stopSampling(); /** This is for collecting a single sample from * sensor. It should leave whatever state the sensor is * in unchanged. It should not be used in conjunction * with startSampling(). */ command result_t sampleOnce(); /** dataReady is where the main action is; * the entire system exists to support what * happens here. */ event result_t dataReady(void * userdata); /** Some sensors, for example the Leadtek 9546 used on * the Crossbow MTS420CA, are programmable. It isn't * practical to define one interface to handle * programming for arbitrary sensors, but any of the * sensors that can be programmed should have the * capability to read from some sort of I/O, which * an implementation of this command should encapsulate. */ command result_t loadProgram(uint8_t * program, uint8_t length); /** Error codes for individual sensors should go into the * header file for that sensor. 16 bits should be enough * to extract an upper 8 bits for errors and a lower 8 * bits for other sensor dependent stuff, perhaps channel ID * something. Extraction code could be written as macros in * the sensor header file. */ async event result_t error(uint16_t error_code); } |
From: <do...@us...> - 2004-03-13 05:17:46
|
Update of /cvsroot/firebug/firebug/web/demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5755/demo Modified Files: index.html results.php test.gnu Log Message: plotting now more or less works. Index: index.html =================================================================== RCS file: /cvsroot/firebug/firebug/web/demo/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.html 16 Feb 2004 02:03:16 -0000 1.1 --- index.html 13 Mar 2004 05:09:02 -0000 1.2 *************** *** 21,25 **** be unix compatible.</li> <li>Make sure that all the file permissions allow ! writing the image file.</li> <li>Check to make sure that the database permissions --- 21,29 ---- be unix compatible.</li> <li>Make sure that all the file permissions allow ! writing the image file. On camshaft, this was ! accomplished by chgrp -R SYSTEM demo; chmod -R 775 demo. ! This is probably more access than is wise, but ! suffices for demo purposes. ! </li> <li>Check to make sure that the database permissions *************** *** 34,38 **** <!-- Created: Sun Feb 15 08:22:46 Pacific Standard Time 2004 --> <!-- hhmts start --> ! Last modified: Sun Feb 15 08:28:18 Pacific Standard Time 2004 <!-- hhmts end --> </body> --- 38,42 ---- <!-- Created: Sun Feb 15 08:22:46 Pacific Standard Time 2004 --> <!-- hhmts start --> ! Last modified: Fri Mar 12 09:47:59 Pacific Standard Time 2004 <!-- hhmts end --> </body> Index: results.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/demo/results.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** results.php 15 Feb 2004 15:16:14 -0000 1.1 --- results.php 13 Mar 2004 05:09:02 -0000 1.2 *************** *** 11,38 **** <body> <h1>Demonstration monitoring</h1> <?php ! /* ! if (!file_exists("/tmp/tempdata")) { ! echo "Creating /tmp/tempdata...<p>"; ! mkdir ("/tmp/tempdata",0755); } ! */ // This stuff doesn't work yet, but would be ! // be a better way to do this. ! $command = "echo -e 'set term png\n"; $command .= "set size 0.4\n"; ! $command .= "plot \"test2.dat\"\n'"; $command .= "| C:/gp373w32/pgnuplot.exe > test.png"; //echo $command; // System call ! `"C:/gp373w32/pgnuplot.exe < ./test.gnu"`; // This would be preferable, but doesn't seem to work. ! //passthru($command); --- 11,124 ---- <body> + + <h1>Demonstration monitoring</h1> <?php ! /** ! * Lots of broken code in here, mostly related to the ! * system() function. The workaround is not pretty, ! * the strings will need to be handled using lots of ! * small functions. ! */ ! ! mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); ! ! $statement = "use gpsradio"; ! mysql_query($statement) or die("Error: ".mysql_error()." changing databases"); ! ! $statement = "select lat_dec_min from location where lat_deg = 37"; ! $result = mysql_query($statement) or die("Error: ".mysql_error()." in select statement"); ! ! ! if (!$ofp=fopen("test.dat","w")) { ! echo "Unable to open data output file for writing.\n"; } ! ! if(!chmod ("test.dat", 0775)) { ! echo "chmod failed\n"; ! } ! ! function print_row($item2,$key) { ! fwrite($ofp,$item2); ! } ! ! if ($row = mysql_fetch_row($result)) { ! ! // for each row ! do { ! // For each column... ! $row = array_values($row); ! // This is no good for multiple columns. ! fwrite($ofp,$row[0]."\n"); ! } while ($row = mysql_fetch_row($result)); ! } ! fclose($ofp); ! ! // This stuff doesn't work yet, but would be ! // be a better way to do this. Move all this ! // kind of stuff into dedicated functions. ! //$command = "echo -e 'set term png\n"; ! $command = "'set term png\n"; $command .= "set size 0.4\n"; ! //$command .= "plot \"test2.dat\"\n'"; ! $command .= "plot \"test.dat\"\n'"; ! //$command .= "| C:/gp373w32/pgnuplot.exe > test.png"; $command .= "| C:/gp373w32/pgnuplot.exe > test.png"; + //$plotcommand = "echo -e 'set term png\n"; + $plotcommand = "'set term png\n"; + $plotcommand .= "set size 0.4\n"; + $plotcommand .= "set output \"test.png\"\n"; + $plotcommand .= "plot \"test.dat\" with lines 2'"; + + $plotstring = "set term png\n"; + $plotstring .= "set size 0.4\n"; + $plotstring .= "set output \"test.png\"\n"; + $plotstring .= "plot \"test.dat\" with lines 2"; + + + $gnuplot = " | C:\\gp373w32\\pgnuplot.exe"; + //echo $command; // System call ! $systemcall = $plotcommand; ! $systemcall .= $gnuplot; ! ! $gnufile = "test2.gnu"; ! //$ofp = fopen("test1.gnu","w"); ! $ofp = fopen($gnufile,"w"); ! fwrite($ofp,$plotstring); ! fclose($ofp); + //system("C:\\gp373w32\\pgnuplot.exe < ./test1.gnu"); + //Try the redirect going the other way with an output file name. + system("C:\\gp373w32\\pgnuplot.exe < ./$gnufile"); // > $outfile.png + + /* + print("<pre>"); + print($plotcommand.$gnuplot); + print("</pre>"); + */ + //This doesn't work either. + //`$plotcommand.$gnuplot`; + + /* + $systemcall = $plotcommand; + $systemcall .= $gnuplot; + $e = escapeshellcmd($systemcall); // This would be preferable, but doesn't seem to work. ! if(system("echo -e $systemcall",$error)) { ! echo "System call succeeded\n"; ! } else { ! echo "System call failed with error $error\n"; ! } ! print("<pre>"); ! print($e); ! print("</pre>"); ! */ Index: test.gnu =================================================================== RCS file: /cvsroot/firebug/firebug/web/demo/test.gnu,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test.gnu 15 Feb 2004 15:16:14 -0000 1.1 --- test.gnu 13 Mar 2004 05:09:02 -0000 1.2 *************** *** 3,5 **** set size 0.4 set output "test.png" ! plot "testdata.dat" using 2 with line 1 \ No newline at end of file --- 3,5 ---- set size 0.4 set output "test.png" ! plot "test.dat" using 1 with line 1 \ No newline at end of file |
From: <do...@us...> - 2004-03-12 00:12:42
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30708/src/org/firebug Added Files: RangeLogger.java RangeMsg.java Log Message: Added Range message class for investigating rssi, voltage and packet counting. --- NEW FILE: RangeLogger.java --- package org.firebug; import org.firebug.database.MysqlDBHandler; import java.io.*; import java.sql.*; import java.util.Random; import net.tinyos.message.*; public class RangeLogger implements ListenFB.PacketPrinter { private MysqlDBHandler dbh; // Move this into some test code later. private Random rand = new Random(); public RangeLogger (String dbname) { dbh = new MysqlDBHandler("localhost","3306","root","",dbname,true); } public void print(InputStream in) { } /** All of the private methods for extracting * data from packets are deterministic, that is, * these methods should work on any random packet. */ /* private int getMoteID (byte [] packet) { int baseID=packet[5]; return baseID; //id; } */ private int get_packet_type(byte [] packet) { return (int)packet[2]; } public void print_packet_raw(byte [] packet) { for (int i = 0; i < packet.length; i++) { System.out.print(packet[i] + " "); } System.out.println("\n"); } /** Put everything in print for now. */ public void print(byte [] packet) { // Given a packet, we need to get a TOS // message. //System.out.println("dblogger.print(byte [] packet)\n"); // The following line gets an ArrayOutOfBounds exception: //SensorMsg msg = new SensorMsg(packet,5,19); RangeMsg msg = new RangeMsg(packet,5,RangeMsg.DEFAULT_MESSAGE_SIZE); int mote_id = msg.get_mote_id(); int rssi = msg.get_rssi(); int count = msg.get_count(); int raw_voltage = msg.get_voltage(); float voltage = (float)((1.223*1024)/raw_voltage); Connection conn = dbh.getConnection(); /* 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; } //base station ID is 1; if (mote_id == 1) { dbh.return_connection(conn); return; } */ print_packet_raw(packet); /** FIXME: Ugly flow control using exception logic to * to track down a bbad statement, needs to be cleaned up. */ try { ResultSet rs; Statement stmt = conn.createStatement(); String range = "insert into range values(" + mote_id + ",NULL," + count + "," + rssi + "," + voltage + ")"; System.out.println(range); try { rs = stmt.executeQuery(range); } catch (SQLException sqle) { System.out.println("Problem with range statement: " + range); sqle.printStackTrace(); } stmt.close(); } catch (SQLException sqle) { System.out.println("Problem with statement"); sqle.printStackTrace(); } dbh.return_connection(conn); /* FIXME: Need to be able to return a url as well as a * description. */ //return result; } private static void test() { String database_name = "test"; RangeLogger dbl = new RangeLogger(database_name); /* while (true) { TestDBLogger.test(dbl); try { Thread.sleep(3000); } catch (Exception e) { System.out.println(e); } } */ // Unreachable /* if (TestDBLogger.test(dbl)) { System.out.println("Passed DBLogger test"); } else { System.out.println("Failed DBLogger test"); } */ } public static void main(String [] args) { test(); } } --- NEW FILE: RangeMsg.java --- /** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'RangeMsg' * message type. */ package org.firebug; public class RangeMsg extends net.tinyos.message.Message { /** The default size of this message type in bytes. */ public static final int DEFAULT_MESSAGE_SIZE = 8; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 129; /** Create a new RangeMsg of size 8. */ public RangeMsg() { super(DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** Create a new RangeMsg of the given data_length. */ public RangeMsg(int data_length) { super(data_length); amTypeSet(AM_TYPE); } /** * Create a new RangeMsg with the given data_length * and base offset. */ public RangeMsg(int data_length, int base_offset) { super(data_length, base_offset); amTypeSet(AM_TYPE); } /** * Create a new RangeMsg using the given byte array * as backing store. */ public RangeMsg(byte[] data) { super(data); amTypeSet(AM_TYPE); } /** * Create a new RangeMsg using the given byte array * as backing store, with the given base offset. */ public RangeMsg(byte[] data, int base_offset) { super(data, base_offset); amTypeSet(AM_TYPE); } /** * Create a new RangeMsg using the given byte array * as backing store, with the given base offset and data length. */ public RangeMsg(byte[] data, int base_offset, int data_length) { super(data, base_offset, data_length); amTypeSet(AM_TYPE); } /** * Create a new RangeMsg embedded in the given message * at the given base offset. */ public RangeMsg(net.tinyos.message.Message msg, int base_offset) { super(msg, base_offset, DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** * Create a new RangeMsg embedded in the given message * at the given base offset and length. */ public RangeMsg(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 <RangeMsg> \n"; try { s += " [mote_id=0x"+Long.toHexString(get_mote_id())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [count=0x"+Long.toHexString(get_count())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [rssi=0x"+Long.toHexString(get_rssi())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [voltage=0x"+Long.toHexString(get_voltage())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } // Message-type-specific access methods appear below. ///////////////////////////////////////////////////////// // Accessor methods for field: mote_id // Field type: int, unsigned // Offset (bits): 0 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'mote_id' is signed (false). */ public static boolean isSigned_mote_id() { return false; } /** * Return whether the field 'mote_id' is an array (false). */ public static boolean isArray_mote_id() { return false; } /** * Return the offset (in bytes) of the field 'mote_id' */ public static int offset_mote_id() { return (0 / 8); } /** * Return the offset (in bits) of the field 'mote_id' */ public static int offsetBits_mote_id() { return 0; } /** * Return the value (as a int) of the field 'mote_id' */ public int get_mote_id() { return (int)getUIntElement(offsetBits_mote_id(), 16); } /** * Set the value of the field 'mote_id' */ public void set_mote_id(int value) { setUIntElement(offsetBits_mote_id(), 16, value); } /** * Return the size, in bytes, of the field 'mote_id' */ public static int size_mote_id() { return (16 / 8); } /** * Return the size, in bits, of the field 'mote_id' */ public static int sizeBits_mote_id() { return 16; } ///////////////////////////////////////////////////////// // Accessor methods for field: count // Field type: int, unsigned // Offset (bits): 16 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'count' is signed (false). */ public static boolean isSigned_count() { return false; } /** * Return whether the field 'count' is an array (false). */ public static boolean isArray_count() { return false; } /** * Return the offset (in bytes) of the field 'count' */ public static int offset_count() { return (16 / 8); } /** * Return the offset (in bits) of the field 'count' */ public static int offsetBits_count() { return 16; } /** * Return the value (as a int) of the field 'count' */ public int get_count() { return (int)getUIntElement(offsetBits_count(), 16); } /** * Set the value of the field 'count' */ public void set_count(int value) { setUIntElement(offsetBits_count(), 16, value); } /** * Return the size, in bytes, of the field 'count' */ public static int size_count() { return (16 / 8); } /** * Return the size, in bits, of the field 'count' */ public static int sizeBits_count() { return 16; } ///////////////////////////////////////////////////////// // Accessor methods for field: rssi // Field type: int, unsigned // Offset (bits): 32 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'rssi' is signed (false). */ public static boolean isSigned_rssi() { return false; } /** * Return whether the field 'rssi' is an array (false). */ public static boolean isArray_rssi() { return false; } /** * Return the offset (in bytes) of the field 'rssi' */ public static int offset_rssi() { return (32 / 8); } /** * Return the offset (in bits) of the field 'rssi' */ public static int offsetBits_rssi() { return 32; } /** * Return the value (as a int) of the field 'rssi' */ public int get_rssi() { return (int)getUIntElement(offsetBits_rssi(), 16); } /** * Set the value of the field 'rssi' */ public void set_rssi(int value) { setUIntElement(offsetBits_rssi(), 16, value); } /** * Return the size, in bytes, of the field 'rssi' */ public static int size_rssi() { return (16 / 8); } /** * Return the size, in bits, of the field 'rssi' */ public static int sizeBits_rssi() { return 16; } ///////////////////////////////////////////////////////// // Accessor methods for field: voltage // Field type: int, unsigned // Offset (bits): 48 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'voltage' is signed (false). */ public static boolean isSigned_voltage() { return false; } /** * Return whether the field 'voltage' is an array (false). */ public static boolean isArray_voltage() { return false; } /** * Return the offset (in bytes) of the field 'voltage' */ public static int offset_voltage() { return (48 / 8); } /** * Return the offset (in bits) of the field 'voltage' */ public static int offsetBits_voltage() { return 48; } /** * Return the value (as a int) of the field 'voltage' */ public int get_voltage() { return (int)getUIntElement(offsetBits_voltage(), 16); } /** * Set the value of the field 'voltage' */ public void set_voltage(int value) { setUIntElement(offsetBits_voltage(), 16, value); } /** * Return the size, in bytes, of the field 'voltage' */ public static int size_voltage() { return (16 / 8); } /** * Return the size, in bits, of the field 'voltage' */ public static int sizeBits_voltage() { return 16; } } |
From: <do...@us...> - 2004-03-12 00:11:11
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30243 Modified Files: DBLogger.java FireMsg.java GGAMsg.java ListenFB.java Log Message: Conflict between GGAMsg and ListenFB with archive, probably won't work directly. Index: DBLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/DBLogger.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** DBLogger.java 18 Feb 2004 01:17:07 -0000 1.25 --- DBLogger.java 11 Mar 2004 23:52:00 -0000 1.26 *************** *** 63,71 **** //SensorMsg msg = new SensorMsg(packet,5,19); ! SensorMsg msg = new SensorMsg(); //SensorMsg msg = new SensorMsg(packet,5,12); ! FireMsg fmsg = new FireMsg(); Connection conn = dbh.getConnection(); --- 63,72 ---- //SensorMsg msg = new SensorMsg(packet,5,19); ! //SensorMsg msg = new SensorMsg(); //SensorMsg msg = new SensorMsg(packet,5,12); ! //FireMsg fmsg = new FireMsg(); + GGAMsg msg = new GGAMsg(packet,5); Connection conn = dbh.getConnection(); *************** *** 76,102 **** // database, then converted whenever it needs to // be displayed. - int time = (int)System.currentTimeMillis(); ! ! int mote_id = getMoteID(packet); ! int mote_id_test = msg.get_addr(); ! ! if (mote_id != mote_id_test){ ! System.out.println(mote_id+ " "+ mote_id_test + "\n"); ! } ! ! int cnt=msg.get_cnt(); ! int hours=msg.get_hours(); ! int minutes=msg.get_minutes(); ! int dec_sec=msg.get_dec_sec(); ! int Lat_deg=msg.get_Lat_deg(); ! int Lat_dec_min=msg.get_Lat_dec_min(); ! int Long_deg=msg.get_Long_deg(); ! int Long_dec_min=msg.get_Long_dec_min(); int NSEWind = msg.get_NSEWind(); ! 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){ dbh.return_connection(conn); --- 77,94 ---- // database, then converted whenever it needs to // be displayed. ! int mote_id = msg.get_mote_id(); ! int hours = msg.get_hours(); ! int minutes = msg.get_minutes(); ! float dec_sec = msg.get_dec_sec(); ! int Lat_deg = msg.get_Lat_deg(); ! float Lat_dec_min = msg.get_Lat_dec_min(); ! int Long_deg = msg.get_Long_deg(); ! float Long_dec_min = msg.get_Long_dec_min(); int NSEWind = msg.get_NSEWind(); ! int num_sats = msg.get_num_sats(); ! + /* if (get_packet_type(packet) != 1){ dbh.return_connection(conn); *************** *** 110,122 **** return; } print_packet_raw(packet); //base station ID is 1; if (mote_id == 1) { dbh.return_connection(conn); return; } ! --- 102,116 ---- return; } + */ print_packet_raw(packet); //base station ID is 1; + /* if (mote_id == 1) { dbh.return_connection(conn); return; } ! */ *************** *** 129,163 **** ! String updatequery = "UPDATE current " ! + "SET " ! //+ "time=" + time + ", " ! + "cnt=" + cnt + "," ! + "hours=" + hours + "," ! + "minutes=" + minutes + "," ! + "dec_sec=" + dec_sec + "," ! + "Lat_deg=" + Lat_deg + "," ! + "Lat_dec_min=" + Lat_dec_min + "," ! + "Long_deg=" + Long_deg + "," ! + "Long_dec_min=" + Long_dec_min + "," ! + "NSEWind=" + NSEWind + "," ! //+ "rel_hum=" + rel_hum + ", " ! // + "baro_pres=" + baro_pres + ", " ! + "temp=" + temp + " WHERE mote_id=" + mote_id; ! ! String insertquery = "INSERT INTO cumulative VALUES (" ! + mote_id + ", " ! + "NULL," //time + ", " ! + temp + ", " ! //+ rel_hum + ", " ! // + baro_pres + ", " ! + cnt + ", " ! + hours + ", " ! + minutes + ", " ! + dec_sec + ", " ! + Lat_deg + ", " ! + Lat_dec_min + ", " + Long_deg + ", " ! + Long_dec_min + ", " ! + NSEWind + ")"; --- 123,137 ---- ! String insertquery = "INSERT INTO location VALUES (" ! + mote_id + ", " ! + hours + ", " ! + minutes + ", " ! + dec_sec + ", " ! + Lat_deg + ", " ! + Lat_dec_min + ", " + Long_deg + ", " ! + Long_dec_min + ", " ! + NSEWind + "," ! + num_sats + ")"; *************** *** 168,178 **** sqle.printStackTrace(); } - - try { - rs = stmt.executeQuery(updatequery); - } catch (SQLException sqle) { - System.out.println("Problem with update statement: " + updatequery); - sqle.printStackTrace(); - } stmt.close(); } catch (SQLException sqle) { --- 142,145 ---- *************** *** 181,189 **** } - - - - - dbh.return_connection(conn); --- 148,151 ---- Index: FireMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/FireMsg.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FireMsg.java 18 Feb 2004 01:18:31 -0000 1.1 --- FireMsg.java 11 Mar 2004 23:52:00 -0000 1.2 *************** *** 88,92 **** String s = "Message <FireMsg> \n"; try { ! s += " [addr=0x"+Long.toHexString(get_addr())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { --- 88,92 ---- String s = "Message <FireMsg> \n"; try { ! s += " [mote_id=0x"+Long.toHexString(get_mote_id())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { *************** *** 111,115 **** ///////////////////////////////////////////////////////// ! // Accessor methods for field: addr // Field type: int // Offset (bits): 0 --- 111,115 ---- ///////////////////////////////////////////////////////// ! // Accessor methods for field: mote_id // Field type: int // Offset (bits): 0 *************** *** 118,173 **** /** ! * Return whether the field 'addr' is signed (true). */ ! public static boolean isSigned_addr() { return true; } /** ! * Return whether the field 'addr' is an array (false). */ ! public static boolean isArray_addr() { return false; } /** ! * Return the offset (in bytes) of the field 'addr' */ ! public static int offset_addr() { return (0 / 8); } /** ! * Return the offset (in bits) of the field 'addr' */ ! public static int offsetBits_addr() { return 0; } /** ! * Return the value (as a int) of the field 'addr' */ ! public int get_addr() { ! return (int)getUIntElement(offsetBits_addr(), 16); } /** ! * Set the value of the field 'addr' */ ! public void set_addr(int value) { ! setUIntElement(offsetBits_addr(), 16, value); } /** ! * Return the size, in bytes, of the field 'addr' */ ! public static int size_addr() { return (16 / 8); } /** ! * Return the size, in bits, of the field 'addr' */ ! public static int sizeBits_addr() { return 16; } --- 118,173 ---- /** ! * Return whether the field 'mote_id' is signed (true). */ ! public static boolean isSigned_mote_id() { return true; } /** ! * Return whether the field 'mote_id' is an array (false). */ ! public static boolean isArray_mote_id() { return false; } /** ! * Return the offset (in bytes) of the field 'mote_id' */ ! public static int offset_mote_id() { return (0 / 8); } /** ! * Return the offset (in bits) of the field 'mote_id' */ ! public static int offsetBits_mote_id() { return 0; } /** ! * Return the value (as a int) of the field 'mote_id' */ ! public int get_mote_id() { ! return (int)getUIntElement(offsetBits_mote_id(), 16); } /** ! * Set the value of the field 'mote_id' */ ! public void set_mote_id(int value) { ! setUIntElement(offsetBits_mote_id(), 16, value); } /** ! * Return the size, in bytes, of the field 'mote_id' */ ! public static int size_mote_id() { return (16 / 8); } /** ! * Return the size, in bits, of the field 'mote_id' */ ! public static int sizeBits_mote_id() { return 16; } Index: GGAMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/GGAMsg.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GGAMsg.java 19 Feb 2004 17:41:53 -0000 1.2 --- GGAMsg.java 11 Mar 2004 23:52:00 -0000 1.3 *************** *** 10,19 **** /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 19; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 129; ! /** Create a new GGAMsg of size 19. */ public GGAMsg() { super(DEFAULT_MESSAGE_SIZE); --- 10,19 ---- /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 20; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 129; ! /** Create a new GGAMsg of size 20. */ public GGAMsg() { super(DEFAULT_MESSAGE_SIZE); *************** *** 88,92 **** String s = "Message <GGAMsg> \n"; try { - s += " [mote_id=0x"+Long.toHexString(get_mote_id())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } --- 88,91 ---- *************** *** 125,131 **** ///////////////////////////////////////////////////////// // Accessor methods for field: mote_id ! // Field type: short, unsigned // Offset (bits): 0 ! // Size (bits): 8 ///////////////////////////////////////////////////////// --- 124,130 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: mote_id ! // Field type: int, unsigned // Offset (bits): 0 ! // Size (bits): 16 ///////////////////////////////////////////////////////// *************** *** 159,166 **** /** ! * Return the value (as a short) of the field 'mote_id' */ ! public short get_mote_id() { ! return (short)getUIntElement(offsetBits_mote_id(), 8); } --- 158,165 ---- /** ! * Return the value (as a int) of the field 'mote_id' */ ! public int get_mote_id() { ! return (int)getUIntElement(offsetBits_mote_id(), 16); } *************** *** 168,173 **** * Set the value of the field 'mote_id' */ ! public void set_mote_id(short value) { ! setUIntElement(offsetBits_mote_id(), 8, value); } --- 167,172 ---- * Set the value of the field 'mote_id' */ ! public void set_mote_id(int value) { ! setUIntElement(offsetBits_mote_id(), 16, value); } *************** *** 176,180 **** */ public static int size_mote_id() { ! return (8 / 8); } --- 175,179 ---- */ public static int size_mote_id() { ! return (16 / 8); } *************** *** 183,187 **** */ public static int sizeBits_mote_id() { ! return 8; } --- 182,186 ---- */ public static int sizeBits_mote_id() { ! return 16; } *************** *** 189,193 **** // Accessor methods for field: hours // Field type: short, unsigned ! // Offset (bits): 8 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 188,192 ---- // Accessor methods for field: hours // Field type: short, unsigned ! // Offset (bits): 16 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 211,215 **** */ public static int offset_hours() { ! return (8 / 8); } --- 210,214 ---- */ public static int offset_hours() { ! return (16 / 8); } *************** *** 218,222 **** */ public static int offsetBits_hours() { ! return 8; } --- 217,221 ---- */ public static int offsetBits_hours() { ! return 16; } *************** *** 252,256 **** // Accessor methods for field: minutes // Field type: short, unsigned ! // Offset (bits): 16 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 251,255 ---- // Accessor methods for field: minutes // Field type: short, unsigned ! // Offset (bits): 24 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 274,278 **** */ public static int offset_minutes() { ! return (16 / 8); } --- 273,277 ---- */ public static int offset_minutes() { ! return (24 / 8); } *************** *** 281,285 **** */ public static int offsetBits_minutes() { ! return 16; } --- 280,284 ---- */ public static int offsetBits_minutes() { ! return 24; } *************** *** 315,319 **** // Accessor methods for field: dec_sec // Field type: float, unsigned ! // Offset (bits): 24 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 314,318 ---- // Accessor methods for field: dec_sec // Field type: float, unsigned ! // Offset (bits): 32 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 337,341 **** */ public static int offset_dec_sec() { ! return (24 / 8); } --- 336,340 ---- */ public static int offset_dec_sec() { ! return (32 / 8); } *************** *** 344,348 **** */ public static int offsetBits_dec_sec() { ! return 24; } --- 343,347 ---- */ public static int offsetBits_dec_sec() { ! return 32; } *************** *** 378,382 **** // Accessor methods for field: Lat_deg // Field type: short, unsigned ! // Offset (bits): 56 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 377,381 ---- // Accessor methods for field: Lat_deg // Field type: short, unsigned ! // Offset (bits): 64 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 400,404 **** */ public static int offset_Lat_deg() { ! return (56 / 8); } --- 399,403 ---- */ public static int offset_Lat_deg() { ! return (64 / 8); } *************** *** 407,411 **** */ public static int offsetBits_Lat_deg() { ! return 56; } --- 406,410 ---- */ public static int offsetBits_Lat_deg() { ! return 64; } *************** *** 441,445 **** // Accessor methods for field: Lat_dec_min // Field type: float, unsigned ! // Offset (bits): 64 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 440,444 ---- // Accessor methods for field: Lat_dec_min // Field type: float, unsigned ! // Offset (bits): 72 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 463,467 **** */ public static int offset_Lat_dec_min() { ! return (64 / 8); } --- 462,466 ---- */ public static int offset_Lat_dec_min() { ! return (72 / 8); } *************** *** 470,474 **** */ public static int offsetBits_Lat_dec_min() { ! return 64; } --- 469,473 ---- */ public static int offsetBits_Lat_dec_min() { ! return 72; } *************** *** 504,508 **** // Accessor methods for field: Long_deg // Field type: short, unsigned ! // Offset (bits): 96 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 503,507 ---- // Accessor methods for field: Long_deg // Field type: short, unsigned ! // Offset (bits): 104 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 526,530 **** */ public static int offset_Long_deg() { ! return (96 / 8); } --- 525,529 ---- */ public static int offset_Long_deg() { ! return (104 / 8); } *************** *** 533,537 **** */ public static int offsetBits_Long_deg() { ! return 96; } --- 532,536 ---- */ public static int offsetBits_Long_deg() { ! return 104; } *************** *** 567,571 **** // Accessor methods for field: Long_dec_min // Field type: float, unsigned ! // Offset (bits): 104 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 566,570 ---- // Accessor methods for field: Long_dec_min // Field type: float, unsigned ! // Offset (bits): 112 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 589,593 **** */ public static int offset_Long_dec_min() { ! return (104 / 8); } --- 588,592 ---- */ public static int offset_Long_dec_min() { ! return (112 / 8); } *************** *** 596,600 **** */ public static int offsetBits_Long_dec_min() { ! return 104; } --- 595,599 ---- */ public static int offsetBits_Long_dec_min() { ! return 112; } *************** *** 630,634 **** // Accessor methods for field: NSEWind // Field type: short, unsigned ! // Offset (bits): 136 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 629,633 ---- // Accessor methods for field: NSEWind // Field type: short, unsigned ! // Offset (bits): 144 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 652,656 **** */ public static int offset_NSEWind() { ! return (136 / 8); } --- 651,655 ---- */ public static int offset_NSEWind() { ! return (144 / 8); } *************** *** 659,663 **** */ public static int offsetBits_NSEWind() { ! return 136; } --- 658,662 ---- */ public static int offsetBits_NSEWind() { ! return 144; } *************** *** 693,697 **** // Accessor methods for field: num_sats // Field type: short, unsigned ! // Offset (bits): 144 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 692,696 ---- // Accessor methods for field: num_sats // Field type: short, unsigned ! // Offset (bits): 152 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 715,719 **** */ public static int offset_num_sats() { ! return (144 / 8); } --- 714,718 ---- */ public static int offset_num_sats() { ! return (152 / 8); } *************** *** 722,726 **** */ public static int offsetBits_num_sats() { ! return 144; } --- 721,725 ---- */ public static int offsetBits_num_sats() { ! return 152; } Index: ListenFB.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/ListenFB.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ListenFB.java 19 Feb 2004 17:41:53 -0000 1.17 --- ListenFB.java 11 Mar 2004 23:52:00 -0000 1.18 *************** *** 267,278 **** //SensorPacket print = new SensorPacket(); //DBLogger dblogger = new DBLogger(dbname); ! RawPacket rawpacket = new RawPacket(); //FireLogger firelogger = new FireLogger(dbname); ! GPSLogger gpslogger = new GPSLogger(dbname); //printers.add(print); //printers.add(dblogger); //printers.add(firelogger); ! printers.add(gpslogger); try { --- 267,290 ---- //SensorPacket print = new SensorPacket(); //DBLogger dblogger = new DBLogger(dbname); ! ! //RawPacket rawpacket = new RawPacket(); //FireLogger firelogger = new FireLogger(dbname); ! RangeLogger rangelogger = new RangeLogger(dbname); ! ! //RawPacket rawpacket = new RawPacket(); ! //FireLogger firelogger = new FireLogger(dbname); ! //GPSLogger gpslogger = new GPSLogger(dbname); ! //printers.add(print); //printers.add(dblogger); + //printers.add(firelogger); ! printers.add(rangelogger); ! ! ! //printers.add(firelogger); ! //printers.add(gpslogger); ! try { |
From: <do...@us...> - 2004-03-12 00:11:08
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30243/database Modified Files: MysqlDBHandler.java Log Message: Conflict between GGAMsg and ListenFB with archive, probably won't work directly. Index: MysqlDBHandler.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/database/MysqlDBHandler.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MysqlDBHandler.java 18 Feb 2004 01:17:07 -0000 1.10 --- MysqlDBHandler.java 11 Mar 2004 23:52:01 -0000 1.11 *************** *** 39,42 **** --- 39,46 ---- /*************** Constructors ***************/ + + public MysqlDBHandler() { + } + public MysqlDBHandler(String dbname) { |
From: <do...@us...> - 2004-03-12 00:00:08
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28001 Modified Files: db_create.php Log Message: Handling voltage now. Index: db_create.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/db_create.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** db_create.php 9 Mar 2004 20:02:38 -0000 1.13 --- db_create.php 11 Mar 2004 23:41:04 -0000 1.14 *************** *** 78,82 **** ! $statement = "CREATE TABLE range (mote_id SMALLINT, count INTEGER, rssi INTEGER)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating range table"); --- 78,82 ---- ! $statement = "CREATE TABLE range (mote_id SMALLINT, time TIMESTAMP, count INTEGER, rssi INTEGER, voltage FLOAT)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating range table"); |
From: <do...@us...> - 2004-03-09 20:20:16
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19849 Modified Files: db_create.php db_table_select.php Log Message: Completely rewrote the table display php script. Index: db_create.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/db_create.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** db_create.php 18 Feb 2004 15:32:15 -0000 1.12 --- db_create.php 9 Mar 2004 20:02:38 -0000 1.13 *************** *** 54,58 **** */ ! $statement = "CREATE TABLE location (mote_id SMALLINT, time TIMESTAMP, gps_hours SMALLINT, gps_minutes SMALLINT, gps_seconds FLOAT, lat_deg SMALLINT,"; $statement .= "lat_dec_min FLOAT, long_deg SMALLINT, long_dec_min FLOAT, nsew SMALLINT, numsats SMALLINT)"; --- 54,58 ---- */ ! $statement = "CREATE TABLE location (mote_id SMALLINT, gps_hours SMALLINT, gps_minutes SMALLINT, gps_seconds FLOAT, lat_deg SMALLINT,"; $statement .= "lat_dec_min FLOAT, long_deg SMALLINT, long_dec_min FLOAT, nsew SMALLINT, numsats SMALLINT)"; *************** *** 77,80 **** --- 77,84 ---- mysql_query($statement) or die("Error: ".mysql_error()." in creating cumulative atable"); + + $statement = "CREATE TABLE range (mote_id SMALLINT, count INTEGER, rssi INTEGER)"; + mysql_query($statement) or die("Error: ".mysql_error()." in creating range table"); + ?> Index: db_table_select.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/db_table_select.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** db_table_select.php 11 Feb 2004 00:05:24 -0000 1.4 --- db_table_select.php 9 Mar 2004 20:02:38 -0000 1.5 *************** *** 29,34 **** </p> - - <?php //if (!isset($HTTP_SESSION_VARS["tblname"])) { --- 29,32 ---- *************** *** 43,69 **** print("<h1>Mote activity: Database $dbname, table $tblname</h1>"); ?> - - <center> <table class="db_schema"> - <tr> - <td>Mote ID</td> - <td>Time</td> - <td>Hours</td> - <td>Minutes</td> - <td>Dec_sec</td> - <td>Lat_deg</td> - <td>Lat_dec_min</td> - <td>Long_deg</td> - <td>Long_dec_min</td> - <td>NSEWind</td> - <td>Temp</td> - <td>Cnt </td> - </tr> - - <?php mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); --- 41,50 ---- print("<h1>Mote activity: Database $dbname, table $tblname</h1>"); ?> <center> <table class="db_schema"> + <?php mysql_connect("localhost","root","") or die("Error: ".mysql_error()." in mysql_connect."); *************** *** 71,204 **** mysql_select_db("$dbname") or die("Error: ".mysql_error()." in mysql_select_db."); ! if ($mote_id == "") { ! $mote_id = "%"; ! } ! ! if ($time == "") { ! $time = "%"; ! } ! ! if ($cnt == "") { ! $cnt = "%"; ! } ! ! if ($hours == "") { ! $hours = "%"; ! } - if ($minutes == "") { - $minutes = "%"; - } ! if ($dec_sec == "") { ! $dec_sec = "%"; ! } ! if ($Lat_deg == "") { ! $Lat_deg = "%"; } ! if ($Lat_dec_min == "") { ! $Lat_dec_min = "%"; ! } ! ! if ($Long_deg == "") { ! $Long_deg = "%"; ! } - if ($Long_dec_min == "") { - $Long_dec_min = "%"; - } ! if ($NSEWind == "") { ! $NSEWind = "%"; ! } ! if ($temp == "") { ! $temp = "%"; } ! $result = mysql_query("select * from $tblname ! where mote_id like '$mote_id%' ! and time like '$time%' ! and cnt like '$cnt%' ! and hours like '$hours%' ! and minutes like '$minutes%' ! and dec_sec like '$dec_sec%' ! and Lat_deg like '$Lat_deg%' ! and Lat_dec_min like '$Lat_dec_min%' ! and Long_deg like '$Long_deg%' ! and Long_dec_min like '$Long_dec_min%' ! and NSEWind like '$NSEWind%' ! and temp like '$temp%'") ! //and rel_hum like '$rel_hum%' ! //and baro_pres like '$baro_pres%'" ! or die("Error: ".mysql_error()." in query."); ! ! ! if ($row = mysql_fetch_array($result)) { ! do { ! ! print ("<tr>"); ! ! print ("<td>"); ! print $row["mote_id"]; ! print ("</td>"); ! ! print ("<td>"); ! print $row["time"]; ! print ("</td>"); ! ! print ("<td>"); ! print $row["hours"]; ! print ("</td>"); ! ! print ("<td>"); ! print $row["minutes"]; ! print ("</td>"); ! ! print ("<td>"); ! print $row["dec_sec"]; ! print ("</td>"); ! ! print ("<td>"); ! print $row["Lat_deg"]; ! print ("</td>"); ! ! print ("<td>"); ! print $row["Lat_dec_min"]; ! print ("</td>"); ! ! print ("<td>"); ! print $row["Long_deg"]; ! print ("</td>"); ! ! print ("<td>"); ! print $row["Long_dec_min"]; ! print ("</td>"); ! ! print ("<td>"); ! print $row["NSEWind"]; ! print ("</td>"); ! ! print ("<td>"); ! print $row["temp"]; ! print ("</td>"); ! ! print ("<td>"); ! print $row["cnt"]; ! print ("</td>"); ! ! ! print ("</tr>"); ! } while ($row = mysql_fetch_array($result)); } - - - ?> --- 52,100 ---- mysql_select_db("$dbname") or die("Error: ".mysql_error()." in mysql_select_db."); ! $statement = "show columns from $tblname;"; ! $columns = mysql_query($statement) or die("Error: ".mysql_error()." getting columns"); ! // Build the table header column names. Make this into a function. ! if ($columnname = mysql_fetch_array($columns)) { ! print("<tr>\n"); ! $names = array(); ! do { ! print ("<td>"); ! array_push($names, $columnname[0]); ! print $columnname[0]; ! print ("</td>"); ! } while ($columnname = mysql_fetch_array($columns)); ! print("</tr>\n"); ! // This is pretty cool for debugging. ! //print_r($names); } ! $statement = "select * from $tblname"; ! $result = mysql_query($statement); ! //Print the value for a row. ! function print_row($item2,$key) { ! print ("<td>\n"); ! echo "$item2\n"; ! print ("</td>\n"); } ! // Print every row. ! if ($row = mysql_fetch_row($result)) { + // for each row do { ! // For each column... ! print ("<tr>"); ! $row = array_values($row); ! array_walk($row,'print_row'); print ("</tr>"); ! } while ($row = mysql_fetch_row($result)); } ?> |
From: <do...@us...> - 2004-02-19 17:52:30
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11711/project/java/src/org/firebug Modified Files: FireLogger.java GGAMsg.java ListenFB.java Log Message: gps logging now works. Logs to location table. Index: FireLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/FireLogger.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FireLogger.java 18 Feb 2004 01:17:07 -0000 1.1 --- FireLogger.java 19 Feb 2004 17:41:53 -0000 1.2 *************** *** 62,65 **** --- 62,67 ---- int time = (int)System.currentTimeMillis(); + System.out.println(fmsg.toString()); + int mote_id = fmsg.get_addr(); int cnt = fmsg.get_cnt(); *************** *** 92,100 **** //base station ID is 1; if (mote_id == 1) { dbh.return_connection(conn); return; } ! --- 94,103 ---- //base station ID is 1; + /* if (mote_id == 1) { dbh.return_connection(conn); return; } ! */ Index: GGAMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/GGAMsg.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GGAMsg.java 18 Feb 2004 15:31:09 -0000 1.1 --- GGAMsg.java 19 Feb 2004 17:41:53 -0000 1.2 *************** *** 10,19 **** /** 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 = 129; ! /** Create a new GGAMsg of size 18. */ public GGAMsg() { super(DEFAULT_MESSAGE_SIZE); --- 10,19 ---- /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 19; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 129; ! /** Create a new GGAMsg of size 19. */ public GGAMsg() { super(DEFAULT_MESSAGE_SIZE); *************** *** 88,91 **** --- 88,95 ---- String s = "Message <GGAMsg> \n"; try { + + s += " [mote_id=0x"+Long.toHexString(get_mote_id())+"]\n"; + } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } + try { s += " [hours=0x"+Long.toHexString(get_hours())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } *************** *** 120,124 **** ///////////////////////////////////////////////////////// ! // Accessor methods for field: hours // Field type: short, unsigned // Offset (bits): 0 --- 124,128 ---- ///////////////////////////////////////////////////////// ! // Accessor methods for field: mote_id // Field type: short, unsigned // Offset (bits): 0 *************** *** 127,130 **** --- 131,197 ---- /** + * Return whether the field 'mote_id' is signed (false). + */ + public static boolean isSigned_mote_id() { + return false; + } + + /** + * Return whether the field 'mote_id' is an array (false). + */ + public static boolean isArray_mote_id() { + return false; + } + + /** + * Return the offset (in bytes) of the field 'mote_id' + */ + public static int offset_mote_id() { + return (0 / 8); + } + + /** + * Return the offset (in bits) of the field 'mote_id' + */ + public static int offsetBits_mote_id() { + return 0; + } + + /** + * Return the value (as a short) of the field 'mote_id' + */ + public short get_mote_id() { + return (short)getUIntElement(offsetBits_mote_id(), 8); + } + + /** + * Set the value of the field 'mote_id' + */ + public void set_mote_id(short value) { + setUIntElement(offsetBits_mote_id(), 8, value); + } + + /** + * Return the size, in bytes, of the field 'mote_id' + */ + public static int size_mote_id() { + return (8 / 8); + } + + /** + * Return the size, in bits, of the field 'mote_id' + */ + public static int sizeBits_mote_id() { + return 8; + } + + ///////////////////////////////////////////////////////// + // Accessor methods for field: hours + // Field type: short, unsigned + // Offset (bits): 8 + // Size (bits): 8 + ///////////////////////////////////////////////////////// + + /** * Return whether the field 'hours' is signed (false). */ *************** *** 144,148 **** */ public static int offset_hours() { ! return (0 / 8); } --- 211,215 ---- */ public static int offset_hours() { ! return (8 / 8); } *************** *** 151,155 **** */ public static int offsetBits_hours() { ! return 0; } --- 218,222 ---- */ public static int offsetBits_hours() { ! return 8; } *************** *** 185,189 **** // Accessor methods for field: minutes // Field type: short, unsigned ! // Offset (bits): 8 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 252,256 ---- // Accessor methods for field: minutes // Field type: short, unsigned ! // Offset (bits): 16 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 207,211 **** */ public static int offset_minutes() { ! return (8 / 8); } --- 274,278 ---- */ public static int offset_minutes() { ! return (16 / 8); } *************** *** 214,218 **** */ public static int offsetBits_minutes() { ! return 8; } --- 281,285 ---- */ public static int offsetBits_minutes() { ! return 16; } *************** *** 248,252 **** // Accessor methods for field: dec_sec // Field type: float, unsigned ! // Offset (bits): 16 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 315,319 ---- // Accessor methods for field: dec_sec // Field type: float, unsigned ! // Offset (bits): 24 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 270,274 **** */ public static int offset_dec_sec() { ! return (16 / 8); } --- 337,341 ---- */ public static int offset_dec_sec() { ! return (24 / 8); } *************** *** 277,281 **** */ public static int offsetBits_dec_sec() { ! return 16; } --- 344,348 ---- */ public static int offsetBits_dec_sec() { ! return 24; } *************** *** 311,315 **** // Accessor methods for field: Lat_deg // Field type: short, unsigned ! // Offset (bits): 48 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 378,382 ---- // Accessor methods for field: Lat_deg // Field type: short, unsigned ! // Offset (bits): 56 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 333,337 **** */ public static int offset_Lat_deg() { ! return (48 / 8); } --- 400,404 ---- */ public static int offset_Lat_deg() { ! return (56 / 8); } *************** *** 340,344 **** */ public static int offsetBits_Lat_deg() { ! return 48; } --- 407,411 ---- */ public static int offsetBits_Lat_deg() { ! return 56; } *************** *** 374,378 **** // Accessor methods for field: Lat_dec_min // Field type: float, unsigned ! // Offset (bits): 56 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 441,445 ---- // Accessor methods for field: Lat_dec_min // Field type: float, unsigned ! // Offset (bits): 64 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 396,400 **** */ public static int offset_Lat_dec_min() { ! return (56 / 8); } --- 463,467 ---- */ public static int offset_Lat_dec_min() { ! return (64 / 8); } *************** *** 403,407 **** */ public static int offsetBits_Lat_dec_min() { ! return 56; } --- 470,474 ---- */ public static int offsetBits_Lat_dec_min() { ! return 64; } *************** *** 437,441 **** // Accessor methods for field: Long_deg // Field type: short, unsigned ! // Offset (bits): 88 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 504,508 ---- // Accessor methods for field: Long_deg // Field type: short, unsigned ! // Offset (bits): 96 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 459,463 **** */ public static int offset_Long_deg() { ! return (88 / 8); } --- 526,530 ---- */ public static int offset_Long_deg() { ! return (96 / 8); } *************** *** 466,470 **** */ public static int offsetBits_Long_deg() { ! return 88; } --- 533,537 ---- */ public static int offsetBits_Long_deg() { ! return 96; } *************** *** 500,504 **** // Accessor methods for field: Long_dec_min // Field type: float, unsigned ! // Offset (bits): 96 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 567,571 ---- // Accessor methods for field: Long_dec_min // Field type: float, unsigned ! // Offset (bits): 104 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 522,526 **** */ public static int offset_Long_dec_min() { ! return (96 / 8); } --- 589,593 ---- */ public static int offset_Long_dec_min() { ! return (104 / 8); } *************** *** 529,533 **** */ public static int offsetBits_Long_dec_min() { ! return 96; } --- 596,600 ---- */ public static int offsetBits_Long_dec_min() { ! return 104; } *************** *** 563,567 **** // Accessor methods for field: NSEWind // Field type: short, unsigned ! // Offset (bits): 128 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 630,634 ---- // Accessor methods for field: NSEWind // Field type: short, unsigned ! // Offset (bits): 136 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 585,589 **** */ public static int offset_NSEWind() { ! return (128 / 8); } --- 652,656 ---- */ public static int offset_NSEWind() { ! return (136 / 8); } *************** *** 592,596 **** */ public static int offsetBits_NSEWind() { ! return 128; } --- 659,663 ---- */ public static int offsetBits_NSEWind() { ! return 136; } *************** *** 626,630 **** // Accessor methods for field: num_sats // Field type: short, unsigned ! // Offset (bits): 136 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 693,697 ---- // Accessor methods for field: num_sats // Field type: short, unsigned ! // Offset (bits): 144 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 648,652 **** */ public static int offset_num_sats() { ! return (136 / 8); } --- 715,719 ---- */ public static int offset_num_sats() { ! return (144 / 8); } *************** *** 655,659 **** */ public static int offsetBits_num_sats() { ! return 136; } --- 722,726 ---- */ public static int offsetBits_num_sats() { ! return 144; } Index: ListenFB.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/ListenFB.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ListenFB.java 18 Feb 2004 01:17:07 -0000 1.16 --- ListenFB.java 19 Feb 2004 17:41:53 -0000 1.17 *************** *** 268,276 **** //DBLogger dblogger = new DBLogger(dbname); RawPacket rawpacket = new RawPacket(); ! FireLogger firelogger = new FireLogger(dbname); //printers.add(print); //printers.add(dblogger); ! printers.add(firelogger); try { --- 268,278 ---- //DBLogger dblogger = new DBLogger(dbname); RawPacket rawpacket = new RawPacket(); ! //FireLogger firelogger = new FireLogger(dbname); ! GPSLogger gpslogger = new GPSLogger(dbname); //printers.add(print); //printers.add(dblogger); ! //printers.add(firelogger); ! printers.add(gpslogger); try { |
From: <do...@us...> - 2004-02-19 17:52:29
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11711/project/java/src/org/firebug/database Modified Files: QueryHandler.java Log Message: gps logging now works. Logs to location table. Index: QueryHandler.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/database/QueryHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** QueryHandler.java 9 May 2003 00:29:51 -0000 1.3 --- QueryHandler.java 19 Feb 2004 17:41:53 -0000 1.4 *************** *** 8,12 **** public QueryHandler () { ! dbh = new MysqlDBHandler(); } --- 8,12 ---- public QueryHandler () { ! dbh = new MysqlDBHandler("test"); } |
From: <do...@us...> - 2004-02-19 17:52:29
|
Update of /cvsroot/firebug/firebug/project/java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11711/project/java Modified Files: firelogtest.sh mhrun.sh Log Message: gps logging now works. Logs to location table. Index: firelogtest.sh =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/firelogtest.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** firelogtest.sh 18 Feb 2004 01:18:30 -0000 1.1 --- firelogtest.sh 19 Feb 2004 17:41:53 -0000 1.2 *************** *** 7,10 **** --- 7,14 ---- echo $HOSTNAME export MSGPATH=C:\\cygwin\\opt\\tinyos-1.x\\tools\\java + elif [ $HOSTNAME = Firebug2 ]; then + echo $HOSTNAME + export MSGPATH=C:\\cygwin\\opt\\tinyos-1.x\\tools\\java + # export MSGPATH=C:\\cygwin\\home\\dave\\sf.net\\tinyos-1.x\\tools\\java else echo Set MSGPATH to point to tinyos-1.x/tools/java Index: mhrun.sh =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/mhrun.sh,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mhrun.sh 18 Feb 2004 01:17:06 -0000 1.9 --- mhrun.sh 19 Feb 2004 17:41:53 -0000 1.10 *************** *** 28,31 **** --- 28,34 ---- echo $HOSTNAME export MSGPATH=C:\\cygwin\\opt\\tinyos-1.x\\tools\\java + elif [ $HOSTNAME = Firebug2 ]; then + echo $HOSTNAME + export MSGPATH=C:\\cygwin\\opt\\tinyos-1.x\\tools\\java else echo Set MSGPATH to point to tinyos-1.x/tools/java |
From: <do...@us...> - 2004-02-19 17:17:29
|
Update of /cvsroot/firebug/firebug/project/src/sensordata In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4723/src/sensordata Modified Files: mkmsg.sh Log Message: . Index: mkmsg.sh =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/sensordata/mkmsg.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mkmsg.sh 10 Jul 2003 09:05:26 -0000 1.1 --- mkmsg.sh 19 Feb 2004 17:06:53 -0000 1.2 *************** *** 6,9 **** --- 6,12 ---- # struct definition. + set MSGROOT=$HOME/firebug/fireboard/tos/ mig java -java-classname=org.firebug.SensorMsg -I. ./sensormsg.h SensorMsg > SensorMsg.java + mig java -java-classname=org.firebug.FireMsg -I. $HOME/firebug/fireboard/tos/sensorboards/xbow_mts420ca/fireboard.h Firedata_msg > FireMsg.java + mig java -java-classname=org.firebug.GGAMsg -I. $HOME/firebug/fireboard/tos/sensors/leadtek9546/leadtek_9546.h GGAMsg > GGAMsg.java |
From: <do...@us...> - 2004-02-19 16:36:06
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28380 Added Files: php.diff Log Message: Added some diff to the apache httpd.conf for php setup. Apply as patch, then fix any minor path problems. --- NEW FILE: php.diff --- 321c321 < DirectoryIndex index.html index.html.var index.php index.php3 --- > DirectoryIndex index.html index.html.var 510d509 < ScriptAlias /PHP4/ "C:/Program Files/Apache Group/Apache2/cgi-bin/PHP/" 758,759d756 < AddType application/x-httpd-php4 .php < AddType application/x-httpd-php4 .php3 804d800 < Action application/x-httpd-php4 "/cgi-bin/PHP/php.exe" |
From: <do...@us...> - 2004-02-18 15:41:59
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30120 Modified Files: db_create.php Log Message: Fixed database creation script to reflect changes in data structures (messages). Index: db_create.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/db_create.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** db_create.php 19 Dec 2003 01:06:02 -0000 1.11 --- db_create.php 18 Feb 2004 15:32:15 -0000 1.12 *************** *** 35,45 **** /* 3 create table statements for firebug sensors. */ ! $statement = "CREATE TABLE location (mote_id INTEGER, longitude FLOAT, latitude FLOAT)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating location atable"); ! $statement = "CREATE TABLE current (mote_id INTEGER, time TIMESTAMP, temp FLOAT, cnt INTEGER, hours INTEGER, minutes INTEGER, dec_sec INTEGER, Lat_deg INTEGER, Lat_dec_min INTEGER, Long_deg INTEGER, Long_dec_min INTEGER, NSEWind INTEGER)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating current atable"); ! $statement = "CREATE TABLE cumulative (mote_id INTEGER, time TIMESTAMP, temp FLOAT, cnt INTEGER, hours INTEGER, minutes INTEGER, dec_sec INTEGER, Lat_deg INTEGER, Lat_dec_min INTEGER, Long_deg INTEGER, Long_dec_min INTEGER, NSEWind INTEGER)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating cumulative atable"); --- 35,78 ---- /* 3 create table statements for firebug sensors. */ ! ! ! ! /* ! typedef struct GGAMsg { ! ! uint16_t mote_id ! uint8_t hours; ! uint8_t minutes; ! float dec_sec; ! uint8_t Lat_deg; ! float Lat_dec_min; ! uint8_t Long_deg; ! float Long_dec_min; ! uint8_t NSEWind; ! uint8_t num_sats; ! } GGAMsg; ! */ ! ! $statement = "CREATE TABLE location (mote_id SMALLINT, time TIMESTAMP, gps_hours SMALLINT, gps_minutes SMALLINT, gps_seconds FLOAT, lat_deg SMALLINT,"; ! $statement .= "lat_dec_min FLOAT, long_deg SMALLINT, long_dec_min FLOAT, nsew SMALLINT, numsats SMALLINT)"; ! mysql_query($statement) or die("Error: ".mysql_error()." in creating location atable"); ! /* ! typedef struct Firedata_msg { ! uint16_t mote_id; ! uint16_t cnt; ! float temp; ! float rel_hum; ! float baro_pres; ! float lux; ! } Firedata_msg; ! */ ! ! $statement = "CREATE TABLE current (mote_id SMALLINT, time TIMESTAMP, cnt SMALLINT, temp FLOAT, rel_hum FLOAT, baro_pres FLOAT, lux FLOAT)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating current atable"); ! ! $statement = "CREATE TABLE cumulative (mote_id SMALLINT, time TIMESTAMP, cnt SMALLINT, temp FLOAT, rel_hum FLOAT, baro_pres FLOAT, lux FLOAT)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating cumulative atable"); *************** *** 53,57 **** for ($i = 2; $i <= $nummotes+1; $i++) { ! $statement = "insert into current values ($i,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);"; print "<br />"; print $statement; --- 86,90 ---- for ($i = 2; $i <= $nummotes+1; $i++) { ! $statement = "insert into current values ($i,NULL,NULL,NULL,NULL,NULL,NULL);"; print "<br />"; print $statement; |
From: <do...@us...> - 2004-02-18 15:40:52
|
Update of /cvsroot/firebug/firebug/project/java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29797 Added Files: gpslogtest.sh Log Message: Cleaning gps handling code. --- NEW FILE: gpslogtest.sh --- #!/usr/bin/sh if [ $HOSTNAME = MAX ]; then export MSGPATH=C:\\tinyos\\cygwin\\opt\\tinyos-1.x\\tools\\java elif [ $HOSTNAME = firemobile ]; then echo $HOSTNAME export MSGPATH=C:\\cygwin\\opt\\tinyos-1.x\\tools\\java else echo Set MSGPATH to point to tinyos-1.x/tools/java fi java -cp ".\\dist\\firebug.jar;c:\\jdk1.3.1_01\\lib\\comm.jar;.\\jar\\mm.mysql-2.0.4-bin.jar;$MSGPATH" \ org.firebug.GPSLogger |