Transfer data between UART ports and Ethernet.

Dependencies:   BufferedSerial

Transfer data between UART ports and Ethernet.

  • Support multiple UART ports.
  • Support fixed IP address and DHCP.
  • Support TCP server and TCP client modes.
  • Support a simple web server for UART and Ethernet configuration.
Revision:
2:35f2cc8b05fa
Parent:
1:c53f82eb6b42
Child:
5:7e7ad7c079fe
--- a/main.cpp	Fri Sep 01 02:30:10 2017 +0000
+++ b/main.cpp	Wed Sep 27 07:38:37 2017 +0000
@@ -16,6 +16,7 @@
 #define GATEWAY_ADDRESS "192.168.1.1"
 #else
     // private IP address only for test with Windows when DHCP server doesn't exist.
+    // Windows set its LAN IP address to 169.254.xxx.xxx / 255.255.0.0 
 #define IP_ADDRESS      "169.254.108.2"
 #define NETWORK_MASK    "255.255.0.0"
 #define GATEWAY_ADDRESS "169.254.108.1"
@@ -27,7 +28,7 @@
 #if defined (TARGET_NUMAKER_PFM_M487)
 BufferedSerial serial_0(PH_8, PH_9, 256, 4);    // UART1
 BufferedSerial serial_1(PA_5, PA_4, 256, 4);    // UART5
-//BufferedSerial serial_1(PC_12, PC_11, 256, 4);  // UART0, Debug
+//BufferedSerial serial_2(PC_12, PC_11, 256, 4);  // UART0, Debug
 
 #elif defined (TARGET_NUMAKER_PFM_NUC472)
 BufferedSerial serial_0(PH_1, PH_0, 256, 4);    // UART4
@@ -62,7 +63,7 @@
 };
 
 /* UART port to output debug message */
-RawSerial output(USBTX, USBRX);             // UART3 on NuMaker-PFM-NUC472
+RawSerial output(USBTX, USBRX);             // UART3 on NuMaker-PFM-NUC472, UART0 on NuMaker-PFM-M487
 EthernetInterface eth;
 
 #ifdef ENABLE_WEB_CONFIG