Comments (3)
ARM Internal Ref: IOTCLT-778
from mbed-client-c.
Hello,
This is my proposed API extensions:
sn_nsdl_lib.h
/**
* \fn int8_t sn_nsdl_set_non_confirmable_resent_parameters(bool enable_resent)
*
* \brief If re-transmissions are enabled (see also sn_nsdl_set_retransmission_parameters),
* this function enables/disables a resent of a non confirmable message. This
* improves the transmission reliability by duplicating the message (including
* header). The CoAP protocol at receiver side will recognize the duplications
* and discards the redundant messages.
*
* \param bool enable_resent when set to resent non confirmable messages
* \return 0 = success, -1 = failure
*/
extern int8_t sn_nsdl_set_non_confirmable_resent_parameters(struct nsdl_s *handle, bool enable_resent);
sn_coap_protocol.h
/**
* \fn int8_t sn_coap_protocol_set_non_confirmable_resent_parameters(bool enable_resent)
*
* \brief If re-transmissions are enabled (see also sn_nsdl_set_retransmission_parameters),
* this function enables/disables a resent of a non confirmable message. This
* improves the transmission reliability by duplicating the message (including
* header). The CoAP protocol at receiver side will recognize the duplications
* and discards the redundant messages.
*
* \param bool enable_resent when set to resent non confirmable messages
* \return 0 = success, -1 = failure
*/
extern int8_t sn_coap_protocol_set_non_confirmable_resent_parameters(struct coap_s *handle,
bool enable_resent);
sn_coap_protocol_internal.h added extra boolean in struct coap_s {
bool resent_non_confirmable; /* Can be modified by sn_nsdl_set_retransmission_parameters, to perform always a resent for non confirmable messages */
Implementation extensions:
sn_nsdl.c
extern int8_t sn_nsdl_set_non_confirmable_resent_parameters(struct nsdl_s *handle,
bool enable_resent)
{
if (handle == NULL) {
return SN_NSDL_FAILURE;
}
return sn_coap_protocol_set_non_confirmable_resent_parameters(handle->grs->coap,
enable_resent);
}
sn_coap_protocol.c
int8_t sn_coap_protocol_set_non_confirmable_resent_parameters(struct coap_s *handle,
bool enable_resent)
{
#if ENABLE_RESENDINGS
if (handle == NULL) {
return -1;
}
handle->resent_non_confirmable = enable_resent;
return 0;
#endif
return -1;
}
sn_coap_protocol.c
Added code ((src_coap_msg_ptr->msg_type == COAP_MSG_TYPE_NON_CONFIRMABLE) && (handle->resent_non_confirmable)) )
#if ENABLE_RESENDINGS /* If Message resending is not used at all, this part of code will not be compiled */
/* Check if built Message type was confirmable, only these messages are resent when not acknowledged.
NON confirmable messages can be queued when sn_nsdl_set_retransmission_parameters() explicit requests to perform a scheduled resent */
if( (src_coap_msg_ptr->msg_type == COAP_MSG_TYPE_CONFIRMABLE) ||
((src_coap_msg_ptr->msg_type == COAP_MSG_TYPE_NON_CONFIRMABLE) && (handle->resent_non_confirmable)) ) {
/* Store message to Linked list for resending purposes */
sn_coap_protocol_linked_list_send_msg_store(handle, dst_addr_ptr, byte_count_built, dst_packet_data_ptr,
handle->system_time + (uint32_t)(handle->sn_coap_resending_intervall * RESPONSE_RANDOM_FACTOR),
param, src_coap_msg_ptr->uri_path_ptr, src_coap_msg_ptr->uri_path_len);
}
#endif /* ENABLE_RESENDINGS */
from mbed-client-c.
Closing the issue as inactive and due to the repository being deprecated.
Please take a look at our current offering at https://cloud.mbed.com/docs/current. The actively maintained version of this component can be found in http://github.com/armmbed/mbed-cloud-client.
Please open a new issue if this is still valid. We strongly encourage you to migrate to the latest product. New issues in this repository will most likely remain unfixed.
from mbed-client-c.
Related Issues (17)
- stuck in while loop HOT 5
- Link in mbed-coap.lib does not exists HOT 4
- sn_grs.c interface unused param with wrong description HOT 2
- Error in passing external memory block to application HOT 3
- obs not compatible with Leshan HOT 2
- Use updated module version definitions HOT 2
- Allow for config of SN_COAP_DUPLICATION_MAX_MSGS_COUNT using yotta config HOT 9
- mbed-client-c porting HOT 12
- blockwise transfer for payloads bigger than RAM size HOT 7
- mbed client blockwise do not work HOT 3
- Message ID duplication not detected HOT 14
- CoAP block transfer invalid payload bytes HOT 8
- Random CoAP message ID HOT 12
- module not able to build with armcc 5.06 HOT 4
- Confirmable messages sending HOT 4
- Enhanced 'alloc' and 'free' function HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mbed-client-c.