Skip to content

Update mbed-coap to version 4.4.0 #6357

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 20, 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
7 changes: 7 additions & 0 deletions features/FEATURE_COMMON_PAL/mbed-coap/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## [v4.4.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.4.0)
**New feature:**
- Make sn_coap_protocol_send_rst as public needed for CoAP ping sending
- Allow disabling resendings by defining SN_COAP_DISABLE_RESENDINGS

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

## [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
Expand Down
12 changes: 12 additions & 0 deletions features/FEATURE_COMMON_PAL/mbed-coap/mbed-coap/sn_coap_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,18 @@ extern int8_t sn_coap_protocol_handle_block2_response_internally(struct coap_s *
*/
extern void sn_coap_protocol_clear_sent_blockwise_messages(struct coap_s *handle);

/**
* \fn void sn_coap_protocol_send_rst(struct coap_s *handle, uint16_t msg_id, sn_nsdl_addr_s *addr_ptr, void *param)
*
* \brief This function sends a RESET message.
*
* \param *handle Pointer to CoAP library handle
* \param msg_id Message id.
* \param addr_ptr Pointer to destination address where CoAP message will be sent
* \param param Pointer that will be passed to tx function callback
*/
extern void sn_coap_protocol_send_rst(struct coap_s *handle, uint16_t msg_id, sn_nsdl_addr_s *addr_ptr, void *param);

#endif /* SN_COAP_PROTOCOL_H_ */

#ifdef __cplusplus
Expand Down
9 changes: 9 additions & 0 deletions features/FEATURE_COMMON_PAL/mbed-coap/mbed-coap/sn_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
*/
#undef COAP_DISABLE_OBS_FEATURE

/**
* \def SN_COAP_DISABLE_RESENDINGS
*
* \brief Disables resending feature. Resending feature should not be needed
* when using CoAP with TCP transport for example. By default resendings are
* enabled. Set to 1 to disable.
*/
#undef SN_COAP_DISABLE_RESENDINGS /* 0 */ // < Default re-sending are not disabled. Set to 1 to disable re-sendings

/**
* \def SN_COAP_RESENDING_QUEUE_SIZE_MSGS
*
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.3.0",
"version": "4.4.0",
"description": "COAP library",
"keywords": [
"coap",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ struct sn_coap_hdr_;
/* * * * * * * * * * * */

/* * For Message resending * */
#ifdef SN_COAP_DISABLE_RESENDINGS
#define ENABLE_RESENDINGS 0 /* Disable resendings */
#else
#define ENABLE_RESENDINGS 1 /**< Enable / Disable resending from library in building */
#endif

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
/* * * * LOCAL FUNCTION PROTOTYPES * * * */
/* * * * * * * * * * * * * * * * * * * * */

static void sn_coap_protocol_send_rst(struct coap_s *handle, uint16_t msg_id, sn_nsdl_addr_s *addr_ptr, void *param);
#if SN_COAP_DUPLICATION_MAX_MSGS_COUNT/* If Message duplication detection is not used at all, this part of code will not be compiled */
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);
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);
Expand Down Expand Up @@ -667,6 +666,8 @@ sn_coap_hdr_s *sn_coap_protocol_parse(struct coap_s *handle, sn_nsdl_addr_s *src

/* Check if there is no room to store message for duplication detection purposes */
if (stored_duplication_msgs_count >= handle->sn_coap_duplication_buffer_size) {
tr_debug("sn_coap_protocol_parse - duplicate list full, dropping oldest");

/* Get oldest stored duplication message */
coap_duplication_info_s *stored_duplication_info_ptr = ns_list_get_first(&handle->linked_list_duplication_msgs);

Expand Down Expand Up @@ -1028,7 +1029,7 @@ uint32_t sn_coap_calculate_new_resend_time(const uint32_t current_time, const ui

#endif /* ENABLE_RESENDINGS */

static void sn_coap_protocol_send_rst(struct coap_s *handle, uint16_t msg_id, sn_nsdl_addr_s *addr_ptr, void *param)
void sn_coap_protocol_send_rst(struct coap_s *handle, uint16_t msg_id, sn_nsdl_addr_s *addr_ptr, void *param)
{
uint8_t packet_ptr[4];

Expand Down