Skip to content

Commit b7908a6

Browse files
authored
Merge pull request #6033 from anttiylitokola/master
Update mbed-coap to version 4.2.0
2 parents 8e8b3d3 + 47e0922 commit b7908a6

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
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.2.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.2.0)
4+
**New feature:**
5+
- Add new API to remove sent blockwise message from the linked list
6+
7+
-[Full Changelog](https://github.com/ARMmbed/mbed-coap/compare/v4.1.1...v4.2.0)
8+
39
## [v4.1.1](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.1.1)
410
**Closed issues:**
511
- IOTCLT-2203 mbed-coap does not handle PUT or POST if they indicate a smaller block size preference (fixed regression)

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,17 @@ extern void sn_coap_protocol_clear_retransmission_buffer(struct coap_s *handle);
202202
*/
203203
extern void sn_coap_protocol_block_remove(struct coap_s *handle, sn_nsdl_addr_s *source_address, uint16_t payload_length, void *payload);
204204

205+
/**
206+
* \fn sn_coap_protocol_remove_sent_blockwise_message
207+
*
208+
* \brief Remove sent blockwise message from the linked list.
209+
*
210+
* \param handle Pointer to CoAP library handle
211+
* \param message_id Message id to be removed.
212+
*
213+
*/
214+
extern void sn_coap_protocol_remove_sent_blockwise_message(struct coap_s *handle, uint16_t message_id);
215+
205216
/**
206217
* \fn void sn_coap_protocol_delete_retransmission(struct coap_s *handle)
207218
*

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.1.1",
3+
"version": "4.2.0",
44
"description": "COAP library",
55
"keywords": [
66
"coap",

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,9 +1552,26 @@ static uint16_t sn_coap_count_linked_list_size(const coap_send_msg_list_t *linke
15521552
#endif
15531553

15541554
#if SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE
1555+
void sn_coap_protocol_remove_sent_blockwise_message(struct coap_s *handle, uint16_t message_id)
1556+
{
1557+
if (!handle) {
1558+
return;
1559+
}
1560+
1561+
ns_list_foreach_safe(coap_blockwise_msg_s, tmp, &handle->linked_list_blockwise_sent_msgs) {
1562+
if (tmp->coap == handle && tmp->coap_msg_ptr && tmp->coap_msg_ptr->msg_id == message_id) {
1563+
handle->sn_coap_protocol_free(tmp->coap_msg_ptr->payload_ptr);
1564+
sn_coap_parser_release_allocated_coap_msg_mem(tmp->coap, tmp->coap_msg_ptr);
1565+
ns_list_remove(&handle->linked_list_blockwise_sent_msgs, tmp);
1566+
handle->sn_coap_protocol_free(tmp);
1567+
break;
1568+
}
1569+
}
1570+
}
1571+
15551572
void sn_coap_protocol_block_remove(struct coap_s *handle, sn_nsdl_addr_s *source_address, uint16_t payload_length, void *payload)
15561573
{
1557-
if(!handle || !source_address || !payload){
1574+
if (!handle || !source_address || !payload) {
15581575
return;
15591576
}
15601577

0 commit comments

Comments
 (0)