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
aaf4802d
Commit
aaf4802d
authored
Mar 31, 2016
by
Deomid Ryabkov
Committed by
rojer
Apr 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add file upload to CC3200 example
PUBLISHED_FROM=126bfdb9369f4bc2f09a21400caf797d995bef5b
parent
96310d76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
main.c
examples/CC3200/main.c
+15
-2
No files found.
examples/CC3200/main.c
View file @
aaf4802d
...
...
@@ -88,8 +88,16 @@ struct temp_data {
static
struct
temp_data
s_temp_data
;
static
struct
mg_str
upload_fname
(
struct
mg_connection
*
nc
,
struct
mg_str
fname
)
{
struct
mg_str
lfn
;
lfn
.
len
=
fname
.
len
+
3
;
lfn
.
p
=
malloc
(
lfn
.
len
);
memcpy
((
char
*
)
lfn
.
p
,
"SL:"
,
3
);
memcpy
((
char
*
)
lfn
.
p
+
3
,
fname
.
p
,
fname
.
len
);
return
lfn
;
}
static
void
mg_ev_handler
(
struct
mg_connection
*
nc
,
int
ev
,
void
*
p
)
{
LOG
(
LL_DEBUG
,
(
"Ev: %d"
,
ev
));
switch
(
ev
)
{
case
MG_EV_ACCEPT
:
{
char
addr
[
32
];
...
...
@@ -138,6 +146,11 @@ static void mg_ev_handler(struct mg_connection *nc, int ev, void *p) {
bm222_get_data
(
s_accel_ctx
);
nc
->
ev_timer_time
=
mg_time
()
+
(
DATA_SAMPLING_INTERVAL_MS
*
0
.
001
);
}
case
MG_EV_HTTP_PART_BEGIN
:
case
MG_EV_HTTP_PART_DATA
:
case
MG_EV_HTTP_PART_END
:
{
mg_file_upload_handler
(
nc
,
ev
,
p
,
upload_fname
);
}
}
}
...
...
@@ -287,7 +300,7 @@ static void mg_task(void *arg) {
LOG
(
LL_INFO
,
(
"MG task running"
));
GPIO_IF_LedToggle
(
MCU_RED_LED_GPIO
);
osi_MsgQCreate
(
&
s_v7_q
,
"
MG
"
,
sizeof
(
struct
event
),
32
/* len */
);
osi_MsgQCreate
(
&
s_v7_q
,
"
V7
"
,
sizeof
(
struct
event
),
32
/* len */
);
sl_Start
(
NULL
,
NULL
,
NULL
);
if
(
!
tmp006_init
(
TMP006_ADDR
,
TMP006_CONV_2
,
false
))
{
...
...
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