Contiki 2.5
pir-sensor.c
1 
2 #include "dev/pir-sensor.h"
3 
4 const struct sensors_sensor pir_sensor;
5 
6 static int pir_value;
7 
8 /*---------------------------------------------------------------------------*/
9 void
10 pir_sensor_changed(int strength)
11 {
12  pir_value += strength;
13  sensors_changed(&pir_sensor);
14 }
15 /*---------------------------------------------------------------------------*/
16 static unsigned int
17 value(int type)
18 {
19  return pir_value;
20 }
21 /*---------------------------------------------------------------------------*/
22 static int
23 configure(int type, void *c)
24 {
25  return 0;
26 }
27 /*---------------------------------------------------------------------------*/
28 static void *
29 status(int type)
30 {
31  return NULL;
32 }
33 /*---------------------------------------------------------------------------*/
34 SENSORS_SENSOR(pir_sensor, PIR_SENSOR,
35  value, configure, status);