Libarary of sensor resources for mbed Device Service. Requires NSDL Support Libarary, etc.
Diff: presence_resource.cpp
- Revision:
- 4:bc54f10b3234
- Parent:
- 0:fe416b02628b
--- a/presence_resource.cpp Mon Feb 09 15:38:18 2015 +0000 +++ b/presence_resource.cpp Thu Jul 16 12:45:41 2015 +0000 @@ -26,9 +26,9 @@ obs_number++; snprintf(motion_val,2,"%d" ,current_presence_value); if(sn_nsdl_send_observation_notification(obs_token_ptr, obs_token_len, (uint8_t*)motion_val, 1, &obs_number, 1, COAP_MSG_TYPE_NON_CONFIRMABLE, 0) == 0) { - printf("Presence Observation Sending Failed\r\n"); + pc.printf("Presence Observation Sending Failed\r\n"); } else { - printf("Presence Observation Sent\r\n"); + pc.printf("Presence Observation Sent\r\n"); } } } @@ -38,8 +38,8 @@ { sn_coap_hdr_s *coap_res_ptr = 0; snprintf(motion_val,2,"%d" ,current_presence_value); - printf("presence callback\r\n"); - printf("presence: %s\r\n", motion_val); + pc.printf("presence callback\r\n"); + pc.printf("presence: %s\r\n", motion_val); if(received_coap_ptr->msg_code == COAP_MSG_CODE_REQUEST_GET) { @@ -53,7 +53,7 @@ if(received_coap_ptr->token_ptr){ - printf(" Token included\r\n"); + pc.printf(" Token included\r\n"); if(obs_token_ptr) { free(obs_token_ptr); @@ -73,7 +73,7 @@ coap_res_ptr->options_list_ptr->observe_len = 1; obs_number++; } - printf(" Send observation %d... \r\n", obs_number); + pc.printf(" Send observation %d... \r\n", obs_number); sn_nsdl_send_coap_message(address, coap_res_ptr); nsdl_free(coap_res_ptr->options_list_ptr);