Contiki-Inga 3.x
Data Fields
sensors_sensor Struct Reference

Sensor defintion structure. More...

#include <core/lib/sensors.h>

Data Fields

char * type
 String name associated with sensor class. More...
 
int(* value )(int type)
 Get sensor value. More...
 
int(* configure )(int type, int value)
 Configure sensor. More...
 
int(* status )(int type)
 Get status of sensor. More...
 

Detailed Description

Sensor defintion structure.

Definition at line 131 of file sensors.h.

Field Documentation

int(* sensors_sensor::configure)(int type, int value)

Configure sensor.

Parameters
typeConfiguration type Beside standard types respective sensor implementations may define additional types.
valueValue to set for configuration type.
Return values
1if configuration succeeded
0if configuration failed or type is unknown

Definition at line 150 of file sensors.h.

int(* sensors_sensor::status)(int type)

Get status of sensor.

Parameters
typeOne of (SENSORS_ACTIVE, SENSORS_READY) or sensor-specific ones.
Returns
Return value defined for particular type
Return values
0if type is unknown

Definition at line 157 of file sensors.h.

char* sensors_sensor::type

String name associated with sensor class.

Definition at line 133 of file sensors.h.

Referenced by sensors_find().

int(* sensors_sensor::value)(int type)

Get sensor value.

Parameters
typeDetermines which value to read. Available types depend on the respective sensor implementation.
Returns
Integer sensor value associated with given type

Definition at line 140 of file sensors.h.