EtherRaw
|
Support for IPv4 addresses. More...
#include <EtherRaw.h>
Public Member Functions | |
MACAddress () | |
MACAddress (uint8_t octet1, uint8_t octet2, uint8_t octet3, uint8_t octet4, uint8_t octet5, uint8_t octet6) | |
MACAddress (const uint8_t *address) | |
bool | operator== (const MACAddress &addr) |
bool | operator== (const uint8_t *addr) |
uint8_t | operator[] (int index) const |
uint8_t & | operator[] (int index) |
MACAddress & | operator= (const uint8_t *addr) |
uint8_t * | address () |
size_t | printTo (Print &p) const |
Support for IPv4 addresses.
This class allows easy access to the contents of a MAC address in on-the-wire format.
MACAddress::MACAddress | ( | ) |
Constructor. Clears the address to all zeros
MACAddress::MACAddress | ( | uint8_t | octet1, |
uint8_t | octet2, | ||
uint8_t | octet3, | ||
uint8_t | octet4, | ||
uint8_t | octet5, | ||
uint8_t | octet6 | ||
) |
Constructor Initialise the address from separate octets.
[in] | octet1 | Value for octet 1 |
[in] | octet2 | Value for octet 2 |
[in] | octet3 | Value for octet 3 |
[in] | octet4 | Value for octet 4 |
[in] | octet5 | Value for octet 5 |
[in] | octet6 | Value for octet 6 |
MACAddress::MACAddress | ( | const uint8_t * | address | ) |
Constructor. Initialise the address from some other array or structure.
[in] | address | Pointer to 6 octets of MAC address |
uint8_t * MACAddress::address | ( | ) |
Access the raw address as an array of octets.
MACAddress & MACAddress::operator= | ( | const uint8_t * | addr | ) |
Assignment operator. Copies the raw address pointed to by addr to this address.
[in] | addr | The raw address to be used to initialise this address |
bool MACAddress::operator== | ( | const MACAddress & | addr | ) |
Equality operator. Tests whether 2 addresses are identical.
[in] | addr | The other address |
bool MACAddress::operator== | ( | const uint8_t * | addr | ) |
Equality operator. Tests whether 2 addresses are identical.
[in] | addr | The other address as some raw array or structure |
uint8_t MACAddress::operator[] | ( | int | index | ) | const |
Overloaded index operator. Allow getting and setting individual octets of the address
[in] | index | The index of the octet to access |
uint8_t & MACAddress::operator[] | ( | int | index | ) |
Overloaded index operator. Allow getting and setting individual octets of the address
[in] | index | The index of the octet to access |
size_t MACAddress::printTo | ( | Print & | p | ) | const |
Print. Prints an ASCII formatted version of the address to a Printable such as Serial.
Referenced by EthernetHeader::printTo().