sandbox / mbed-client-c

Fork of mbed-client-c by Christopher Haster

Revision:
4:5d91b0f5038c
Parent:
1:43f5c94c6771
--- a/source/libNsdl/src/sn_grs.c	Fri Feb 19 17:46:29 2016 +0000
+++ b/source/libNsdl/src/sn_grs.c	Sat Apr 02 00:39:03 2016 +0300
@@ -29,6 +29,7 @@
 #include "sn_nsdl.h"
 #include "sn_coap_header.h"
 #include "sn_coap_protocol.h"
+#include "sn_coap_protocol_internal.h"
 #include "sn_nsdl_lib.h"
 #include "sn_grs.h"
 
@@ -144,6 +145,7 @@
 
 extern sn_grs_resource_list_s *sn_grs_list_resource(struct grs_s *handle, uint16_t pathlen, uint8_t *path)
 {
+    (void) pathlen;
     sn_grs_resource_list_s *grs_resource_list_ptr = NULL;
 
     if( handle == NULL || path == NULL){
@@ -631,8 +633,7 @@
     }
 
     /* Calculate message length */
-    message_len = sn_coap_builder_calc_needed_packet_data_size(coap_hdr_ptr);
-
+    message_len = sn_coap_builder_calc_needed_packet_data_size_2(coap_hdr_ptr, handle->grs->coap->sn_coap_block_data_size);
     /* Allocate memory for message and check was allocating successfully */
     message_ptr = handle->grs->sn_grs_alloc(message_len);
     if (message_ptr == NULL) {
@@ -811,6 +812,7 @@
     resource_copy_ptr->resourcelen = resource_ptr->resourcelen;
     resource_copy_ptr->sn_grs_dyn_res_callback = resource_ptr->sn_grs_dyn_res_callback;
     resource_copy_ptr->access = resource_ptr->access;
+    resource_copy_ptr->publish_uri = resource_ptr->publish_uri;
 
     /* Remove '/' - chars from the beginning and from the end */
 
@@ -1009,4 +1011,3 @@
         temp_resource = sn_grs_get_next_resource(handle->grs, temp_resource);
     }
 }
-