3 * @brief Declarations for sensor thread related stuff
10 /** Number of data points to keep in sensor buffers **/
11 #define SENSOR_DATABUFSIZ 10
13 #define SENSOR_QUERYBUFSIZ 10
15 /** Number of sensors **/
19 /** Structure to represent data recorded by a sensor at an instant in time **/
22 /** Time at which data was taken **/
28 /** Structure to represent a sensor **/
31 /** ID number of the sensor **/
32 enum {ANALOG_TEST0=2, ANALOG_TEST1=0, DIGITAL_TEST0=1, DIGITAL_TEST1=3} id;
33 /** Buffer to store data from the sensor **/
34 DataPoint buffer[SENSOR_DATABUFSIZ];
35 /** Index of last point written in the data buffer **/
37 /** Number of points read **/
39 /** Binary file to write data into when buffer is full **/
41 /** Thread running the sensor **/
43 /** Mutex to protect access to stuff **/
44 pthread_mutex_t mutex;
52 extern void Sensor_Spawn(); // Initialise sensor
53 extern void Sensor_Join(); //Join sensor threads
54 extern void * Sensor_Main(void * args); // main loop for sensor thread; pass a Sensor* cast to void*
56 extern int Sensor_Query(Sensor * s, DataPoint * buffer, int bufsiz); // fill buffer with sensor data
58 extern void Sensor_Handler(FCGIContext *context, char * params);