4 * @purpose Declarations for sensor thread related stuff
14 /** Number of data points to keep in sensor buffers **/
15 #define SENSOR_DATABUFSIZ 10
18 /** Number of sensors **/
21 /** Structure to represent data recorded by a sensor at an instant in time **/
24 /** Time at which data was taken **/
30 /** Structure to represent a sensor **/
33 /** ID number of the sensor **/
34 enum {SENSOR_TEST0=0, SENSOR_TEST1=1} id;
35 /** Buffer to store data from the sensor **/
36 DataPoint buffer[SENSOR_DATABUFSIZ];
37 /** Index of last point written in the data buffer **/
39 /** Offset position in binary file for query thread to read from**/
41 /** File to write data into when buffer is full **/
43 /** Thread running the sensor **/
45 /** Mutex to protect access to stuff **/
46 pthread_mutex_t mutex;
51 /** Array of Sensors **/
52 extern Sensor g_sensors[];
54 extern void Sensor_Init(Sensor * s, int id); // Initialise sensor
55 extern void * Sensor_Main(void * args); // main loop for sensor thread; pass a Sensor* cast to void*