24#include <soc/soc_caps.h>
39#if SOC_IEEE802154_SUPPORTED
45#if SOC_IEEE802154_SUPPORTED
127 std::array<uint8_t, 6> _bytes{};
142#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
191#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
277#include "sdkconfig.h"
278#ifdef CONFIG_IDFXX_STD_FORMAT
284struct formatter<
idfxx::mac_address> {
285 constexpr auto parse(format_parse_context& ctx) {
return ctx.begin(); }
287 template<
typename FormatContext>
290 return std::copy(s.begin(), s.end(), ctx.out());
A MAC-48 (6-byte) hardware address.
constexpr uint8_t * data() noexcept
Returns a mutable pointer to the raw byte data.
constexpr mac_address() noexcept=default
Constructs a zero-initialized MAC address (00:00:00:00:00:00).
constexpr const uint8_t * data() const noexcept
Returns a pointer to the raw byte data.
constexpr bool operator==(const mac_address &) const noexcept=default
Equality comparison.
constexpr mac_address(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5) noexcept
Constructs a MAC address from individual bytes.
constexpr uint8_t operator[](std::size_t i) const noexcept
Accesses a byte by index.
constexpr const std::array< uint8_t, 6 > & bytes() const noexcept
Returns a reference to the underlying byte array.
std::string to_string(core_id c)
Returns a string representation of a CPU core identifier.
@ ieee802154
Chip has IEEE 802.15.4 (Zigbee/Thread).
result< void > try_set_base_mac_address(const mac_address &addr)
Sets the base MAC address.
result< void > try_set_interface_mac_address(const mac_address &addr, mac_type type)
Sets the MAC address for a specific interface.
mac_address base_mac_address()
Returns the base MAC address.
result< mac_address > try_read_mac(mac_type type)
Reads the MAC address for a specific interface.
result< mac_address > try_derive_local_mac(const mac_address &universal_mac)
Derives a local MAC address from a universal MAC address.
void set_interface_mac_address(const mac_address &addr, mac_type type)
Sets the MAC address for a specific interface.
mac_type
Identifies which network interface a MAC address belongs to.
mac_address read_mac(mac_type type)
Reads the MAC address for a specific interface.
result< mac_address > try_custom_mac()
Returns the custom MAC address from eFuse.
void set_base_mac_address(const mac_address &addr)
Sets the base MAC address.
result< mac_address > try_default_mac()
Returns the factory MAC address from eFuse.
result< mac_address > try_base_mac_address()
Returns the base MAC address.
@ wifi_sta
WiFi station interface.
@ wifi_softap
WiFi soft-AP interface.
@ ethernet
Ethernet interface.
@ base
Base (factory) MAC address.
@ efuse_factory
Factory MAC stored in eFuse.
@ efuse_custom
Custom MAC stored in eFuse.
std::expected< T, std::error_code > result
result type wrapping a value or error code.