7#include "esp_efuse_table.h"
10#include <freertos/FreeRTOS.h>
11#include <freertos/portmacro.h>
12#include "esp_random.h"
13#include "esp_system.h"
19 esp_fill_random(data,
len);
25void Mutex::lock() { xSemaphoreTake(this->handle_, portMAX_DELAY); }
34#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
35#include "lwip/priv/tcpip_priv.h"
39#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
49 if (!sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) {
56#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
67 if (sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) {
74#if defined(CONFIG_SOC_IEEE802154_SUPPORTED)
78 esp_efuse_read_field_blob(ESP_EFUSE_MAC_CUSTOM, mac, 48);
80 esp_efuse_read_field_blob(ESP_EFUSE_MAC_FACTORY, mac, 48);
84 esp_efuse_mac_get_custom(mac);
86 esp_efuse_mac_get_default(mac);
94#if !defined(USE_ESP32_IGNORE_EFUSE_CUSTOM_MAC)
97#ifndef USE_ESP32_VARIANT_ESP32
98 return (esp_efuse_read_field_blob(ESP_EFUSE_USER_DATA_MAC_CUSTOM, mac, 48) == ESP_OK) &&
mac_address_is_valid(mac);
100 return (esp_efuse_read_field_blob(ESP_EFUSE_MAC_CUSTOM, mac, 48) == ESP_OK) &&
mac_address_is_valid(mac);
Providing packet encoding functions for exchanging data with a remote host.
bool random_bytes(uint8_t *data, size_t len)
Generate len number of random bytes.
bool mac_address_is_valid(const uint8_t *mac)
Check if the MAC address is not all zeros or all ones.
bool has_custom_mac_address()
Check if a custom MAC address is set (ESP32 & variants)
void set_mac_address(uint8_t *mac)
Set the MAC address to use from the provided byte array (6 bytes).
uint32_t random_uint32()
Return a random 32-bit unsigned integer.
void get_mac_address_raw(uint8_t *mac)
Get the device MAC address as raw bytes, written into the provided byte array (6 bytes).