Projekt sisk

Dependencies:   EthernetInterface mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
guzbi
Date:
Fri Dec 02 07:48:20 2016 +0000
Commit message:
Projekt ethernet

Changed in this revision

EthernetInterface.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 7a4b0e7660ad EthernetInterface.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EthernetInterface.lib	Fri Dec 02 07:48:20 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/guzbi/code/EthernetInterface/#f8842a7216ff
diff -r 000000000000 -r 7a4b0e7660ad main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Dec 02 07:48:20 2016 +0000
@@ -0,0 +1,31 @@
+#include "mbed.h"
+#include "EthernetInterface.h"
+
+int main() {
+
+    EthernetInterface eth;
+    eth.init(); //Use DHCP
+    eth.connect();
+    
+    while(1) {
+        if((int)phy_link_status()){
+            printf("Cable is connected\n");
+            if((int)phy_get_duplex())
+                printf("Full duplex\n");
+            else
+                printf("Half duplex\n");
+            if((int)phy_get_speed())
+                printf("100 Mbit per second\n");
+            else
+                printf("10 Mbit per second\n");
+            }
+        else
+            printf("Cable is disconnected\n");
+        
+
+        //printf("Connection status %d\n", (int)phy_link_status());
+        //printf("Duplex status %d\n", (int)phy_get_duplex());
+        //printf("Speed status %d\n", (int)phy_get_speed());
+        wait(5);
+        }
+}
\ No newline at end of file
diff -r 000000000000 -r 7a4b0e7660ad mbed-rtos.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Fri Dec 02 07:48:20 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#58563e6cba1e
diff -r 000000000000 -r 7a4b0e7660ad mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Dec 02 07:48:20 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/0ab6a29f35bf
\ No newline at end of file