nsp resources for the mbed nsp lighting endpoint
Dependencies: nsdl_lib
Dependents: mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet mbed_nsp_endpoint_nxp
Diff: locationtext.cpp
- Revision:
- 3:30c96bd77160
- Parent:
- 0:b26c3526ee89
--- a/locationtext.cpp Fri Sep 19 05:24:41 2014 +0000 +++ b/locationtext.cpp Fri Sep 26 05:55:55 2014 +0000 @@ -4,7 +4,7 @@ #include "NSPio.h" -extern ErrorHandler *error_handler; +extern Logger *logger; NSPio *locationtext = NULL; // observation support @@ -15,19 +15,19 @@ // send our locationtext observation void send_locationtext_observation() { if (locationtext_obs_token_ptr != NULL && locationtext_obs_number != 0) { - //if (error_handler != NULL) error_handler->log("Sending Observation (locationtext): %s",locationtext->resource()->getValuePointer()); + //if (m_logger != NULL) m_logger->log("Sending Observation (locationtext): %s",locationtext->resource()->getValuePointer()); sn_nsdl_send_observation_notification(locationtext_obs_token_ptr,locationtext_obs_token_len,(uint8_t*)locationtext->resource()->getValuePointer(),strlen(locationtext->resource()->getValuePointer()),&locationtext_obs_number,sizeof(locationtext_obs_number),COAP_MSG_TYPE_NON_CONFIRMABLE, 0); } } // init locationtext void init_locationtext(Resource *resource) { - if (locationtext == NULL && resource != NULL) locationtext = new NSPio(error_handler,resource,&send_locationtext_observation); + if (locationtext == NULL && resource != NULL) locationtext = new NSPio(m_logger,resource,&send_locationtext_observation); } // update our locationtext observation void update_locationtext_observation(sn_coap_hdr_s *received_coap_ptr,sn_coap_hdr_s *coap_res_ptr) { - //if (error_handler != NULL) error_handler->log("Updating Observation (locationtext)...starting"); + //if (m_logger != NULL) m_logger->log("Updating Observation (locationtext)...starting"); if (received_coap_ptr->token_ptr != NULL) { if (locationtext_obs_token_ptr != NULL) free(locationtext_obs_token_ptr); locationtext_obs_token_ptr = (uint8_t *)malloc(received_coap_ptr->token_len); @@ -43,7 +43,7 @@ coap_res_ptr->options_list_ptr->observe_len = 1; locationtext_obs_number++; } - //if (error_handler != NULL) error_handler->log("Updating Observation (locationtext)...done"); + //if (m_logger != NULL) m_logger->log("Updating Observation (locationtext)...done"); } /* Only GET method allowed */