Nico De Witte / Mbed 2 deprecated tcp_machine_vision_server_single_client

Dependencies:   C12832 EthernetInterface mbed-rtos mbed ConfigFile

Revision:
7:23c8d34000eb
Parent:
6:6cbb21cc3884
Child:
8:845dfadaa70d
diff -r 6cbb21cc3884 -r 23c8d34000eb main.cpp
--- a/main.cpp	Fri Jun 12 12:47:37 2015 +0000
+++ b/main.cpp	Sun Jun 14 10:45:10 2015 +0000
@@ -6,6 +6,9 @@
 
 #define TCP_SERVER_PORT 6666
 #define LCD_LINE_HEIGHT 12
+#define IP_ADDRESS "10.0.0.100"
+#define NETMASK "255.255.255.0"
+#define GATEWAY "10.0.0.254"
 
 Serial pc(USBTX,USBRX);
 DigitalOut error_led(LED1);
@@ -33,8 +36,9 @@
         EthernetInterface eth;
         Log::v("Bringing ethernet interface online\r\n");
         
-        // eth.init();         //Use DHCP
-        int success = eth.init("10.0.0.1", "255.255.255.0", "10.0.0.254");
+        
+//        int success = eth.init();         //Use DHCP
+        int success = eth.init(IP_ADDRESS, NETMASK, GATEWAY);
         
         if (success < 0 || eth.connect() < 0) {    // Default timeout of 15 seconds
             Log::w("Could not bring ethernet interface online\r\n");
@@ -46,8 +50,9 @@
             setLcdServerInfo(eth.getIPAddress());
         
             // Start the daemon
-            StatusIndicator status_indicator(p23, p24, p25);
-            TcpDaemon daemon(TCP_SERVER_PORT, LED2, LED3, p14, &status_indicator);
+//            PlcStatusIndicator status_indicator(p21);
+            PlcStatusIndicator status_indicator(LED4);
+            TcpDaemon daemon(TCP_SERVER_PORT, LED2, LED3, &status_indicator);
             Log::v("TCP daemon listening @ TCP_SERVER_PORT = %d\r\n", TCP_SERVER_PORT);
             daemon.startListening();
         }