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