X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fcontrol.h;h=e6230332cf5215231f77b4ff2d5ff9d8224c36f8;hb=d8f9f2fbcc99d1f894e3f4c4f2a16ec18e79b14a;hp=188b13aa785205287674fa9bd4a0fb12a8dd60c8;hpb=9e7cfbbc6137056bba8ed8644fc6ecfe398553fe;p=matches%2FMCTX3420.git diff --git a/server/control.h b/server/control.h index 188b13a..e623033 100644 --- a/server/control.h +++ b/server/control.h @@ -5,14 +5,31 @@ #ifndef _CONTROL_H #define _CONTROL_H -/** ID codes for all the actuators **/ +/** + * The possible experiment control modes that the server can be in. + * At present, CONTROL_EMERGENCY largely does nothing. TODO: Fix this + */ +typedef enum ControlModes { + CONTROL_START, + CONTROL_PAUSE, + CONTROL_RESUME, + CONTROL_STOP, + CONTROL_EMERGENCY +} ControlModes; + +/** Invalid filename characters **/ +#define INVALID_CHARACTERS "\"*/:<>?\\|. " +/** The same as INVALID_CHARACTERS, except escaped for use in JSON strings **/ +#define INVALID_CHARACTERS_JSON "\\\"*/:<>?\\\\|. " +/** The username of a user with no authentication (DEBUG ONLY) **/ +#define NOAUTH_USERNAME "_anonymous_noauth" + extern void Control_Handler(FCGIContext *context, char *params); -extern bool Control_Start(const char *experiment_name); -extern bool Control_Pause(); -extern bool Control_Resume(); -extern bool Control_Stop(); -extern bool Control_Lock(); -extern void Control_Unlock(); -extern const struct timeval* Control_GetStartTime(); +extern const char* Control_SetMode(ControlModes desired_mode, void * arg); +//extern ControlModes Control_GetMode(); +extern const char * Control_GetModeName(); +//extern bool Control_Lock(); +//extern void Control_Unlock(); +extern const struct timespec* Control_GetStartTime(); #endif