-
Notifications
You must be signed in to change notification settings - Fork 3k
[mbed-os-5.15] Update mbed-coap to version v5.1.10 #14682
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,9 @@ TEST_MODULES = ./test_modules | |
TEST_MODULE_MBED_TRACE = $(TEST_MODULES)/mbed-trace | ||
TEST_MODULE_NANOSTACK = $(TEST_MODULES)/nanostack-libservice | ||
TEST_MODULE_RANDLIB = $(TEST_MODULES)/mbed-client-randlib | ||
TEST_MODULE_CCPUTEST_VERSION = "v3.8" | ||
TEST_MODULE_CPPUTEST = $(TEST_MODULES)/cpputest | ||
TEST_MODULE_CPPUTEST_LIB = $(TEST_MODULE_CPPUTEST)/lib/libCppUTest.a | ||
|
||
.PHONY: clone | ||
clone: | ||
|
@@ -33,30 +36,43 @@ clone: | |
if [ ! -d $(TEST_MODULE_RANDLIB) ]; \ | ||
then git clone --depth 1 [email protected]:ARMmbed/mbed-client-randlib.git $(TEST_MODULE_RANDLIB); \ | ||
fi; | ||
|
||
if [ ! -d $(TEST_MODULE_CPPUTEST) ]; \ | ||
then git clone --single-branch -b $(TEST_MODULE_CCPUTEST_VERSION) https://github.com/cpputest/cpputest.git $(TEST_MODULE_CPPUTEST); \ | ||
fi; | ||
|
||
.PHONY: test | ||
test: $(TESTDIRS) | ||
test: $(TEST_MODULE_CPPUTEST_LIB) $(TESTDIRS) | ||
@rm -rf ./lcov | ||
@rm -rf ./coverage | ||
@rm -rf ./valgrind_logs | ||
@mkdir -p lcov | ||
@mkdir -p lcov/results | ||
@mkdir coverage | ||
@mkdir valgrind_logs | ||
@find ./test -name '*.xml' | xargs cp -t ./lcov/results/ | ||
@rm -f lcov/index.xml | ||
@./xsl_script.sh | ||
@cp junit_xsl.xslt lcov/. | ||
@xsltproc -o lcov/testresults.html lcov/junit_xsl.xslt lcov/index.xml | ||
@rm -f lcov/junit_xsl.xslt | ||
@rm -f lcov/index.xml | ||
@find ./ -name '*.gcno' | xargs cp --backup=numbered -t ./coverage/ | ||
@find ./ -name '*.gcda' | xargs cp --backup=numbered -t ./coverage/ | ||
@gcovr --object-directory ./coverage --exclude-unreachable-branches -e '.*/builds/.*' -e '.*/CppUTest/.*' -e '.*/mbed-client-libservice/.*' -e '.*/test/.*' -e '.*/stubs/.*' -e '.*/mbed-coap/.*' -x -o ./lcov/gcovr.xml | ||
@lcov -d test/. -c -o $(COVERAGEFILE) | ||
@gcovr -r . --filter='.*/sn_coap_builder.c' --filter='.*/sn_coap_protocol.c' --filter='.*/sn_coap_parser.c' --filter='.*/sn_coap_header_check.c' -x -o ./lcov/gcovr.xml | ||
@lcov -q -d test/. -c -o $(COVERAGEFILE) | ||
@lcov -q -r $(COVERAGEFILE) "/usr*" -o $(COVERAGEFILE) | ||
@lcov -q -r $(COVERAGEFILE) "/test*" -o $(COVERAGEFILE) | ||
@lcov -q -r $(COVERAGEFILE) "/mbed-client-libservice*" -o $(COVERAGEFILE) | ||
@lcov -q -r $(COVERAGEFILE) "*unittest*" -o $(COVERAGEFILE) | ||
@lcov -q -r $(COVERAGEFILE) "*test_modules*" -o $(COVERAGEFILE) | ||
@genhtml -q $(COVERAGEFILE) --show-details --output-directory lcov/html | ||
@find ./test -name \valgrind*.xml -print0 | xargs -0 cp --target-directory=./valgrind_logs/ | ||
@echo mbed-coap module unit tests built | ||
|
||
$(TEST_MODULE_CPPUTEST_LIB): | ||
cd $(TEST_MODULE_CPPUTEST) && \ | ||
./autogen.sh && \ | ||
./configure --disable-memory-leak-detection && \ | ||
make && \ | ||
cd $(CUR_DIR); \ | ||
|
||
$(TESTDIRS): | ||
@make -C $(@:build-%=%) | ||
|
||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ int8_t prepare_blockwise_message(struct coap_s *handle, struct sn_coap_hdr_ *coa | |
|
||
/* Structure which is stored to Linked list for message sending purposes */ | ||
typedef struct coap_send_msg_ { | ||
uint8_t resending_counter; /* Tells how many times message is still tried to resend */ | ||
uint_fast8_t resending_counter; /* Tells how many times message is still tried to resend */ | ||
uint32_t resending_time; /* Tells next resending time */ | ||
|
||
sn_nsdl_transmit_s send_msg_ptr; | ||
|
@@ -86,25 +86,35 @@ typedef NS_LIST_HEAD(coap_blockwise_msg_s, link) coap_blockwise_msg_list_t; | |
|
||
/* Structure which is stored to Linked list for blockwise messages receiving purposes */ | ||
typedef struct coap_blockwise_payload_ { | ||
uint32_t timestamp; /* Tells when Payload is stored to Linked list */ | ||
|
||
uint8_t addr_len; | ||
uint8_t *addr_ptr; | ||
uint8_t token_len; | ||
bool use_size1; | ||
uint16_t port; | ||
uint16_t payload_len; | ||
uint8_t *addr_ptr; | ||
uint32_t block_number; | ||
uint8_t *token_ptr; | ||
uint8_t token_len; | ||
|
||
uint16_t payload_len; | ||
uint8_t *payload_ptr; | ||
unsigned int use_size1:1; | ||
|
||
uint32_t timestamp; /* Tells when Payload is stored to Linked list */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the massive spacing? Are you using tabs instead of spaces ? |
||
ns_list_link_t link; | ||
} coap_blockwise_payload_s; | ||
|
||
typedef NS_LIST_HEAD(coap_blockwise_payload_s, link) coap_blockwise_payload_list_t; | ||
|
||
struct coap_s { | ||
uint8_t sn_coap_resending_queue_msgs; | ||
uint8_t sn_coap_resending_count; | ||
uint8_t sn_coap_resending_intervall; | ||
uint8_t sn_coap_duplication_buffer_size; | ||
uint8_t sn_coap_internal_block2_resp_handling; /* If this is set then coap itself sends a next GET request automatically */ | ||
uint16_t sn_coap_block_data_size; | ||
#if ENABLE_RESENDINGS | ||
uint16_t count_resent_msgs; | ||
#endif | ||
#if SN_COAP_DUPLICATION_MAX_MSGS_COUNT | ||
uint16_t count_duplication_msgs; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the massive spacing here ? |
||
#endif | ||
|
||
void *(*sn_coap_protocol_malloc)(uint16_t); | ||
void (*sn_coap_protocol_free)(void *); | ||
|
||
|
@@ -113,12 +123,10 @@ struct coap_s { | |
|
||
#if ENABLE_RESENDINGS /* If Message resending is not used at all, this part of code will not be compiled */ | ||
coap_send_msg_list_t linked_list_resent_msgs; /* Active resending messages are stored to this Linked list */ | ||
uint16_t count_resent_msgs; | ||
#endif | ||
|
||
#if SN_COAP_DUPLICATION_MAX_MSGS_COUNT /* If Message duplication detection is not used at all, this part of code will not be compiled */ | ||
coap_duplication_info_list_t linked_list_duplication_msgs; /* Messages for duplicated messages detection is stored to this Linked list */ | ||
uint16_t count_duplication_msgs; | ||
#endif | ||
|
||
#if SN_COAP_BLOCKWISE_ENABLED || SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE /* If Message blockwise is not enabled, this part of code will not be compiled */ | ||
|
@@ -127,20 +135,14 @@ struct coap_s { | |
#endif | ||
|
||
uint32_t system_time; /* System time seconds */ | ||
uint16_t sn_coap_block_data_size; | ||
uint8_t sn_coap_resending_queue_msgs; | ||
uint32_t sn_coap_resending_queue_bytes; | ||
uint8_t sn_coap_resending_count; | ||
uint8_t sn_coap_resending_intervall; | ||
uint8_t sn_coap_duplication_buffer_size; | ||
uint8_t sn_coap_internal_block2_resp_handling; /* If this is set then coap itself sends a next GET request automatically */ | ||
}; | ||
|
||
/* Utility function which performs a call to sn_coap_protocol_malloc() and memset's the result to zero. */ | ||
void *sn_coap_protocol_calloc(struct coap_s *handle, uint16_t length); | ||
void *sn_coap_protocol_calloc(struct coap_s *handle, uint_fast16_t length); | ||
|
||
/* Utility function which performs a call to sn_coap_protocol_malloc() and memcopy's the source to result buffer. */ | ||
void *sn_coap_protocol_malloc_copy(struct coap_s *handle, const void *source, uint16_t length); | ||
void *sn_coap_protocol_malloc_copy(struct coap_s *handle, const void *source, uint_fast16_t length); | ||
|
||
#ifdef __cplusplus | ||
} | ||
|
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.
Should remove redundant code rather than comment out