cellular port
Dependencies: Beep C027_Support C12832 LM75B MMA7660 mbed-rtos mbed nsdl_lib
This is a port of the NSDL HelloWorld for cellular.
To run the example you need a C027 and the ARM mbed application shield. The example uses cellular instead of ethernet and takes the true position from the GPS instead of using a fixed position.
Diff: resources/temperature.cpp
- Revision:
- 10:443e7f741c8e
- Parent:
- 8:bd9096c4784c
- Child:
- 12:2799b212c729
--- a/resources/temperature.cpp Fri Jun 06 15:16:37 2014 +0000 +++ b/resources/temperature.cpp Tue Jun 17 07:05:29 2014 +0000 @@ -14,7 +14,6 @@ static uint8_t *obs_token_ptr = NULL; static uint8_t obs_token_len = 0; static char temp_val[5]; -extern Serial pc; /* Thread for calling libNsdl exec function (cleanup, resendings etc..) */ /* Node updates temperature every 10 seconds. Notification sending is done here. */ @@ -31,9 +30,9 @@ obs_number++; sprintf(temp_val,"%2.2f" ,tmp.read()); if(sn_nsdl_send_observation_notification(obs_token_ptr, obs_token_len, (uint8_t*)temp_val, 5, &obs_number, 1, COAP_MSG_TYPE_NON_CONFIRMABLE, 0) == 0) - pc.printf("Observation sending failed\r\n"); + printf("Observation sending failed\r\n"); else - pc.printf("Observation\r\n"); + printf("Observation\r\n"); } } } @@ -45,7 +44,7 @@ sprintf(temp_val,"%2.2f" ,tmp.read()); sn_coap_hdr_s *coap_res_ptr = 0; - pc.printf("temp callback\r\n"); + printf("temp callback\r\n"); coap_res_ptr = sn_coap_build_response(received_coap_ptr, COAP_MSG_CODE_RESPONSE_CONTENT); coap_res_ptr->payload_len = 5; @@ -53,7 +52,7 @@ if(received_coap_ptr->token_ptr) { - pc.printf("Token included\r\n"); + printf("Token included\r\n"); if(obs_token_ptr) { free(obs_token_ptr);