den syu / Mbed 2 deprecated prgETH_1

Dependencies:   mbed mbed-rtos EthernetInterface

Revision:
15:066e07dc9beb
Parent:
11:59dcefdda506
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mainETH_1.cpp	Wed Jan 20 05:03:45 2021 +0000
@@ -0,0 +1,20 @@
+//プログラム eth-1.cpp
+#include "mbed.h"
+#include "EthernetInterface.h"
+
+Serial pc(USBTX,USBRX);
+EthernetInterface eth;
+
+int main()
+{
+    eth.init(); //Use DHCP
+    pc.printf("MAC Address  is %s\n", eth.getMACAddress());
+
+    eth.connect();
+    pc.printf("IP  Address  is %s\n", eth.getIPAddress());
+    pc.printf("Network Mask is %s\n", eth.getNetworkMask());
+  
+    eth.disconnect();  
+
+}
+