added max-age and content-format
Fork of mbedConnectorInterface by
Diff: api/Utils.cpp
- Revision:
- 4:84159d67d32d
- Parent:
- 3:11b2f4e58378
- Child:
- 5:a929d65eb385
--- a/api/Utils.cpp Wed Jan 28 11:52:09 2015 +0000 +++ b/api/Utils.cpp Wed Jan 28 12:11:22 2015 +0000 @@ -30,12 +30,12 @@ // ************************* NSDL Linkage - MDS CONFIGURATION (defaulted) ********************************* -uint8_t NSP_address_bytes[NSP_IP_ADDRESS_LENGTH] = NSP_IP_ADDRESS; // which MDS instance we want to bind to... -uint8_t endpoint_name[24] = NODE_NAME; // our NODE name -uint8_t ep_type[] = NSP_ENDPOINT_TYPE; // our NODE type -uint8_t lifetime_ptr[] = { NSP_LIFE_TIME }; // MDS lifetime -uint8_t app_MAC_address[NODE_MAC_ADDRESS_LENGTH] = NODE_MAC_ADDRESS; // Node MAC address -uint32_t channel_list = NODE_CHANNEL_LIST; // Node RF Channel list +uint8_t NSP_address_bytes[NSP_IP_ADDRESS_LENGTH] = NSP_IP_ADDRESS; // which MDS instance we want to bind to... +uint8_t endpoint_name[NODE_NAME_LENGTH] = NODE_NAME; // our NODE name +uint8_t ep_type[NSP_ENDPOINT_TYPE_LENGTH] = NSP_ENDPOINT_TYPE; // our NODE type +uint8_t lifetime_ptr[NSP_LIFE_TIME_LENGTH] = { NSP_LIFE_TIME }; // NSDL lifetime +uint8_t app_MAC_address[NODE_MAC_ADDRESS_LENGTH] = NODE_MAC_ADDRESS; // Node MAC address +uint32_t channel_list = NODE_CHANNEL_LIST; // Node RF Channel list // ************************* NSDL Linkage - MDS CONFIGURATION (defaulted) ********************************* @@ -61,16 +61,14 @@ // main.cpp can override or change any of the above defaults... logger.log("configure_endpoint: enabling default configuration overrides..."); Connector::Options *options = configure_endpoint(config); - - uint8_ t *tmp = options->getNSPAddress(); - + // with options, lets set the underlying NSDL globals... logger.log("configure_endpoint: updating external NSDL globals..."); - NSP_address_bytes = options->getNSPAddress(); - endpoint_name = options->getEndpointNodename(); - ep_type = options->getEndpointType(); - lifetime_ptr = options->getLifetime(); - app_MAC_address = options->getMACAddress(); + memcpy(NSP_address_bytes,options->getNSPAddress(),NSP_IP_ADDRESS_LENGTH); + memcpy(endpoint_name,options->getEndpointNodename().c_str(),NODE_NAME_LENGTH); + memcpy(ep_type,options->getEndpointType().c_str(),NSP_ENDPOINT_TYPE_LENGTH); + memcpy(lifetime_ptr,options->getLifetime(),NSP_LIFE_TIME_LENGTH); + memcpy(app_MAC_address,options->getMACAddress(),NODE_MAC_ADDRESS_LENGTH); channel_list = options->getRadioChannelList(); // alloc Endpoint