An ethernet interface, to use with the ethernet pins. More...
#include <Ethernet.h>
Public Member Functions | |
| Ethernet () | |
| virtual | ~Ethernet () |
| int | write (const char *data, int size) |
| int | send () |
| int | receive () |
| int | read (char *data, int size) |
| void | address (char *mac) |
| int | link () |
| void | set_link (Mode mode) |
An ethernet interface, to use with the ethernet pins.
Example:
Definition at line 70 of file Ethernet.h.
| Ethernet | ( | ) |
|
virtual |
| void address | ( | char * | mac | ) |
| mac | Must be a pointer to a 6 byte char array to copy the ethernet address in. |
| int link | ( | ) |
It takes a while after Ethernet initialization to show up.
Example:
| int read | ( | char * | data, |
| int | size | ||
| ) |
After receive returned a number bigger than 0 it is possible to read bytes from this packet.
| data | Pointer to data packet |
| size | Size of data to be read. |
| int receive | ( | ) |
Receiving an ethernet packet will drop the last received ethernet packet and make a new ethernet packet ready to read. If no ethernet packet is arrived it will return 0.
| int send | ( | ) |
After filling in the data in an ethernet packet it must be send. Send will provide a new packet to write to.
| void set_link | ( | Mode | mode | ) |
FullDuplex100 100 Mbit, full duplex
| mode | the speed and duplex mode to set the link to: |
| int write | ( | const char * | data, |
| int | size | ||
| ) |
It will append size bytes of data to the previously written bytes.
| data | An array to write. |
| size | The size of data. |