mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(wifi_host): support esp32p4 host get mac addr from target
This commit is contained in:
parent
4a2395c488
commit
42074a3f36
@ -53,6 +53,8 @@ extern void wifi_apb80m_request(void);
|
|||||||
extern void wifi_apb80m_release(void);
|
extern void wifi_apb80m_release(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern uint8_t *esp_extconn_get_mac(void);
|
||||||
|
|
||||||
IRAM_ATTR void *wifi_malloc(size_t size)
|
IRAM_ATTR void *wifi_malloc(size_t size)
|
||||||
{
|
{
|
||||||
#if CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP
|
#if CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP
|
||||||
@ -402,7 +404,21 @@ static void esp_log_write_wrapper(unsigned int level, const char *tag, const cha
|
|||||||
|
|
||||||
static esp_err_t esp_read_mac_wrapper(uint8_t *mac, unsigned int type)
|
static esp_err_t esp_read_mac_wrapper(uint8_t *mac, unsigned int type)
|
||||||
{
|
{
|
||||||
return ESP_FAIL;
|
if (mac == NULL) {
|
||||||
|
ESP_LOGE(TAG, "mac address param is NULL");
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get mac address from target
|
||||||
|
memcpy(mac, esp_extconn_get_mac(), 6);
|
||||||
|
|
||||||
|
if (type == ESP_MAC_WIFI_SOFTAP) {
|
||||||
|
mac[5] += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ESP_LOGD(TAG, "%s MAC addr: " MACSTR, (type == ESP_MAC_WIFI_STA ? "STA" : "AP"), MAC2STR(mac));
|
||||||
|
|
||||||
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int coex_init_wrapper(void)
|
static int coex_init_wrapper(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user