Red Hat Summit NanoService Demo for LPC1768 App Board using OMA Lightweight Objects

Dependencies:   Beep C12832_lcd EthernetInterface LM75B MMA7660 mbed-rtos mbed nsdl_lib

Fork of LWM2M_NanoService_Ethernet by MBED_DEMOS

Revision:
8:f0ecb62bda47
Parent:
7:6b068978be9a
Child:
9:66e8aeb60dc6
diff -r 6b068978be9a -r f0ecb62bda47 main.cpp
--- a/main.cpp	Tue Oct 22 10:50:05 2013 +0000
+++ b/main.cpp	Tue Feb 04 05:19:54 2014 +0000
@@ -26,11 +26,11 @@
 
 // NSP configuration
 /* Change this IP address to that of your NanoService Platform installation */
-static const char* NSP_ADDRESS = "217.140.101.20"; /* demo NSP, web interface at http://nanoservice-demo.mbed.org*/ 
+static const char* NSP_ADDRESS = "208.111.39.209"; /* demo NSP, web interface at http://nanoservice-demo.mbed.org*/ 
 static const int NSP_PORT = 5683;
-char endpoint_name[16] = "mbed-";
-uint8_t ep_type[] = {"mbed_device"};
-uint8_t lifetime_ptr[] = {"1200"};
+char endpoint_name[20] = "mbed-ethernet-";
+uint8_t ep_type[] = {"mbed_lpc1768_appboard"};
+uint8_t lifetime_ptr[] = {"60"};
 
 // ****************************************************************************
 // Ethernet initialization
@@ -53,7 +53,7 @@
 
     mbed_interface_uid(mbed_uid);
     mbed_uid[32] = '\0';
-    strncat(endpoint_name, mbed_uid + 27, 15 - strlen(endpoint_name));
+    strncat(endpoint_name, mbed_uid + 27, 20 - strlen(endpoint_name));
 
     lcd.locate(0,11);
     lcd.printf("IP:%s", eth.getIPAddress());
@@ -78,7 +78,7 @@
     NSDL_DEBUG("NSP=%s - port %d\n", NSP_ADDRESS, NSP_PORT);
 
     lcd.locate(0,22);
-    lcd.printf("EP name:%s\n", endpoint_name);
+    lcd.printf("EP:%s\n", endpoint_name);
 }
 
 // ****************************************************************************
@@ -106,8 +106,9 @@
     memset(resource_ptr->resource_parameters_ptr, 0, sizeof(sn_nsdl_resource_parameters_s));
 
     // Static resources
-    nsdl_create_static_resource(resource_ptr, sizeof("dev/mfg")-1, (uint8_t*) "dev/mfg", 0, 0,  (uint8_t*) "Sensinode", sizeof("Sensinode")-1);
-    nsdl_create_static_resource(resource_ptr, sizeof("dev/mdl")-1, (uint8_t*) "dev/mdl", 0, 0,  (uint8_t*) "NSDL-C mbed device", sizeof("NSDL-C mbed device")-1);
+    nsdl_create_static_resource(resource_ptr, sizeof("3/0/0")-1, (uint8_t*) "3/0/0", 0, 0,  (uint8_t*) "ARM", sizeof("ARM")-1);
+    nsdl_create_static_resource(resource_ptr, sizeof("3/0/1")-1, (uint8_t*) "3/0/1", 0, 0,  (uint8_t*) "LPC1768 App Board", sizeof("LPC1768 App Board")-1);
+    nsdl_create_static_resource(resource_ptr, sizeof("3/0/16")-1, (uint8_t*) "3/0/16", 0, 0,  (uint8_t*) "U", sizeof("U")-1);
 
     // Dynamic resources
     create_temperature_resource(resource_ptr);
@@ -135,8 +136,8 @@
 {
     lcd.cls();
     lcd.locate(0,0);
-    lcd.printf("mbed NanoService demo");
-    NSDL_DEBUG("mbed NanoService Example App 0.1\n");
+    lcd.printf("NanoService @ MWC2014");
+    NSDL_DEBUG("NanoService @ MWC2014 Demo for LPC1768 App Board\n");
     
     // Initialize Ethernet interface first
     ethernet_init();