Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
dt_ctrl
Commits
d69c23a4
Commit
d69c23a4
authored
Sep 07, 2015
by
Jeroen Vreeken
Browse files
Add uint32 type to http server.
Add TRACK setpoint to http server.
parent
d054f3f1
Changes
1
Show whitespace changes
Inline
Side-by-side
console/console/console_httpd.c
View file @
d69c23a4
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment