-
Notifications
You must be signed in to change notification settings - Fork 3k
Update mbed-client-c version 3.0.4 #3500
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
Update mbed-client-c version 3.0.4 #3500
Conversation
don't merge yet, let's wait for our CI jobs to finish |
f68ecf0
to
d80f863
Compare
Let us know once ready |
/morph test-nightly |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
@kuggenhoffen Thanks, LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a considerable number of formatting issues (I wonder if tabs have gotten embedded along with spaces?) . There are also a considerable number of magic numbers scattered throughout the code. If this was anything other than a temporary patch I would block this coming in until it was tidied up. Please ensure that when this is re-done properly for 5.4 that comments are addressed.
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "mbed-client-c", | |||
"version": "3.0.2", | |||
"version": "3.0.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why has the version jumped 2 patch versions instead of one ?
uint8_t type_len; | ||
uint8_t lifetime_len; | ||
uint8_t location_len; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the big gaps between type and struct member ?
uint8_t *type_ptr; /**< Endpoint type */ | ||
uint8_t *lifetime_ptr; /**< Endpoint lifetime in seconds. eg. "1200" = 1200 seconds */ | ||
uint8_t *location_ptr; /**< Endpoint location in server, optional parameter,default is NULL */ | ||
} sn_nsdl_ep_parameters_s; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the big gaps between type and struct member ?
*/ | ||
typedef struct sn_nsdl_sent_messages_ { | ||
uint8_t message_type; | ||
uint16_t msg_id_number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the big gaps between type and struct member ?
uint8_t (*sn_grs_dyn_res_callback)(struct nsdl_s *, | ||
sn_coap_hdr_s *, | ||
sn_nsdl_addr_s *, | ||
sn_nsdl_capab_e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some weird spacing here?
@@ -582,7 +582,7 @@ TEST(libCoap_protocol, sn_coap_protocol_parse) | |||
memset(list, 0, sizeof(sn_coap_options_list_s)); | |||
sn_coap_parser_stub.expectedHeader->options_list_ptr = list; | |||
sn_coap_parser_stub.expectedHeader->options_list_ptr->block1 = 1; | |||
sn_coap_parser_stub.expectedHeader->msg_id = 4; | |||
sn_coap_parser_stub.expectedHeader->msg_id = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic numbers
@@ -843,12 +843,13 @@ TEST(libCoap_protocol, sn_coap_protocol_parse) | |||
|
|||
retCounter = 20; | |||
sn_coap_builder_stub.expectedInt16 = 1; | |||
tmp_hdr.payload_ptr = (uint8_t*)malloc(3); | |||
int buff_size = SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE + 20; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic numbers
@@ -891,13 +892,14 @@ TEST(libCoap_protocol, sn_coap_protocol_parse) | |||
|
|||
retCounter = 21; | |||
sn_coap_builder_stub.expectedInt16 = 1; | |||
tmp_hdr.payload_ptr = (uint8_t*)malloc(3); | |||
int buff_len = SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE + 20; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic numbers
@@ -279,6 +279,7 @@ bool test_sn_nsdl_register_endpoint() | |||
sn_grs_stub.expectedInfo->resource_parameters_ptr->interface_description_ptr[1] = '\0'; | |||
sn_grs_stub.expectedInfo->resource_parameters_ptr->interface_description_len = 1; | |||
sn_grs_stub.expectedInfo->resource_parameters_ptr->observable = 1; | |||
sn_grs_stub.expectedInfo->resource_parameters_ptr->coap_content_type = 0; // XXX: why was this left uninitialized? what was point of this test? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have a comment querying the code left in ?
return false; | ||
} | ||
free(handle->nsp_address_ptr->omalw_address_ptr->addr_ptr); | ||
handle->nsp_address_ptr->omalw_address_ptr->addr_ptr = NULL; | ||
|
||
if( SN_NSDL_FAILURE != set_NSP_address(handle, addr, 0, SN_NSDL_ADDRESS_TYPE_IPV6) ){ | ||
// Note: the set_NSP_address() will read 16 bytes of source address | ||
uint8_t* addr6 = (uint8_t*)calloc(16, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be named addr16 if keeping with previous convention?
Description
Valgrind error fixes, CoAP library bugfixes and CoAP message id randomization. Added compile time flag to enable new memory optimized API.
Status
READY
Migrations
NO