+ ActuatorControl c = {0.0, 0.0, 0.0, 0}; // Need to set default values (since we don't require them all)
+ // sscanf returns the number of fields successfully read...
+ int n = sscanf(set, "%lf,%lf,%lf,%d", &(c.start), &(c.stepwait), &(c.stepsize), &(c.steps)); // Set provided values in order
+ if (n != 4)
+ {
+ // If the user doesn't provide all 4 values, the Actuator will get set *once* using the first of the provided values
+ // (see Actuator_Loop)
+ // Not really a problem if n = 1, but maybe generate a warning for 2 <= n < 4 ?
+ Log(LOGDEBUG, "Only provided %d values (expect %d) for Actuator setting", n);
+ }
+ // SANITY CHECKS
+ if (c.stepwait < 0 || c.steps < 0 || (a->sanity != NULL && !a->sanity(a->user_id, c.start)))
+ {
+ FCGI_RejectJSON(context, "Bad Actuator setting");
+ return;
+ }