Represents a MAC address.
More...
#include <mac_address.hpp>
|
| | MacAddress ()=default |
| | MacAddress (const uint8_t *bytes) |
| | Construct a MAC address from a byte array, assuming the array is (at least) 6 bytes long.
|
| | MacAddress (const uint8_t byte0, const uint8_t byte1, const uint8_t byte2, const uint8_t byte3, const uint8_t byte4, const uint8_t byte5) |
| | Constructs a MAC address from 6 individual bytes.
|
| | MacAddress (const char *str) |
| | Construct a MAC address from a string.
|
| const std::array< uint8_t, 6 > & | bytes () const |
| bool | is_valid () const |
| std::string | to_string (const char *separator=":") const |
Represents a MAC address.
Definition at line 39 of file mac_address.hpp.
◆ MacAddress() [1/4]
| rav::MacAddress::MacAddress |
( |
| ) |
|
|
default |
◆ MacAddress() [2/4]
| rav::MacAddress::MacAddress |
( |
const uint8_t * | bytes | ) |
|
|
inlineexplicit |
Construct a MAC address from a byte array, assuming the array is (at least) 6 bytes long.
- Parameters
-
| bytes | The byte array containing the MAC address. |
Definition at line 47 of file mac_address.hpp.
◆ MacAddress() [3/4]
| rav::MacAddress::MacAddress |
( |
const uint8_t | byte0, |
|
|
const uint8_t | byte1, |
|
|
const uint8_t | byte2, |
|
|
const uint8_t | byte3, |
|
|
const uint8_t | byte4, |
|
|
const uint8_t | byte5 ) |
|
inline |
Constructs a MAC address from 6 individual bytes.
- Parameters
-
| byte0 | Byte 0 |
| byte1 | Byte 1 |
| byte2 | Byte 2 |
| byte3 | Byte 3 |
| byte4 | Byte 4 |
| byte5 | Byte 5 |
Definition at line 60 of file mac_address.hpp.
◆ MacAddress() [4/4]
| rav::MacAddress::MacAddress |
( |
const char * | str | ) |
|
|
inlineexplicit |
Construct a MAC address from a string.
The string must be in the format "00:11:22:33:44:55".
- Parameters
-
| str | The string containing the MAC address. |
Definition at line 69 of file mac_address.hpp.
◆ bytes()
| const std::array< uint8_t, 6 > & rav::MacAddress::bytes |
( |
| ) |
const |
|
inlinenodiscard |
- Returns
- The MAC address as a byte array.
Definition at line 86 of file mac_address.hpp.
◆ is_valid()
| bool rav::MacAddress::is_valid |
( |
| ) |
const |
|
inlinenodiscard |
- Returns
- True if the MAC address is valid, false otherwise. A MAC address is considered valid if it is not all zeros.
Definition at line 94 of file mac_address.hpp.
◆ to_string()
| std::string rav::MacAddress::to_string |
( |
const char * | separator = ":" | ) |
const |
|
inlinenodiscard |
◆ operator!=
◆ operator==
The documentation for this class was generated from the following file: