NanoService Example for u-blox Cellular modems

Dependencies:   Beep LM75B MMA7660 mbed nsdl_lib

Fork of NSDL_HelloWorld by Sensinode

Revision:
9:ccb9e53d5471
Parent:
8:8452c1eaa690
Child:
10:4cb556c7845e
diff -r 8452c1eaa690 -r ccb9e53d5471 nsdl_support.cpp
--- a/nsdl_support.cpp	Mon Oct 28 19:38:15 2013 +0000
+++ b/nsdl_support.cpp	Wed Oct 30 00:32:48 2013 +0000
@@ -94,17 +94,17 @@
 
 static uint8_t tx_cb(sn_nsdl_capab_e protocol, uint8_t *data_ptr, uint16_t data_len, sn_nsdl_addr_s *address_ptr)
 {
-    pc.printf("TX callback!\n\rSending %d bytes\r\n", data_len);
+    printf("TX callback!\n\rSending %d bytes\r\n", data_len);
 
     if(server.sendTo(nsp, (char*)data_ptr, data_len) != data_len)
-        pc.printf("sending failed\n\r");
+        printf("sending failed\n\r");
 
     return 1;
 }
 
 static uint8_t rx_cb(sn_coap_hdr_s *coap_packet_ptr, sn_nsdl_addr_s *address_ptr)
 {
-    pc.printf("RX callback!\r\n");
+    printf("RX callback!\r\n");
     return 0;
 }
 
@@ -117,9 +117,9 @@
         wait(RD_UPDATE_PERIOD);
         endpoint_ptr = nsdl_init_register_endpoint(endpoint_ptr, (uint8_t*)endpoint_name, ep_type, lifetime_ptr);
         if(sn_nsdl_register_endpoint(endpoint_ptr) != 0)
-            pc.printf("NSP re-registering failed\r\n");
+            printf("NSP re-registering failed\r\n");
         else
-            pc.printf("NSP re-registering OK\r\n");
+            printf("NSP re-registering OK\r\n");
         nsdl_clean_register_endpoint(&endpoint_ptr);
     }
 }
@@ -133,9 +133,9 @@
     memory_cbs.sn_nsdl_alloc = &nsdl_alloc;
     memory_cbs.sn_nsdl_free = &nsdl_free;
     if(sn_nsdl_init(&tx_cb, &rx_cb, &memory_cbs) == -1)
-        pc.printf("libNsdl init failed\r\n");
+        printf("libNsdl init failed\r\n");
     else
-        pc.printf("libNsdl init done\r\n");
+        printf("libNsdl init done\r\n");
 
     /* Set nsp address for library */
     set_NSP_address(nsp_addr, 5683, SN_NSDL_ADDRESS_TYPE_IPV4);
@@ -158,11 +158,11 @@
         int n = server.receiveFrom(from, buffer, sizeof(buffer));
         if (n < 0)
         {
-            pc.printf("Socket error\n\r");
+            printf("Socket error\n\r");
         }
         else
         {   
-            pc.printf("Received %d bytes\r\n", n);
+            printf("Received %d bytes\r\n", n);
             sn_nsdl_process_coap((uint8_t*)buffer, n, &received_packet_address);
         }
     }