From 51eaa4a2abb0a5cc04cb47ec8e497c2706918919 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 13 Aug 2025 14:56:19 +0200 Subject: [PATCH] changes to work with newest ESP32 Arduino core 3.3.0 --- RemoteIDSpoofer/id_open_esp32.cpp | 17 ++++++++++------- RemoteIDSpoofer/wifi.c | 1 - 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/RemoteIDSpoofer/id_open_esp32.cpp b/RemoteIDSpoofer/id_open_esp32.cpp index a732478..7264103 100644 --- a/RemoteIDSpoofer/id_open_esp32.cpp +++ b/RemoteIDSpoofer/id_open_esp32.cpp @@ -61,14 +61,15 @@ #include #include -#include + #include #include #include +#include esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx,const void *buffer,int len,bool en_sys_seq); -esp_err_t event_handler(void *,system_event_t *); +void event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data); #if ESP32_WIFI_OPTION == 0 static const char *password = "password"; @@ -161,12 +162,15 @@ void init2(char *ssid,int ssid_length,uint8_t *WiFi_mac_addr,uint8_t wifi_channe wifi_init_config_t init_cfg = WIFI_INIT_CONFIG_DEFAULT(); nvs_flash_init(); - tcpip_adapter_init(); + esp_netif_init(); - esp_event_loop_init(event_handler,NULL); + ESP_ERROR_CHECK(esp_event_loop_create_default()); + // Optional: register handler if needed + // ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL, NULL)); esp_wifi_init(&init_cfg); esp_wifi_set_storage(WIFI_STORAGE_RAM); esp_wifi_set_mode(WIFI_MODE_AP); + esp_netif_create_default_wifi_ap(); strcpy((char *) ap_config.ap.ssid,ssid); strcpy((char *) ap_config.ap.password,password); @@ -334,9 +338,8 @@ int transmit_ble2(uint8_t *ble_message,int length) { #if ID_OD_WIFI -esp_err_t event_handler(void *ctx, system_event_t *event) { - - return ESP_OK; +void event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { + // no-op handler (kept for compatibility) } #endif diff --git a/RemoteIDSpoofer/wifi.c b/RemoteIDSpoofer/wifi.c index 59c8f3a..e135cf7 100644 --- a/RemoteIDSpoofer/wifi.c +++ b/RemoteIDSpoofer/wifi.c @@ -13,7 +13,6 @@ sw@simonwunderlich.de #if defined(ARDUINO_ARCH_ESP32) #include -int clock_gettime(clockid_t, struct timespec *); #else #include #include