|
EtcPal
0.4.1
ETC Platform Abstraction Layer (EtcPal)
|
View other versions:
|
A wrapper for the EtcPal MAC address type.
Provides C++ syntactic sugar for working with MAC addresses.
Public Member Functions | |
| MacAddr ()=default | |
| Constructs a null MAC address by default. | |
| constexpr | MacAddr (const EtcPalMacAddr &c_mac) noexcept |
| Construct a MAC address copied from an instance of the C EtcPalMacAddr type. | |
| MacAddr & | operator= (const EtcPalMacAddr &c_mac) noexcept |
| Assign an instance of the C EtcPalMacAddr type to an instance of this class. | |
| MacAddr (const uint8_t *mac_data) noexcept | |
| Construct a MAC address from its raw 6-byte array representation. More... | |
| constexpr const EtcPalMacAddr & | get () const noexcept |
| Get a const reference to the underlying C type. | |
| ETCPAL_CONSTEXPR_14 EtcPalMacAddr & | get () noexcept |
| Get a mutable reference to the underlying C type. | |
| std::string | ToString () const |
| Convert the MAC address to a string representation. More... | |
| constexpr const uint8_t * | data () const noexcept |
| Get the raw 6-byte array representation of a MAC address. More... | |
| std::array< uint8_t, ETCPAL_MAC_BYTES > | ToArray () const noexcept |
| Get a 6-byte std::array representation of a MAC address. More... | |
| bool | IsNull () const noexcept |
| Whether this MacAddr represents a null (all 0's) MAC address. | |
Static Public Member Functions | |
| static MacAddr | FromString (const char *mac_str) noexcept |
| Construct a MacAddr from a string representation. More... | |
| static MacAddr | FromString (const std::string &mac_str) noexcept |
| Construct a MacAddr from a string representation. More... | |
|
inlineexplicitnoexcept |
Construct a MAC address from its raw 6-byte array representation.
| [in] | mac_data | Pointer to the MAC data, an array of length ETCPAL_MAC_BYTES. |
|
constexprnoexcept |
Get the raw 6-byte array representation of a MAC address.
|
inlinestaticnoexcept |
Construct a MacAddr from a string representation.
See etcpal_string_to_mac() for more information.
|
inlinestaticnoexcept |
Construct a MacAddr from a string representation.
See etcpal_string_to_mac() for more information.
|
inlinenoexcept |
Get a 6-byte std::array representation of a MAC address.
Copies the data into a new array.
|
inline |
Convert the MAC address to a string representation.
See etcpal_mac_to_string() for more information.