hello
Dependents: nespresso_demo nespresso_endpoint EnvoyNespressoEndpointColorDetectorV2
Fork of nsdl by
Diff: sn_nsdl.c
- Revision:
- 2:05e4cd1a1542
- Parent:
- 0:f6e4e1bbb3fe
diff -r c9d755d3429a -r 05e4cd1a1542 sn_nsdl.c --- 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; }