Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ICBM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
detectors
DSSC
ICBM
Commits
b5de2ddc
Commit
b5de2ddc
authored
1 week ago
by
Cyril Danilevski
Browse files
Options
Downloads
Patches
Plain Diff
Set correct mime-type for json data
parent
562f55e0
No related branches found
No related tags found
No related merge requests found
Pipeline
#167689
passed
1 week ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rest.cpp
+15
-11
15 additions, 11 deletions
rest.cpp
with
15 additions
and
11 deletions
rest.cpp
+
15
−
11
View file @
b5de2ddc
...
...
@@ -91,7 +91,7 @@ void identify() {
message
+=
"
\n
}"
;
restServer
.
send
(
418
,
"
text
/json"
,
message
);
restServer
.
send
(
418
,
"
application
/json"
,
message
);
}
void
panel
()
{
...
...
@@ -117,7 +117,7 @@ void notFound() {
}
message
+=
"
\n
}
\n
}"
;
restServer
.
send
(
404
,
"
text
/json"
,
message
);
restServer
.
send
(
404
,
"
application
/json"
,
message
);
Serial
.
println
(
message
);
}
...
...
@@ -134,7 +134,8 @@ enum {
void
sendSNMP
()
{
if
(
PINS
.
ramping
)
{
restServer
.
send
(
403
,
"text/json"
,
"{
\"
success
\"
: 0,
\"
reason
\"
:
\"
ramping ongoing
\"
}"
);
restServer
.
send
(
403
,
"application/json"
,
"{
\"
success
\"
: 0,
\"
reason
\"
:
\"
ramping ongoing
\"
}"
);
return
;
}
uint8_t
output
=
NONE
;
...
...
@@ -180,21 +181,23 @@ void sendSNMP() {
http_msg
+=
"
\n
}"
;
restServer
.
send
(
success
?
200
:
406
,
"
text
/json"
,
http_msg
);
restServer
.
send
(
success
?
200
:
406
,
"
application
/json"
,
http_msg
);
}
void
getMpodStatus
()
{
if
(
PINS
.
ramping
)
{
restServer
.
send
(
403
,
"text/json"
,
"{
\"
success
\"
: 0,
\"
reason
\"
:
\"
ramping ongoing
\"
}"
);
restServer
.
send
(
403
,
"application/json"
,
"{
\"
success
\"
: 0,
\"
reason
\"
:
\"
ramping ongoing
\"
}"
);
return
;
}
restServer
.
send
(
200
,
"
text
/json"
,
pproc
.
toJSON
());
restServer
.
send
(
200
,
"
application
/json"
,
pproc
.
toJSON
());
}
void
powerGroup
()
{
if
(
PINS
.
ramping
)
{
restServer
.
send
(
403
,
"text/json"
,
"{
\"
success
\"
: 0,
\"
reason
\"
:
\"
ramping ongoing
\"
}"
);
restServer
.
send
(
403
,
"application/json"
,
"{
\"
success
\"
: 0,
\"
reason
\"
:
\"
ramping ongoing
\"
}"
);
return
;
}
String
output
;
...
...
@@ -247,12 +250,13 @@ void powerGroup() {
}
http_msg
+=
"
\n
}"
;
restServer
.
send
(
success
?
200
:
406
,
"
text
/json"
,
http_msg
);
restServer
.
send
(
success
?
200
:
406
,
"
application
/json"
,
http_msg
);
}
void
powerAllOff
()
{
if
(
PINS
.
ramping
)
{
restServer
.
send
(
403
,
"text/json"
,
"{
\"
success
\"
: 0,
\"
reason
\"
:
\"
ramping ongoing
\"
}"
);
restServer
.
send
(
403
,
"application/json"
,
"{
\"
success
\"
: 0,
\"
reason
\"
:
\"
ramping ongoing
\"
}"
);
return
;
}
String
group
;
...
...
@@ -290,7 +294,7 @@ void powerAllOff() {
// }
http_msg
+=
"
\n
}"
;
restServer
.
send
(
success
?
200
:
406
,
"
text
/json"
,
http_msg
);
restServer
.
send
(
success
?
200
:
406
,
"
application
/json"
,
http_msg
);
}
void
pollMPODChannel
()
{
...
...
@@ -328,5 +332,5 @@ void pollMPODChannel() {
http_msg
+=
ret
;
http_msg
+=
"}"
;
restServer
.
send
(
channel
?
200
:
406
,
"
text
/json"
,
http_msg
);
restServer
.
send
(
channel
?
200
:
406
,
"
application
/json"
,
http_msg
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment