3 * @brief Declarations for sensor thread related stuff
11 /** Number of sensors **/
14 /** Safety Values for sensors **/
15 //TODO: Probably better to use an array instead
16 #define ANALOG_TEST0_SAFETY 1000
17 #define ANALOG_TEST1_SAFETY 1000
18 #define DIGITAL_TEST0_SAFETY 1
19 #define DIGITAL_TEST1_SAFETY 1
32 /** Human readable names for the sensors **/
33 extern const char * g_sensor_names[NUMSENSORS];
36 /** Structure to represent a sensor **/
39 /** ID number of the sensor **/
41 /** DataFile to store sensor values in **/
43 /** Indicates whether the Sensor should record data **/
45 /** Thread the Sensor is running in **/
47 /** Most recently recorded data **/
48 DataPoint newest_data;
54 extern void Sensor_Init(); // One off initialisation of *all* sensors
56 extern void Sensor_StartAll(const char * experiment_name); // Start all Sensors recording data
57 extern void Sensor_StopAll(); // Stop all Sensors recording data
58 extern void Sensor_Start(Sensor * s, const char * experiment_name); // Start a sensor recording datas
59 extern void Sensor_Stop(Sensor * s); // Stop a Sensor from recording data
62 extern void * Sensor_Loop(void * args); // Main loop for a thread that handles a Sensor
63 extern bool Sensor_Read(Sensor * s, DataPoint * d); // Read a single DataPoint, indicating if it has changed since the last one
64 extern void Sensor_CheckData(SensorId id, DataPoint * d); // Check a DataPoint
65 extern Sensor * Sensor_Identify(const char * str); // Identify a Sensor from a string Id
67 extern void Sensor_Handler(FCGIContext *context, char * params); // Handle a FCGI request for Sensor data