Skip to content

Commit 40a84fc

Browse files
authored
Merge pull request #11359 from anttiylitokola/update-mbed-coap-to-5.0.0
Update mbed-coap to version 5.1.0
2 parents 159ee45 + 5f92db3 commit 40a84fc

File tree

5 files changed

+270
-97
lines changed

5 files changed

+270
-97
lines changed

features/frameworks/mbed-coap/CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
# Change Log
22

3-
## [v4.8.1(https://github.com/ARMmbed/mbed-coap/releases/tag/v4.8.1)
3+
## [v5.1.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v5.1.0)
4+
5+
- Introduce SN_COAP_REDUCE_BLOCKWISE_HEAP_FOOTPRINT configuration flag.
6+
Flag is disabled by default to keep the backward compatibility in place.
7+
If flag is enabled, application must NOT free the payload when it gets the COAP_STATUS_PARSER_BLOCKWISE_MSG_RECEIVED status.
8+
And application must call sn_coap_protocol_block_remove() instead.
9+
10+
-[Full Changelog](https://github.com/ARMmbed/mbed-coap/compare/v5.0.0...v5.1.0)
11+
12+
## [v5.0.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v5.0.0)
13+
14+
- Reduce heap footprint by storing only single block when receiving a blockwise message.
15+
* User is now responsible of freeing the data by calling sn_coap_protocol_block_remove() and must not free the payload separately.
16+
- Bug fix: Request blockwise transfer if incoming payload length is too large and when it comes without block indication.
17+
18+
-[Full Changelog](https://github.com/ARMmbed/mbed-coap/compare/v4.8.1...v5.0.0)
19+
20+
## [v4.8.1](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.8.1)
421
- Store ACK's also into duplicate info list.
522
- ROM size optimization. Flash size has gone down ~1100 bytes.
623

features/frameworks/mbed-coap/mbed-coap/sn_coap_header.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ typedef enum sn_coap_status_ {
157157
COAP_STATUS_PARSER_BLOCKWISE_ACK = 4, /**< Acknowledgement for sent Blockwise message received */
158158
COAP_STATUS_PARSER_BLOCKWISE_MSG_REJECTED = 5, /**< Blockwise message received but not supported by compiling switch */
159159
COAP_STATUS_PARSER_BLOCKWISE_MSG_RECEIVED = 6, /**< Blockwise message fully received and returned to app.
160-
User must take care of releasing whole payload of the blockwise messages */
160+
User is responsible of freeing the data by calling sn_coap_protocol_block_remove() */
161161
COAP_STATUS_BUILDER_MESSAGE_SENDING_FAILED = 7, /**< When re-transmissions have been done and ACK not received, CoAP library calls
162162
RX callback with this status */
163163

features/frameworks/mbed-coap/mbed-coap/sn_config.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,14 @@
260260
#define SN_COAP_BLOCKWISE_INTERNAL_BLOCK_2_HANDLING_ENABLED 1
261261
#endif
262262

263+
/**
264+
* \def SN_COAP_REDUCE_BLOCKWISE_HEAP_FOOTPRINT
265+
* \brief A heap optimization switch, which removes unnecessary copy of the blockwise data.
266+
* If enabled, application must NOT free the payload when it gets the COAP_STATUS_PARSER_BLOCKWISE_MSG_RECEIVED status.
267+
* Application must call sn_coap_protocol_block_remove() instead.
268+
*/
269+
#ifndef SN_COAP_REDUCE_BLOCKWISE_HEAP_FOOTPRINT
270+
#define SN_COAP_REDUCE_BLOCKWISE_HEAP_FOOTPRINT 0 /**< Disabled by default */
271+
#endif
272+
263273
#endif // SN_CONFIG_H

features/frameworks/mbed-coap/source/include/sn_coap_protocol_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ typedef struct coap_blockwise_payload_ {
9797

9898
uint16_t payload_len;
9999
uint8_t *payload_ptr;
100+
unsigned int use_size1:1;
100101

101102
ns_list_link_t link;
102103
} coap_blockwise_payload_s;

0 commit comments

Comments
 (0)