osd-contiki/platform/netsim/dev/pir-sensor.c

36 lines
816 B
C
Raw Normal View History

#include "dev/pir-sensor.h"
const struct sensors_sensor pir_sensor;
static int pir_value;
/*---------------------------------------------------------------------------*/
void
pir_sensor_changed(int strength)
{
pir_value += strength;
sensors_changed(&pir_sensor);
}
/*---------------------------------------------------------------------------*/
2010-02-23 19:43:43 +01:00
static int
value(int type)
{
return pir_value;
}
/*---------------------------------------------------------------------------*/
static int
2010-02-23 19:43:43 +01:00
configure(int type, int c)
{
return 0;
}
/*---------------------------------------------------------------------------*/
2010-02-23 19:43:43 +01:00
static int
status(int type)
{
2010-02-23 19:43:43 +01:00
return 0;
}
/*---------------------------------------------------------------------------*/
SENSORS_SENSOR(pir_sensor, PIR_SENSOR,
value, configure, status);