Skip to content

Update mbed-coap to version 4.3.0 #6171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions features/FEATURE_COMMON_PAL/mbed-coap/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## [v4.3.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.3.0)
**New feature:**
- Add new API which clears the whole sent blockwise message list

-[Full Changelog](https://github.com/ARMmbed/mbed-coap/compare/v4.2.0...v4.3.0)

## [v4.2.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.2.0)
**New feature:**
- Add new API to remove sent blockwise message from the linked list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,15 @@ extern int8_t sn_coap_convert_block_size(uint16_t block_size);
*/
extern int8_t sn_coap_protocol_handle_block2_response_internally(struct coap_s *handle, uint8_t handle_response);

/**
* \fn void sn_coap_protocol_clear_sent_blockwise_messages(struct coap_s *handle)
*
* \brief This function clears all the sent blockwise messages from the linked list.
*
* \param *handle Pointer to CoAP library handle
*/
extern void sn_coap_protocol_clear_sent_blockwise_messages(struct coap_s *handle);

#endif /* SN_COAP_PROTOCOL_H_ */

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion features/FEATURE_COMMON_PAL/mbed-coap/module.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mbed-coap",
"version": "4.2.0",
"version": "4.3.0",
"description": "COAP library",
"keywords": [
"coap",
Expand Down
21 changes: 21 additions & 0 deletions features/FEATURE_COMMON_PAL/mbed-coap/source/sn_coap_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,27 @@ int8_t sn_coap_protocol_set_block_size(struct coap_s *handle, uint16_t block_siz

}

void sn_coap_protocol_clear_sent_blockwise_messages(struct coap_s *handle)
{
(void) handle;
#if SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE
if (handle == NULL) {
return;
}

/* Loop all stored Blockwise messages in Linked list */
ns_list_foreach_safe(coap_blockwise_msg_s, removed_blocwise_msg_ptr, &handle->linked_list_blockwise_sent_msgs) {
if (removed_blocwise_msg_ptr->coap_msg_ptr) {
handle->sn_coap_protocol_free(removed_blocwise_msg_ptr->coap_msg_ptr->payload_ptr);
removed_blocwise_msg_ptr->coap_msg_ptr->payload_ptr = 0;
sn_coap_parser_release_allocated_coap_msg_mem(handle, removed_blocwise_msg_ptr->coap_msg_ptr);
removed_blocwise_msg_ptr->coap_msg_ptr = 0;
}
sn_coap_protocol_linked_list_blockwise_msg_remove(handle, removed_blocwise_msg_ptr);
}
#endif
}

int8_t sn_coap_protocol_set_duplicate_buffer_size(struct coap_s *handle, uint8_t message_count)
{
(void) handle;
Expand Down