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.

Revision:
12:2799b212c729
Parent:
11:fa12b9f50538
--- a/resources/gps_res.cpp	Wed Jun 18 08:29:25 2014 +0000
+++ b/resources/gps_res.cpp	Fri Jun 20 12:11:44 2014 +0000
@@ -21,14 +21,16 @@
 static uint8_t gps_resource_cb(sn_coap_hdr_s *received_coap_ptr, sn_nsdl_addr_s *address, sn_proto_info_s * proto)
 {
     sn_coap_hdr_s *coap_res_ptr = 0;
+    char gps_val[sizeof(res_gps_val)];
 
     printf("gps callback\r\n");
     
     coap_res_ptr = sn_coap_build_response(received_coap_ptr, COAP_MSG_CODE_RESPONSE_CONTENT);
     mutex.lock();
-    coap_res_ptr->payload_ptr = (uint8_t*)res_gps_val;
-    coap_res_ptr->payload_len = strlen(res_gps_val);
+    strcpy(gps_val, res_gps_val);
     mutex.unlock();
+    coap_res_ptr->payload_ptr = (uint8_t*)gps_val;
+    coap_res_ptr->payload_len = strlen(gps_val);
     
     sn_nsdl_send_coap_message(address, coap_res_ptr);
     sn_coap_parser_release_allocated_coap_msg_mem(coap_res_ptr);