Skip to content

Commit d2f00a0

Browse files
authored
Merge pull request #6171 from anttiylitokola/master
Update mbed-coap to version 4.3.0
2 parents 4e7ad0d + 1b27317 commit d2f00a0

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

features/FEATURE_COMMON_PAL/mbed-coap/CHANGELOG.md

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

3+
## [v4.3.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.3.0)
4+
**New feature:**
5+
- Add new API which clears the whole sent blockwise message list
6+
7+
-[Full Changelog](https://github.com/ARMmbed/mbed-coap/compare/v4.2.0...v4.3.0)
8+
39
## [v4.2.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.2.0)
410
**New feature:**
511
- Add new API to remove sent blockwise message from the linked list

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,15 @@ extern int8_t sn_coap_convert_block_size(uint16_t block_size);
247247
*/
248248
extern int8_t sn_coap_protocol_handle_block2_response_internally(struct coap_s *handle, uint8_t handle_response);
249249

250+
/**
251+
* \fn void sn_coap_protocol_clear_sent_blockwise_messages(struct coap_s *handle)
252+
*
253+
* \brief This function clears all the sent blockwise messages from the linked list.
254+
*
255+
* \param *handle Pointer to CoAP library handle
256+
*/
257+
extern void sn_coap_protocol_clear_sent_blockwise_messages(struct coap_s *handle);
258+
250259
#endif /* SN_COAP_PROTOCOL_H_ */
251260

252261
#ifdef __cplusplus

features/FEATURE_COMMON_PAL/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.2.0",
3+
"version": "4.3.0",
44
"description": "COAP library",
55
"keywords": [
66
"coap",

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,27 @@ int8_t sn_coap_protocol_set_block_size(struct coap_s *handle, uint16_t block_siz
256256

257257
}
258258

259+
void sn_coap_protocol_clear_sent_blockwise_messages(struct coap_s *handle)
260+
{
261+
(void) handle;
262+
#if SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE
263+
if (handle == NULL) {
264+
return;
265+
}
266+
267+
/* Loop all stored Blockwise messages in Linked list */
268+
ns_list_foreach_safe(coap_blockwise_msg_s, removed_blocwise_msg_ptr, &handle->linked_list_blockwise_sent_msgs) {
269+
if (removed_blocwise_msg_ptr->coap_msg_ptr) {
270+
handle->sn_coap_protocol_free(removed_blocwise_msg_ptr->coap_msg_ptr->payload_ptr);
271+
removed_blocwise_msg_ptr->coap_msg_ptr->payload_ptr = 0;
272+
sn_coap_parser_release_allocated_coap_msg_mem(handle, removed_blocwise_msg_ptr->coap_msg_ptr);
273+
removed_blocwise_msg_ptr->coap_msg_ptr = 0;
274+
}
275+
sn_coap_protocol_linked_list_blockwise_msg_remove(handle, removed_blocwise_msg_ptr);
276+
}
277+
#endif
278+
}
279+
259280
int8_t sn_coap_protocol_set_duplicate_buffer_size(struct coap_s *handle, uint8_t message_count)
260281
{
261282
(void) handle;

0 commit comments

Comments
 (0)