mirror of
https://github.com/espressif/openthread.git
synced 2026-07-29 23:27:46 +00:00
[coap] process CoAP header in message (#3419)
This commit refines Coap::Header into Coap::Message to avoid declaring the big Coap::Header in stack which was causing problems in low-memory systems such as CC2538. A UDP reserves 56 bytes by default, which will not be used before an outbound message goes down to transport layer and after an inbound message is delievered to CoAP agent. To get better performance, this commit utilizes these reserved bytes of cache basic header of CoAP message including CoAP version, code, message ID and token. These cached data are parsed when CoAP agent receives a CoAP message and are dumped into the correct place of a CoAP Message before sending by lower layer. To make sure there is enough reserved bytes for an inbound message, This commit removes headers in UDP layer before delivering a ot::Message to handlers.
This commit is contained in:
+1
-1
@@ -109,7 +109,7 @@ LOCAL_SRC_FILES := \
|
||||
src/core/api/thread_ftd_api.cpp \
|
||||
src/core/api/udp_api.cpp \
|
||||
src/core/coap/coap.cpp \
|
||||
src/core/coap/coap_header.cpp \
|
||||
src/core/coap/coap_message.cpp \
|
||||
src/core/coap/coap_secure.cpp \
|
||||
src/core/common/crc16.cpp \
|
||||
src/core/common/instance.cpp \
|
||||
|
||||
Reference in New Issue
Block a user