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

Files at this revision

API Documentation at this revision

Comitter:
sstark
Date:
Fri Mar 21 06:46:10 2014 +0000
Parent:
11:3e9c8d80891e
Child:
13:b52d83adc1ab
Commit message:
print mac, ip, gateway and mask

Changed in this revision

EthernetInterface.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/EthernetInterface.lib	Fri Feb 28 20:02:16 2014 +0000
+++ b/EthernetInterface.lib	Fri Mar 21 06:46:10 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/EthernetInterface/#dd9794ce1d64
+http://mbed.org/users/mbed_official/code/EthernetInterface/#6a67d2bddc7c
--- a/main.cpp	Fri Feb 28 20:02:16 2014 +0000
+++ b/main.cpp	Fri Mar 21 06:46:10 2014 +0000
@@ -17,7 +17,7 @@
 
 // Ethernet configuration
 /* Define this to enable DHCP, otherwise manual address configuration is used */
-#define DHCP
+#define DHCP 1
 
 /* Manual IP configurations, if DHCP not defined */
 #define IP      "10.45.0.206"
@@ -26,7 +26,7 @@
 
 // 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 = "137.135.13.28"; /* demo NSP, web interface at http://red-hat-summit.cloudapp.net*/ 
 static const int NSP_PORT = 5683;
 char endpoint_name[20] = "mbed-ethernet-";
 uint8_t ep_type[] = {"mbed_lpc1768_appboard"};
@@ -51,6 +51,12 @@
     if(eth.connect(30000) == 0)
         pc.printf("Connect OK\n\r");
 
+    char* mac = eth.getMACAddress();
+    char* ipAddr = eth.getIPAddress();
+    char* gateway = eth.getGateway();
+    char* nmask = eth.getNetworkMask();
+    printf("mac=%s, ip=%s, gateway=%s, mask=%s\n", mac, ipAddr, gateway, nmask);
+
     mbed_interface_uid(mbed_uid);
     mbed_uid[32] = '\0';
     strncat(endpoint_name, mbed_uid + 27, 20 - strlen(endpoint_name));