@@ -85,7 +85,7 @@ static uint32_t sn_coap_calculate_new_resend_time(const uint32_t cu
85
85
static uint16_t read_packet_msg_id (const coap_send_msg_s * stored_msg );
86
86
static uint16_t get_new_message_id (void );
87
87
88
- static bool compare_address_and_port (const sn_nsdl_addr_s * left , const sn_nsdl_addr_s * right );
88
+ static bool compare_port (const sn_nsdl_addr_s * left , const sn_nsdl_addr_s * right );
89
89
90
90
/* * * * * * * * * * * * * * * * * */
91
91
/* * * * GLOBAL DECLARATIONS * * * */
@@ -829,10 +829,8 @@ sn_coap_hdr_s *sn_coap_protocol_parse(struct coap_s *handle, sn_nsdl_addr_s *src
829
829
830
830
/* Get node count i.e. count of active resending messages */
831
831
uint16_t stored_resending_msgs_count = handle -> count_resent_msgs ;
832
-
833
832
/* Check if there is ongoing active message resendings */
834
833
if (stored_resending_msgs_count > 0 ) {
835
-
836
834
/* Remove resending message from active message resending Linked list, if any exists */
837
835
sn_coap_protocol_linked_list_send_msg_remove (handle , src_addr_ptr , returned_dst_coap_msg_ptr -> msg_id );
838
836
}
@@ -1013,13 +1011,12 @@ static void sn_coap_protocol_linked_list_send_msg_remove(struct coap_s *handle,
1013
1011
ns_list_foreach (coap_send_msg_s , stored_msg_ptr , & handle -> linked_list_resent_msgs ) {
1014
1012
/* Get message ID from stored resending message */
1015
1013
uint16_t temp_msg_id = read_packet_msg_id (stored_msg_ptr );
1016
-
1017
1014
/* If message's Message ID is same than is searched */
1018
1015
if (temp_msg_id == msg_id ) {
1019
1016
/* If message's Source address and port is same than is searched */
1020
- if (compare_address_and_port (src_addr_ptr , & stored_msg_ptr -> send_msg_ptr .dst_addr_ptr )) {
1021
- /* * * Message found * * */
1022
1017
1018
+ if (compare_port (src_addr_ptr , & stored_msg_ptr -> send_msg_ptr .dst_addr_ptr )) {
1019
+ /* * * Message found * * */
1023
1020
/* Remove message from Linked list */
1024
1021
ns_list_remove (& handle -> linked_list_resent_msgs , stored_msg_ptr );
1025
1022
-- handle -> count_resent_msgs ;
@@ -1142,7 +1139,7 @@ static coap_duplication_info_s* sn_coap_protocol_linked_list_duplication_info_se
1142
1139
/* If message's Message ID is same than is searched */
1143
1140
if (stored_duplication_info_ptr -> msg_id == msg_id ) {
1144
1141
/* If message's Source address & port is same than is searched */
1145
- if (compare_address_and_port (addr_ptr , stored_duplication_info_ptr -> address )) {
1142
+ if (compare_port (addr_ptr , stored_duplication_info_ptr -> address )) {
1146
1143
/* * * Correct Duplication info found * * * */
1147
1144
return stored_duplication_info_ptr ;
1148
1145
}
@@ -1911,7 +1908,7 @@ static sn_coap_hdr_s *sn_coap_handle_blockwise_message(struct coap_s *handle, sn
1911
1908
// Response with COAP_MSG_CODE_RESPONSE_REQUEST_ENTITY_TOO_LARGE if the payload size is more than we can handle
1912
1909
if (received_coap_msg_ptr -> options_list_ptr -> size1 > SN_COAP_MAX_INCOMING_BLOCK_MESSAGE_SIZE ) {
1913
1910
// Include maximum size that stack can handle into response
1914
- tr_error ("sn_coap_handle_blockwise_message - (recv block1) COAP_MSG_CODE_RESPONSE_REQUEST_ENTITY_TOO_LARGE! " );
1911
+ tr_info ("sn_coap_handle_blockwise_message - (recv block1) entity too large " );
1915
1912
src_coap_blockwise_ack_msg_ptr -> msg_code = COAP_MSG_CODE_RESPONSE_REQUEST_ENTITY_TOO_LARGE ;
1916
1913
}
1917
1914
else {
@@ -1924,7 +1921,7 @@ static sn_coap_hdr_s *sn_coap_handle_blockwise_message(struct coap_s *handle, sn
1924
1921
1925
1922
if (block_size > handle -> sn_coap_block_data_size ) {
1926
1923
// Include maximum size that stack can handle into response
1927
- tr_error ("sn_coap_handle_blockwise_message - (recv block1) COAP_MSG_CODE_RESPONSE_REQUEST_ENTITY_TOO_LARGE! " );
1924
+ tr_info ("sn_coap_handle_blockwise_message - (recv block1) entity too large " );
1928
1925
src_coap_blockwise_ack_msg_ptr -> msg_code = COAP_MSG_CODE_RESPONSE_REQUEST_ENTITY_TOO_LARGE ;
1929
1926
src_coap_blockwise_ack_msg_ptr -> options_list_ptr -> size1 = handle -> sn_coap_block_data_size ;
1930
1927
}
@@ -2521,14 +2518,11 @@ void *sn_coap_protocol_calloc(struct coap_s *handle, uint16_t length)
2521
2518
return result ;
2522
2519
}
2523
2520
2524
- static bool compare_address_and_port (const sn_nsdl_addr_s * left , const sn_nsdl_addr_s * right )
2521
+ static bool compare_port (const sn_nsdl_addr_s * left , const sn_nsdl_addr_s * right )
2525
2522
{
2526
2523
bool match = false;
2527
-
2528
2524
if (left -> port == right -> port ) {
2529
- if (0 == memcmp (left -> addr_ptr , right -> addr_ptr , left -> addr_len )) {
2530
- match = true;
2531
- }
2525
+ match = true;
2532
2526
}
2533
2527
2534
2528
return match ;
0 commit comments