Updated *-sensor.c files from the sky platform.

Fixed battery-sensor plus added simple test (XXX)
This commit is contained in:
Enric M. Calvo 2011-02-18 16:12:56 +01:00
parent 1b2878baa4
commit 08adec2eeb
9 changed files with 340 additions and 50 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* @(#)$Id: radio-sensor.c,v 1.1 2010/08/24 16:26:38 joxe Exp $
* @(#)$Id: radio-sensor.c,v 1.7 2010/08/25 19:30:53 nifi Exp $
*/
#include "lib/sensors.h"
@ -36,6 +36,7 @@
#include "dev/radio-sensor.h"
const struct sensors_sensor radio_sensor;
static int active;
/*---------------------------------------------------------------------------*/
static int
@ -53,12 +54,21 @@ value(int type)
static int
configure(int type, int c)
{
if(type == SENSORS_ACTIVE) {
active = c;
return 1;
}
return 0;
}
/*---------------------------------------------------------------------------*/
static int
status(int type)
{
switch(type) {
case SENSORS_ACTIVE:
case SENSORS_READY:
return active;
}
return 0;
}
/*---------------------------------------------------------------------------*/