Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
authorJeremy Tan <[email protected]>
Sat, 14 Sep 2013 03:04:12 +0000 (11:04 +0800)
committerJeremy Tan <[email protected]>
Sat, 14 Sep 2013 03:04:12 +0000 (11:04 +0800)
Conflicts:
server/control.c

1  2 
server/fastcgi.c

diff --combined server/fastcgi.c
@@@ -12,6 -12,7 +12,7 @@@
  
  #include "common.h"
  #include "sensor.h"
+ #include "actuator.h"
  #include "control.h"
  #include "options.h"
  
@@@ -39,14 -40,24 +40,14 @@@ struct FCGIContext 
   */ 
  static void IdentifyHandler(FCGIContext *context, char *params) {
        bool ident_sensors = false, ident_actuators = false;
 -      //const char *key, *value;
  
        int i;
  
        FCGIValue values[2] = {{"sensors", &ident_sensors, FCGI_BOOL_T},
                                         {"actuators", &ident_actuators, FCGI_BOOL_T}};
 -
        if (!FCGI_ParseRequest(context, params, values, 2))
                return;
  
 -      /*while ((params = FCGI_KeyPair(params, &key, &value))) {
 -              if (!strcmp(key, "sensors")) {
 -                      ident_sensors = !ident_sensors;
 -              } else if (!strcmp(key, "actuators")) {
 -                      ident_actuators = !ident_actuators;
 -              }
 -      }*/
 -
        FCGI_BeginJSON(context, STATUS_OK);
        FCGI_JSONPair("description", "MCTX3420 Server API (2013)");
        FCGI_JSONPair("build_date", __DATE__ " " __TIME__);
@@@ -457,6 -468,8 +458,8 @@@ void * FCGI_RequestLoop (void *data
                        module_handler = Control_Handler;
                } else if (!strcmp("sensors", module)) {
                        module_handler = Sensor_Handler;
+               } else if (!strcmp("actuators", module)) {
+                       module_handler = Actuator_Handler;
                }
  
                context.current_module = module;

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