Utilities for Ethernet communication interfaces.
More...
|
file | ethernet.h |
| Utilities for Ethernet communication interfaces.
|
|
Utilities for Ethernet communication interfaces.
Avr::Ethernet is a class implementing a C++ wrapper for accessing Ethernet communication interfaces.
◆ Avr::MacAddress
Represents an Ethernet MAC address.
Public Member Functions |
| MacAddress (uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet, uint8_t fifth_octet, uint8_t sixth_octet) |
| Initializes a MAC address from octets. More...
|
|
◆ MacAddress()
Avr::MacAddress::MacAddress |
( |
uint8_t |
first_octet, |
|
|
uint8_t |
second_octet, |
|
|
uint8_t |
third_octet, |
|
|
uint8_t |
fourth_octet, |
|
|
uint8_t |
fifth_octet, |
|
|
uint8_t |
sixth_octet |
|
) |
| |
|
inline |
Initializes a MAC address from octets.
- Parameters
-
first_octet | The first octet of the MAC address. |
second_octet | The second octet of the MAC address. |
third_octet | The third octet of the MAC address. |
fourth_octet | The fourth octet of the MAC address. |
fifth_octet | The fifth octet of the MAC address. |
sixth_octet | The sixth octet of the MAC address. |
◆ Avr::IpAddress
Represents an IPv4 address.
Public Member Functions |
| IpAddress () |
| Initializes an IP address to 0.0.0.0. More...
|
|
| IpAddress (uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet) |
| Initializes an IP address from octets. More...
|
|
◆ IpAddress() [1/2]
Avr::IpAddress::IpAddress |
( |
| ) |
|
|
inline |
Initializes an IP address to 0.0.0.0.
◆ IpAddress() [2/2]
Avr::IpAddress::IpAddress |
( |
uint8_t |
first_octet, |
|
|
uint8_t |
second_octet, |
|
|
uint8_t |
third_octet, |
|
|
uint8_t |
fourth_octet |
|
) |
| |
|
inline |
Initializes an IP address from octets.
- Parameters
-
first_octet | The first octet of the IP address. |
second_octet | The second octet of the IP address. |
third_octet | The third octet of the IP address. |
fourth_octet | The fourth octet of the IP address. |
◆ Avr::Ethernet
template<typename TDriver>
class Avr::Ethernet< TDriver >
A C++ wrapper for accessing Ethernet communication interfaces.
Usage:
ethernet.sendUdpMessage("TEST\n", dest, 8600);
- Template Parameters
-
TDriver | The driver for the Ethernet module to use. |
- Note
- Avr::Ethernet is currently limited to the sending of UDP messages.
◆ Ethernet()
template<typename TDriver>
Initializes the Ethernet driver.
After initialization, the Ethernet module replies to ICMP echo requests.
- Parameters
-
◆ sendUdpMessage()
template<typename TDriver>
Sends an UDP message to the specified destination.
- Parameters
-
dest | The destination Avr::IpAddress to transmit the message to. |
port | The destination UDP port number to transmit the message to. |
message | The message to transmit. |
- Returns
true
if the message was sent successfully, false
if the driver reported an error during transmission. Since UDP is connectionless, there is no guarantee that the message has been delivered even if this message reports success.