Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Beep C12832_lcd EthernetInterface LM75B MMA7660 mbed-rtos mbed nsdl_lib
Fork of LWM2M_NanoService_Ethernet by
Diff: main.cpp
- Revision:
- 12:b695198175ee
- Parent:
- 11:3e9c8d80891e
- Child:
- 13:b52d83adc1ab
diff -r 3e9c8d80891e -r b695198175ee main.cpp
--- 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));
