Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
340edbbe
Commit
340edbbe
authored
Nov 12, 2015
by
Johny Mattsson
Browse files
Merge pull request #750 from lukaszo/coap-deb
Fix sending CoAP UDP response using new SDK 1.4.0
parents
7ef1711e
982be36a
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/coap.c
View file @
340edbbe
...
@@ -49,6 +49,15 @@ static void coap_received(void *arg, char *pdata, unsigned short len)
...
@@ -49,6 +49,15 @@ static void coap_received(void *arg, char *pdata, unsigned short len)
// c_memcpy(buf, pdata, len);
// c_memcpy(buf, pdata, len);
size_t
rsplen
=
coap_server_respond
(
pdata
,
len
,
buf
,
MAX_MESSAGE_SIZE
+
1
);
size_t
rsplen
=
coap_server_respond
(
pdata
,
len
,
buf
,
MAX_MESSAGE_SIZE
+
1
);
// SDK 1.4.0 changed behaviour, for UDP server need to look up remote ip/port
remot_info
*
pr
=
0
;
if
(
espconn_get_connection_info
(
pesp_conn
,
&
pr
,
0
)
!=
ESPCONN_OK
)
return
;
pesp_conn
->
proto
.
udp
->
remote_port
=
pr
->
remote_port
;
os_memmove
(
pesp_conn
->
proto
.
udp
->
remote_ip
,
pr
->
remote_ip
,
4
);
// The remot_info apparently should *not* be os_free()d, fyi
espconn_sent
(
pesp_conn
,
(
unsigned
char
*
)
buf
,
rsplen
);
espconn_sent
(
pesp_conn
,
(
unsigned
char
*
)
buf
,
rsplen
);
// c_memset(buf, 0, sizeof(buf));
// c_memset(buf, 0, sizeof(buf));
...
...
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