Use FCGI_INT_T instead of FCGI_LONG_T as appropriate
[matches/MCTX3420.git] / server / control.c
index e883eb1..1f33eea 100644 (file)
@@ -5,13 +5,10 @@
 #include "common.h"
 #include "control.h"
 
-const char * g_actuator_names[NUMACTUATORS] = {        
-       "Pressure regulator", "Solenoid 1" 
-};                                                                                     
 
 /**
  * Handles control of the actuators.
- */
+ *
 void ActuatorHandler(FCGIContext *context, ActuatorId id, const char *set_value) {
        char *ptr;
        
@@ -41,7 +38,7 @@ void ActuatorHandler(FCGIContext *context, ActuatorId id, const char *set_value)
                                FCGI_JSONValue("\"Solenoid 1 turned %s!\"", state);
                                FCGI_EndJSON();
                        } else {
-                               FCGI_RejectJSON(context);
+                               FCGI_RejectJSON(context, "Invalid actuator value specified");
                        }
                } break;
                default:
@@ -49,6 +46,7 @@ void ActuatorHandler(FCGIContext *context, ActuatorId id, const char *set_value)
                                STATUS_ERROR, "Invalid actuator id specified.");
        }
 }
+*/
 
 /**
  * System control handler. This covers control over all aspects of the system.
@@ -79,9 +77,10 @@ void Control_Handler(FCGIContext *context, char *params) {
                        set_value = value;
                }
        }
+       Log(LOGDEBUG, "Id %d", id); // to stop compiler complaining for now
        
        if (action == NULL) { //Must have an action
-               FCGI_RejectJSON(context);
+               FCGI_RejectJSON(context, "No action specified");
        } else if (!strcmp(action, "start")) {
                FCGI_BeginControl(context, force);
        } else if (!strcmp(action, "stop")) { //Don't require control key to stop...
@@ -99,8 +98,9 @@ void Control_Handler(FCGIContext *context, char *params) {
                        if (set_value == NULL || *set_value == '\0') {
                                FCGI_RejectJSONEx(context, 
                                        STATUS_ERROR, "Set called but no value specified.");
-                       } else {
-                               ActuatorHandler(context, id, set_value);
+                       } else 
+                       {
+//                             ActuatorHandler(context, id, set_value);
                        }
                }
        }

UCC git Repository :: git.ucc.asn.au