3 * @brief Declarations for sensor thread related stuff
9 /** Number of data points to keep in sensor buffers **/
10 #define SENSOR_DATABUFSIZ 10
11 /** Size of the query buffer. @see Sensor_Handler **/
12 #define SENSOR_QUERYBUFSIZ 10
14 /** Number of sensors **/
17 typedef enum SensorId {
24 /** Human readable names for the sensors **/
25 extern const char * g_sensor_names[NUMSENSORS];
27 /** Structure to represent data recorded by a sensor at an instant in time **/
30 /** Time at which data was taken **/
36 /** Structure to represent a sensor **/
39 /** ID number of the sensor **/
41 /** Buffer to store data from the sensor **/
42 DataPoint buffer[SENSOR_DATABUFSIZ];
43 /** Index of last point written in the data buffer **/
45 /** Number of points read **/
47 /** Binary file to write data into when buffer is full **/
49 /** Thread running the sensor **/
51 /** Mutex to protect access to stuff **/
52 pthread_mutex_t mutex;
60 extern void Sensor_Spawn(); // Initialise sensor
61 extern void Sensor_Join(); //Join sensor threads
62 extern void * Sensor_Main(void * args); // main loop for sensor thread; pass a Sensor* cast to void*
64 extern int Sensor_Query(Sensor * s, DataPoint * buffer, int bufsiz); // fill buffer with sensor data
66 extern void Sensor_Handler(FCGIContext *context, char * params);