[Firebug-cvs] firebug/project/src/sensordata WeatherBoard.nc,1.2,1.3 WeatherBoardM.nc,1.2,1.3
Brought to you by:
doolin
From: <che...@us...> - 2003-05-23 00:57:17
|
Update of /cvsroot/firebug/firebug/project/src/sensordata In directory sc8-pr-cvs1:/tmp/cvs-serv14580/project/src/sensordata Modified Files: WeatherBoard.nc WeatherBoardM.nc Log Message: sensor msg now parsed collectly into the DB Index: WeatherBoard.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/sensordata/WeatherBoard.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WeatherBoard.nc 22 Apr 2003 18:36:37 -0000 1.2 --- WeatherBoard.nc 23 May 2003 00:57:14 -0000 1.3 *************** *** 66,71 **** TimerC, //Sensors SensirionHumidity; - --- 66,71 ---- TimerC, //Sensors + TaosPhoto, SensirionHumidity; *************** *** 75,84 **** WeatherBoardM.Timer1 -> TimerC.Timer[unique("Timer")]; WeatherBoardM.Leds -> LedsC; ! WeatherBoardM.SendMsg -> GenericComm.SendMsg[10]; //Humidity Sensor Wire WeatherBoardM.ADCControl_Humidity -> SensirionHumidity.StdControl; WeatherBoardM.Humidity -> SensirionHumidity.Humidity; - WeatherBoardM.Temperature_Humidity -> SensirionHumidity.Temperature; } --- 75,87 ---- WeatherBoardM.Timer1 -> TimerC.Timer[unique("Timer")]; WeatherBoardM.Leds -> LedsC; ! WeatherBoardM.SendMsg -> GenericComm.SendMsg[17]; //Humidity Sensor Wire WeatherBoardM.ADCControl_Humidity -> SensirionHumidity.StdControl; WeatherBoardM.Humidity -> SensirionHumidity.Humidity; + //Photo Sensor wire + WeatherBoardM.ADCControl_Photo -> TaosPhoto.StdControl; + WeatherBoardM.LightChannel0 -> TaosPhoto.ADC[0]; + } Index: WeatherBoardM.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/sensordata/WeatherBoardM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WeatherBoardM.nc 22 Apr 2003 18:36:37 -0000 1.2 --- WeatherBoardM.nc 23 May 2003 00:57:14 -0000 1.3 *************** *** 64,69 **** interface StdControl as ADCControl_Humidity; interface ADC as Humidity; ! interface ADC as Temperature_Humidity; ! } } --- 64,72 ---- interface StdControl as ADCControl_Humidity; interface ADC as Humidity; ! ! //Photo Sensor ! interface StdControl as ADCControl_Photo; ! interface ADC as LightChannel0; ! } } *************** *** 80,84 **** call Leds.init(); call ADCControl_Humidity.init(); ! msg=&msg_buf; return SUCCESS; --- 83,87 ---- call Leds.init(); call ADCControl_Humidity.init(); ! msg=&msg_buf; return SUCCESS; *************** *** 93,110 **** command result_t StdControl.stop() { call ADCControl_Humidity.stop(); call Timer1.stop(); return SUCCESS; } - - /** - * When the clock fired, The sensor begin to sample. - * - * @author: Max - * @param: void - * @return: always return success - */ event result_t Timer1.fired() { call Humidity.getData(); --- 96,107 ---- command result_t StdControl.stop() { + call ADCControl_Photo.stop(); call ADCControl_Humidity.stop(); call Timer1.stop(); return SUCCESS; } + event result_t Timer1.fired() { call Humidity.getData(); *************** *** 112,123 **** return SUCCESS; } - - /** - * Humidity sensor have data ready - * - * @author: Max - * @param: void - * @return: always return success - */ event result_t Humidity.dataReady(uint16_t data) --- 109,112 ---- *************** *** 125,144 **** SensorMsg * sdata = (SensorMsg *)(msg_buf.data); sdata->HumidityData = data; ! call Temperature_Humidity.getData(); return SUCCESS; } ! event result_t Temperature_Humidity.dataReady(uint16_t data) { ! SensorMsg * sdata = (SensorMsg *)(msg_buf.data); ! sdata->TempData = data; ! sdata->MoteID= TOS_LOCAL_ADDRESS; ! call SendMsg.send(TOS_BCAST_ADDR, 6, msg); call Leds.yellowToggle(); - return SUCCESS; ! } ! event result_t SendMsg.sendDone(TOS_MsgPtr sent_msgptr, result_t success){ call Leds.redOff(); --- 114,136 ---- SensorMsg * sdata = (SensorMsg *)(msg_buf.data); sdata->HumidityData = data; ! call Leds.redToggle(); ! call ADCControl_Photo.init(); ! call ADCControl_Photo.start(); ! call LightChannel0.getData(); return SUCCESS; } ! event result_t LightChannel0.dataReady(uint16_t data) { ! char newdata = (char)(data & 0x0FF); ! msg->data[14] = newdata; ! call Leds.yellowToggle(); return SUCCESS; ! } ! ! ! event result_t SendMsg.sendDone(TOS_MsgPtr sent_msgptr, result_t success){ call Leds.redOff(); |