adding resources firmware and 1/0/8
Dependencies: Beep C12832_lcd EthernetInterface EthernetNetIf HTTPClient 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
--- 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));