hello

Dependents:   nespresso_demo nespresso_endpoint EnvoyNespressoEndpointColorDetectorV2

Fork of nsdl by Robert Taylor

Files at this revision

API Documentation at this revision

Comitter:
bjblazkowicz
Date:
Mon Jul 14 12:33:59 2014 +0000
Parent:
1:c9d755d3429a
Commit message:
WIP - registration is broken in this commit.

Changed in this revision

sn_nsdl.c Show annotated file Show diff for this revision Revisions of this file
sn_nsdl_lib.h Show annotated file Show diff for this revision Revisions of this file
--- a/sn_nsdl.c	Mon Jul 14 10:44:34 2014 +0000
+++ b/sn_nsdl.c	Mon Jul 14 12:33:59 2014 +0000
@@ -30,6 +30,9 @@
 #define DOMAIN_PARAMETER_LEN			2
 #define DOMAIN_PARAMETER				{'d','='}
 
+#define BINDING_TYPE_PARAMETER_LEN		2
+#define BINDING_TYPE_PARAMETER			{'b','='}
+
 #define IF_PARAMETER_LEN				3
 #define IF_PARAMETER					{'i','f','='}
 
@@ -88,6 +91,9 @@
 static uint8_t		ep_domain_parameter[]		= DOMAIN_PARAMETER;
 
 SN_NSDL_CONST_MEMORY_ATTRIBUTE
+static uint8_t		ep_binding_type_parameter[]		= BINDING_TYPE_PARAMETER;
+
+SN_NSDL_CONST_MEMORY_ATTRIBUTE
 static uint8_t 	coap_con_type_parameter[]	= COAP_CON_PARAMETER;
 
 SN_NSDL_CONST_MEMORY_ATTRIBUTE
@@ -1187,6 +1193,13 @@
 		return_value += DOMAIN_PARAMETER_LEN;		//d=
 		number_of_parameters++;
 	}
+	
+	if ((endpoint_info_ptr->binding_type_len != 0) && (endpoint_info_ptr->binding_type_ptr != 0))
+	{
+		return_value += endpoint_info_ptr->binding_type_len;
+		return_value += BINDING_TYPE_PARAMETER_LEN;		//b=
+		number_of_parameters++;		
+	}
 
 	if(number_of_parameters != 0)
 		return_value += (number_of_parameters - 1);
@@ -1279,6 +1292,19 @@
 		memcpy(temp_ptr, parameter_ptr->domain_name_ptr, parameter_ptr->domain_name_len);
 		temp_ptr += parameter_ptr->domain_name_len;
 	}
+	
+	/*** Binding type ***/
+	
+	if((parameter_ptr->binding_type_len != 0) && (parameter_ptr->binding_type_ptr != 0))
+	{
+		if(temp_ptr != source_msg_ptr->options_list_ptr->uri_query_ptr)
+			*temp_ptr++ = '&';
+
+		memcpy(temp_ptr, ep_binding_type_parameter, sizeof(ep_binding_type_parameter));
+		temp_ptr += BINDING_TYPE_PARAMETER_LEN;
+		memcpy(temp_ptr, parameter_ptr->binding_type_ptr, parameter_ptr->binding_type_len);
+		temp_ptr += parameter_ptr->binding_type_len;
+	}	
 
 	return SN_NSDL_SUCCESS;
 }
--- a/sn_nsdl_lib.h	Mon Jul 14 10:44:34 2014 +0000
+++ b/sn_nsdl_lib.h	Mon Jul 14 12:33:59 2014 +0000
@@ -37,6 +37,9 @@
 	uint8_t		*lifetime_ptr;			/**< Endpoint lifetime in seconds. eg. "1200" = 1200 seconds */
 	uint8_t		lifetime_len;
 	
+	uint8_t		*binding_type_ptr;		/**< Binding type parameter */
+	uint8_t		binding_type_len;
+	
 } sn_nsdl_ep_parameters_s;
 
 /**