-
- if (!strcmp(action, "gain")) {
- FCGI_BeginControl(context, force);
- } else {
- if (!FCGI_HasControl(context, key)) {
- FCGI_RejectJSONEx(context,
- STATUS_UNAUTHORIZED, "Invalid control key specified.");
-
- } else if (!strcmp(action, "release")) {
- FCGI_EndControl(context);
- } else if (!strcmp(action, "experiment")) {
- if (!strcmp(mode, "start")) {
- FCGI_BeginJSON(context, STATUS_OK);
- FCGI_JSONPair("description", mode);
- FCGI_EndJSON();
- } else if (!strcmp(mode, "pause")) {
- FCGI_BeginJSON(context, STATUS_OK);
- FCGI_JSONPair("description", mode);
- FCGI_EndJSON();
- } else if (!strcmp(mode, "stop")) {
- FCGI_BeginJSON(context, STATUS_OK);
- FCGI_JSONPair("description", mode);
- FCGI_EndJSON();
- } else {
- FCGI_RejectJSON(context, "Unknown experiment mode specified");
- }
+
+ if (!strcmp(action, "lock")) {
+ FCGI_LockControl(context, force);
+ } else if (FCGI_HasControl(context, key)) {
+ if (!strcmp(action, "release")) {
+ FCGI_ReleaseControl(context);
+ } else if (!strcmp(action, "start")) {
+ FCGI_BeginJSON(context, STATUS_OK);
+ FCGI_JSONPair("description", "start");
+ FCGI_EndJSON();
+ } else if (!strcmp(action, "pause")) {
+ FCGI_BeginJSON(context, STATUS_OK);
+ FCGI_JSONPair("description", "stop");
+ FCGI_EndJSON();
+ } else if (!strcmp(action, "end")) {
+ FCGI_BeginJSON(context, STATUS_OK);
+ FCGI_JSONPair("description", "stop");
+ FCGI_EndJSON();