Skip to content

Commit f3e2a3d

Browse files
authored
Merge pull request #6357 from anttiylitokola/master
Update mbed-coap to version 4.4.0
2 parents 6cb6dd9 + 2e3651c commit f3e2a3d

File tree

6 files changed

+36
-3
lines changed

6 files changed

+36
-3
lines changed

features/FEATURE_COMMON_PAL/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.4.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.4.0)
4+
**New feature:**
5+
- Make sn_coap_protocol_send_rst as public needed for CoAP ping sending
6+
- Allow disabling resendings by defining SN_COAP_DISABLE_RESENDINGS
7+
8+
-[Full Changelog](https://github.com/ARMmbed/mbed-coap/compare/v4.3.0...v4.4.0)
9+
310
## [v4.3.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.3.0)
411
**New feature:**
512
- Add new API which clears the whole sent blockwise message list

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,18 @@ extern int8_t sn_coap_protocol_handle_block2_response_internally(struct coap_s *
256256
*/
257257
extern void sn_coap_protocol_clear_sent_blockwise_messages(struct coap_s *handle);
258258

259+
/**
260+
* \fn void sn_coap_protocol_send_rst(struct coap_s *handle, uint16_t msg_id, sn_nsdl_addr_s *addr_ptr, void *param)
261+
*
262+
* \brief This function sends a RESET message.
263+
*
264+
* \param *handle Pointer to CoAP library handle
265+
* \param msg_id Message id.
266+
* \param addr_ptr Pointer to destination address where CoAP message will be sent
267+
* \param param Pointer that will be passed to tx function callback
268+
*/
269+
extern void sn_coap_protocol_send_rst(struct coap_s *handle, uint16_t msg_id, sn_nsdl_addr_s *addr_ptr, void *param);
270+
259271
#endif /* SN_COAP_PROTOCOL_H_ */
260272

261273
#ifdef __cplusplus

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@
5454
*/
5555
#undef COAP_DISABLE_OBS_FEATURE
5656

57+
/**
58+
* \def SN_COAP_DISABLE_RESENDINGS
59+
*
60+
* \brief Disables resending feature. Resending feature should not be needed
61+
* when using CoAP with TCP transport for example. By default resendings are
62+
* enabled. Set to 1 to disable.
63+
*/
64+
#undef SN_COAP_DISABLE_RESENDINGS /* 0 */ // < Default re-sending are not disabled. Set to 1 to disable re-sendings
65+
5766
/**
5867
* \def SN_COAP_RESENDING_QUEUE_SIZE_MSGS
5968
*

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

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ struct sn_coap_hdr_;
3939
/* * * * * * * * * * * */
4040

4141
/* * For Message resending * */
42+
#ifdef SN_COAP_DISABLE_RESENDINGS
43+
#define ENABLE_RESENDINGS 0 /* Disable resendings */
44+
#else
4245
#define ENABLE_RESENDINGS 1 /**< Enable / Disable resending from library in building */
46+
#endif
4347

4448
#define SN_COAP_RESENDING_MAX_COUNT 3 /**< Default number of re-sendings */
4549

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
/* * * * LOCAL FUNCTION PROTOTYPES * * * */
4848
/* * * * * * * * * * * * * * * * * * * * */
4949

50-
static void sn_coap_protocol_send_rst(struct coap_s *handle, uint16_t msg_id, sn_nsdl_addr_s *addr_ptr, void *param);
5150
#if SN_COAP_DUPLICATION_MAX_MSGS_COUNT/* If Message duplication detection is not used at all, this part of code will not be compiled */
5251
static void sn_coap_protocol_linked_list_duplication_info_store(struct coap_s *handle, sn_nsdl_addr_s *src_addr_ptr, uint16_t msg_id, void *param);
5352
static coap_duplication_info_s *sn_coap_protocol_linked_list_duplication_info_search(struct coap_s *handle, sn_nsdl_addr_s *scr_addr_ptr, uint16_t msg_id);
@@ -667,6 +666,8 @@ sn_coap_hdr_s *sn_coap_protocol_parse(struct coap_s *handle, sn_nsdl_addr_s *src
667666

668667
/* Check if there is no room to store message for duplication detection purposes */
669668
if (stored_duplication_msgs_count >= handle->sn_coap_duplication_buffer_size) {
669+
tr_debug("sn_coap_protocol_parse - duplicate list full, dropping oldest");
670+
670671
/* Get oldest stored duplication message */
671672
coap_duplication_info_s *stored_duplication_info_ptr = ns_list_get_first(&handle->linked_list_duplication_msgs);
672673

@@ -1028,7 +1029,7 @@ uint32_t sn_coap_calculate_new_resend_time(const uint32_t current_time, const ui
10281029

10291030
#endif /* ENABLE_RESENDINGS */
10301031

1031-
static void sn_coap_protocol_send_rst(struct coap_s *handle, uint16_t msg_id, sn_nsdl_addr_s *addr_ptr, void *param)
1032+
void sn_coap_protocol_send_rst(struct coap_s *handle, uint16_t msg_id, sn_nsdl_addr_s *addr_ptr, void *param)
10321033
{
10331034
uint8_t packet_ptr[4];
10341035

0 commit comments

Comments
 (0)