3 * @brief Declarations for sensor thread related stuff
9 /** Number of data points to keep in sensor buffers **/
10 #define SENSOR_DATABUFSIZ 10
12 #define SENSOR_QUERYBUFSIZ 10
14 /** Number of sensors **/
17 typedef enum SensorId{
24 extern const char * g_sensor_names[NUMSENSORS];
26 /** Structure to represent data recorded by a sensor at an instant in time **/
29 /** Time at which data was taken **/
35 /** Structure to represent a sensor **/
38 /** ID number of the sensor **/
40 /** Buffer to store data from the sensor **/
41 DataPoint buffer[SENSOR_DATABUFSIZ];
42 /** Index of last point written in the data buffer **/
44 /** Number of points read **/
46 /** Binary file to write data into when buffer is full **/
48 /** Thread running the sensor **/
50 /** Mutex to protect access to stuff **/
51 pthread_mutex_t mutex;
59 extern void Sensor_Spawn(); // Initialise sensor
60 extern void Sensor_Join(); //Join sensor threads
61 extern void * Sensor_Main(void * args); // main loop for sensor thread; pass a Sensor* cast to void*
63 extern int Sensor_Query(Sensor * s, DataPoint * buffer, int bufsiz); // fill buffer with sensor data
65 extern void Sensor_Handler(FCGIContext *context, char * params);