Skip to content

Commit 2c296fc

Browse files
author
Cruz Monrreal
authored
Merge pull request #8273 from anttiylitokola/mbed-coap-4.7.0
Update mbed-coap to version 4.7.0
2 parents 6e8d9f0 + 4c692c6 commit 2c296fc

File tree

5 files changed

+36
-8
lines changed

5 files changed

+36
-8
lines changed

features/frameworks/mbed-coap/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## [v4.7.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.7.0)
4+
5+
- Add function that can be used to clear the received blockwise payloads for example in the case of a connection error.
6+
- Silence compiler warning when CoAP duplicate detection is enabled.
7+
8+
-[Full Changelog](https://github.com/ARMmbed/mbed-coap/compare/v4.6.3...v4.7.0)
9+
310
## [v4.6.3](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.6.3)
411

512
- Bug fix: Remove timed out blockwise message from resend queue. If blockwise message was timed out message was still kept in the resend queue which causes unnecessary reconnections on client side.

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,15 @@ extern int8_t sn_coap_protocol_handle_block2_response_internally(struct coap_s *
268268
*/
269269
extern void sn_coap_protocol_clear_sent_blockwise_messages(struct coap_s *handle);
270270

271+
/**
272+
* \fn void sn_coap_protocol_clear_received_blockwise_messages(struct coap_s *handle)
273+
*
274+
* \brief This function clears all the received blockwise messages from the linked list.
275+
*
276+
* \param *handle Pointer to CoAP library handle
277+
*/
278+
extern void sn_coap_protocol_clear_received_blockwise_messages(struct coap_s *handle);
279+
271280
/**
272281
* \fn void sn_coap_protocol_send_rst(struct coap_s *handle, uint16_t msg_id, sn_nsdl_addr_s *addr_ptr, void *param)
273282
*

features/frameworks/mbed-coap/module.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mbed-coap",
3-
"version": "4.6.3",
3+
"version": "4.7.0",
44
"description": "COAP library",
55
"keywords": [
66
"coap",

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,16 @@ struct sn_coap_hdr_;
8181

8282
/* Init value for the maximum count of messages to be stored for duplication detection */
8383
/* Setting of this value to 0 will disable duplication check, also reduce use of ROM memory */
84-
85-
// Keep the old flag to maintain backward compatibility
86-
#ifndef SN_COAP_DUPLICATION_MAX_MSGS_COUNT
87-
#define SN_COAP_DUPLICATION_MAX_MSGS_COUNT 0
88-
#endif
89-
9084
#ifdef YOTTA_CFG_COAP_DUPLICATION_MAX_MSGS_COUNT
9185
#define SN_COAP_DUPLICATION_MAX_MSGS_COUNT YOTTA_CFG_COAP_DUPLICATION_MAX_MSGS_COUNT
9286
#elif defined MBED_CONF_MBED_CLIENT_SN_COAP_DUPLICATION_MAX_MSGS_COUNT
9387
#define SN_COAP_DUPLICATION_MAX_MSGS_COUNT MBED_CONF_MBED_CLIENT_SN_COAP_DUPLICATION_MAX_MSGS_COUNT
9488
#endif
9589

96-
90+
// Keep the old flag to maintain backward compatibility
91+
#ifndef SN_COAP_DUPLICATION_MAX_MSGS_COUNT
92+
#define SN_COAP_DUPLICATION_MAX_MSGS_COUNT 0
93+
#endif
9794

9895
/* Maximum allowed number of saved messages for duplicate searching */
9996
#define SN_COAP_MAX_ALLOWED_DUPLICATION_MESSAGE_COUNT 6

features/frameworks/mbed-coap/source/sn_coap_protocol.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,21 @@ void sn_coap_protocol_clear_sent_blockwise_messages(struct coap_s *handle)
257257
#endif
258258
}
259259

260+
void sn_coap_protocol_clear_received_blockwise_messages(struct coap_s *handle)
261+
{
262+
(void) handle;
263+
#if SN_COAP_BLOCKWISE_ENABLED || SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE
264+
if (handle == NULL) {
265+
return;
266+
}
267+
268+
/* Loop all stored Blockwise messages in Linked list */
269+
ns_list_foreach_safe(coap_blockwise_payload_s, removed_blockwise_payload_ptr, &handle->linked_list_blockwise_received_payloads) {
270+
sn_coap_protocol_linked_list_blockwise_payload_remove(handle, removed_blockwise_payload_ptr);
271+
}
272+
#endif
273+
}
274+
260275
int8_t sn_coap_protocol_set_duplicate_buffer_size(struct coap_s *handle, uint8_t message_count)
261276
{
262277
(void) handle;

0 commit comments

Comments
 (0)