3 * @brief Declarations for actuator control
12 //NOTE: Functionality is very similar to Sensor stuff
13 // BUT it's probably very unwise to try and generalise Sensors and Actuators to the same thing (ie: Device)
14 // Might be OK in C++ but not easy in C
16 /** Number of actuators **/
17 #define NUMACTUATORS 3
19 /** List of actuator ids (should be of size NUMACTUATORS) **/
27 /** Human readable names for the Actuators **/
28 extern const char * g_actuator_names[NUMACTUATORS];
30 /** Control structure for Actuator setting **/
33 //TODO: Add functionality as needed
34 /** Simple value for Actuator **/
40 /** ID number of the actuator **/
42 /** Control parameters for the Actuator **/
43 ActuatorControl control;
44 /** Flag indicates if ActuatorControl has been changed **/
46 /** DataFile to store actuator settings **/
48 /** Thread the Actuator is controlled by **/
50 /** Mutex around ActuatorControl **/
51 pthread_mutex_t mutex;
52 /** Used to wake up Actuator control thread **/
54 /** Indicates whether the Actuator is running **/
59 extern void Actuator_Init(); // One off initialisation of *all* Actuators
61 extern void Actuator_SetModeAll(ControlModes mode, void *arg);
62 extern void Actuator_SetMode(Actuator * a, ControlModes mode, void *arg);
64 extern void * Actuator_Loop(void * args); // Main loop for a thread that handles an Actuator
65 extern void Actuator_SetValue(Actuator * a, double value); // Set an actuator by value
66 extern void Actuator_SetControl(Actuator * a, ActuatorControl * c); // Set the control for an Actuator
67 extern Actuator * Actuator_Identify(const char * str); // Identify a Sensor from a string Id
69 extern void Actuator_Handler(FCGIContext *context, char * params); // Handle a FCGI request for Actuator control