Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
613ae4ee
Commit
613ae4ee
authored
Jul 13, 2016
by
Deomid Ryabkov
Committed by
Cesanta Bot
Jul 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix led toggline in CC3200 sensor demo
PUBLISHED_FROM=10369c7903f3c9433e8c9f6f9725f014aed5768d
parent
ab208b71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
10 deletions
+5
-10
data.c
examples/CC3200/data.c
+4
-9
wifi.c
examples/CC3200/wifi.c
+1
-1
No files found.
examples/CC3200/data.c
View file @
613ae4ee
...
@@ -96,17 +96,12 @@ static double send_acc_data_since(struct mg_connection *nc,
...
@@ -96,17 +96,12 @@ static double send_acc_data_since(struct mg_connection *nc,
static
void
process_command
(
struct
mg_connection
*
nc
,
unsigned
char
*
data
,
static
void
process_command
(
struct
mg_connection
*
nc
,
unsigned
char
*
data
,
size_t
len
)
{
size_t
len
)
{
// TODO(lsm): use proper JSON parser
// TODO(lsm): use proper JSON parser
int
cmd
,
n
,
val
;
int
cmd
,
val
;
double
t
;
if
(
sscanf
((
char
*
)
data
,
"{
\"
t
\"
:%d,
\"
v
\"
:%d}"
,
&
cmd
,
&
val
)
!=
2
)
{
if
(
sscanf
((
char
*
)
data
,
"{
\t\"
: %d,
\"
ts
\"
: %lf, %n"
,
&
cmd
,
&
t
,
&
n
)
!=
2
)
{
LOG
(
LL_ERROR
,
(
"Invalid request: %.*s"
,
(
int
)
len
,
data
));
LOG
(
LL_ERROR
,
(
"Invalid command: %.*s"
,
(
int
)
len
,
data
));
return
;
return
;
}
}
if
(
t
==
1
)
{
if
(
cmd
==
1
)
{
if
(
sscanf
((
char
*
)
data
+
n
,
"
\"
v
\"
: %d"
,
&
val
)
!=
1
)
{
LOG
(
LL_ERROR
,
(
"Missing value: %.*s"
,
(
int
)
len
,
data
));
return
;
}
switch
(
val
)
{
switch
(
val
)
{
case
'0'
:
{
case
'0'
:
{
GPIO_IF_LedOff
(
MCU_RED_LED_GPIO
);
GPIO_IF_LedOff
(
MCU_RED_LED_GPIO
);
...
...
examples/CC3200/wifi.c
View file @
613ae4ee
...
@@ -97,7 +97,7 @@ bool wifi_setup_ap(const char *ssid, const char *pass, int channel) {
...
@@ -97,7 +97,7 @@ bool wifi_setup_ap(const char *ssid, const char *pass, int channel) {
LOG
(
LL_ERROR
,
(
"DHCP server failed to start"
));
LOG
(
LL_ERROR
,
(
"DHCP server failed to start"
));
return
false
;
return
false
;
}
}
LOG
(
LL_INFO
,
(
"WiFi: AP %s configured"
,
ssid
));
LOG
(
LL_INFO
,
(
"WiFi: AP %s configured
, IP 192.168.4.1
"
,
ssid
));
return
true
;
return
true
;
}
}
...
...
Write
Preview
Markdown
is supported
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