Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: blinky_max32630fthr
Ethernet Class Reference
[Drivers]
An ethernet interface, to use with the ethernet pins. More...
#include <Ethernet.h>
Public Member Functions | |
| Ethernet () | |
| Initialise the ethernet interface. | |
| virtual | ~Ethernet () |
| Powers the hardware down. | |
| int | write (const char *data, int size) |
| Writes into an outgoing ethernet packet. | |
| int | send () |
| Send an outgoing ethernet packet. | |
| int | receive () |
| Recevies an arrived ethernet packet. | |
| int | read (char *data, int size) |
| Read from an recevied ethernet packet. | |
| void | address (char *mac) |
| Gives the ethernet address of the mbed. | |
| int | link () |
| Returns if an ethernet link is pressent or not. | |
| void | set_link (Mode mode) |
| Sets the speed and duplex parameters of an ethernet link. | |
Detailed Description
An ethernet interface, to use with the ethernet pins.
Synchronization level: Not protected
Example:
// Read destination and source from every ethernet packet #include "mbed.h" Ethernet eth; int main() { char buf[0x600]; while(1) { int size = eth.receive(); if(size > 0) { eth.read(buf, size); printf("Destination: %02X:%02X:%02X:%02X:%02X:%02X\n", buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]); printf("Source: %02X:%02X:%02X:%02X:%02X:%02X\n", buf[6], buf[7], buf[8], buf[9], buf[10], buf[11]); } wait(1); } }
Definition at line 57 of file Ethernet.h.
Constructor & Destructor Documentation
| Ethernet | ( | ) |
Initialise the ethernet interface.
Definition at line 24 of file Ethernet.cpp.
Generated on Tue Jul 12 2022 14:21:38 by
1.7.2
