Commit d69c23a4 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Add uint32 type to http server.

Add TRACK setpoint to http server.
parent d054f3f1
......@@ -740,6 +740,31 @@ static int callback_http(struct libwebsocket_context *context,
entry.type = COMMAND_PTYPE_SETPOINT;
vtype = COMMAND_VALUE_TYPE_BOOL;
}
if (!strcmp(type, "uint32")) {
unsigned v;
sscanf(rcv, "%*s %*s %*s %d", &v);
entry.value.u32 = v;
entry.type = COMMAND_PTYPE_SETPOINT;
vtype = COMMAND_VALUE_TYPE_UINT32;
}
if (!strcmp(type, "float")) {
float v;
char *vstr;
sscanf(rcv, "%*s %*s %*s %as", &vstr);
if (!strcmp(vstr, "TRACK")) {
entry.value.f = 0.0;
entry.type = COMMAND_PTYPE_SETPOINT_TRACK;
vtype = COMMAND_VALUE_TYPE_FLOAT;
} else {
sscanf(rcv, "%*s %*s %*s %f", &v);
entry.value.f = v;
entry.type = COMMAND_PTYPE_SETPOINT;
vtype = COMMAND_VALUE_TYPE_FLOAT;
}
free(vstr);
}
free(type);
command = get_command(name, "override", vtype);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment