add messages print out.

Dependencies:   EthernetInterface IFTTT mbed-rtos mbed

Fork of IFTTT_Ethernet_Example by Jeff Chen

Revision:
3:34f1df7fd14c
Parent:
2:22857c849884
--- a/main.cpp	Sat Sep 10 12:12:50 2016 +0000
+++ b/main.cpp	Sun Sep 11 04:57:14 2016 +0000
@@ -1,17 +1,55 @@
+//
+//
+//
+
 #include "mbed.h"
 #include "EthernetInterface.h"
 #include "TCPSocketConnection.h"
 #include "ifttt.h"
 
+//
+//
+//
+
 EthernetInterface eth;
+
 RawSerial pc(USBTX, USBRX); // tx, rx
 
 int main()
 {
     pc.baud(9600);
-    eth.init(); //Use DHCP
-    eth.connect();
+    
+    pc.printf("\n");
+    pc.printf("\n");
+    pc.printf("--------------------------------\n");
+    pc.printf("Program starts ...\n");
+    
+//    eth.init(); //Use DHCP
+    int init_rtn = eth.init(); //Use DHCP
+
+    pc.printf("init() return : %d\n", init_rtn);
+
+    pc.printf("\n");
+    pc.printf(" wait for ethernet connect()......\n");
+    pc.printf("\n");
+
+
+//    eth.connect();
+    int connect_rtn = eth.connect();
+    pc.printf("connect() return : %d\n", connect_rtn);
+    
     printf("IP Address is %s \n\r", eth.getIPAddress());
+
+    pc.printf("IP Address is %s\n", eth.getMACAddress());
+    pc.printf("\n");
+
+
+
+    
+    pc.printf("wait for socket server, 15 second ....\n");
+    pc.printf("\n");
+    
+
     TCPSocketConnection socket;
 
     // Initialize ifttt object, add up to 3 optional values, trigger event.
@@ -31,3 +69,14 @@
     while(1) {
     }
 }
+
+// override the default weak function to provide a specific mac address
+extern "C" void mbed_mac_address(char *mac)
+{
+    mac[0] = 0x00;
+    mac[1] = 0x50;
+    mac[2] = 0x56;
+    mac[3] = 0xC0;
+    mac[4] = 0x00;
+    mac[5] = 0xAB;
+};