24
24
25
25
#include " WiFi.h"
26
26
#include " WiFiGeneric.h"
27
- #if SOC_WIFI_SUPPORTED
27
+ #if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
28
28
29
29
extern " C" {
30
30
#include < stdint.h>
@@ -39,7 +39,9 @@ extern "C" {
39
39
#include < esp_event.h>
40
40
#include < esp_mac.h>
41
41
#include < esp_netif.h>
42
+ #if SOC_WIFI_SUPPORTED
42
43
#include < esp_phy.h>
44
+ #endif
43
45
#include " lwip/ip_addr.h"
44
46
#include " lwip/opt.h"
45
47
#include " lwip/err.h"
@@ -103,6 +105,7 @@ static void _arduino_event_cb(void *arg, esp_event_base_t event_base, int32_t ev
103
105
arduino_event.event_id = ARDUINO_EVENT_WIFI_FTM_REPORT;
104
106
memcpy (&arduino_event.event_info .wifi_ftm_report , event_data, sizeof (wifi_event_ftm_report_t ));
105
107
108
+ #if !CONFIG_ESP_WIFI_REMOTE_ENABLED
106
109
/*
107
110
* SMART CONFIG
108
111
* */
@@ -157,6 +160,7 @@ static void _arduino_event_cb(void *arg, esp_event_base_t event_base, int32_t ev
157
160
} else if (event_base == NETWORK_PROV_EVENT && event_id == NETWORK_PROV_WIFI_CRED_SUCCESS) {
158
161
log_v (" Provisioning Success!" );
159
162
arduino_event.event_id = ARDUINO_EVENT_PROV_CRED_SUCCESS;
163
+ #endif
160
164
}
161
165
162
166
if (arduino_event.event_id < ARDUINO_EVENT_MAX) {
@@ -170,6 +174,7 @@ static bool initWiFiEvents() {
170
174
return false ;
171
175
}
172
176
177
+ #if !CONFIG_ESP_WIFI_REMOTE_ENABLED
173
178
if (esp_event_handler_instance_register (SC_EVENT, ESP_EVENT_ANY_ID, &_arduino_event_cb, NULL , NULL )) {
174
179
log_e (" event_handler_instance_register for SC_EVENT Failed!" );
175
180
return false ;
@@ -179,6 +184,7 @@ static bool initWiFiEvents() {
179
184
log_e (" event_handler_instance_register for NETWORK_PROV_EVENT Failed!" );
180
185
return false ;
181
186
}
187
+ #endif
182
188
183
189
return true ;
184
190
}
@@ -189,6 +195,7 @@ static bool deinitWiFiEvents() {
189
195
return false ;
190
196
}
191
197
198
+ #if !CONFIG_ESP_WIFI_REMOTE_ENABLED
192
199
if (esp_event_handler_unregister (SC_EVENT, ESP_EVENT_ANY_ID, &_arduino_event_cb)) {
193
200
log_e (" esp_event_handler_unregister for SC_EVENT Failed!" );
194
201
return false ;
@@ -198,6 +205,7 @@ static bool deinitWiFiEvents() {
198
205
log_e (" esp_event_handler_unregister for NETWORK_PROV_EVENT Failed!" );
199
206
return false ;
200
207
}
208
+ #endif
201
209
202
210
return true ;
203
211
}
@@ -370,6 +378,7 @@ void WiFiGenericClass::_eventCallback(arduino_event_t *event) {
370
378
// log_d("Arduino Event: %d - %s", event->event_id, WiFi.eventName(event->event_id));
371
379
if (event->event_id == ARDUINO_EVENT_WIFI_SCAN_DONE) {
372
380
WiFiScanClass::_scanDone ();
381
+ #if !CONFIG_ESP_WIFI_REMOTE_ENABLED
373
382
} else if (event->event_id == ARDUINO_EVENT_SC_GOT_SSID_PSWD) {
374
383
WiFi.begin (
375
384
(const char *)event->event_info .sc_got_ssid_pswd .ssid , (const char *)event->event_info .sc_got_ssid_pswd .password , 0 ,
@@ -378,6 +387,7 @@ void WiFiGenericClass::_eventCallback(arduino_event_t *event) {
378
387
} else if (event->event_id == ARDUINO_EVENT_SC_SEND_ACK_DONE) {
379
388
esp_smartconfig_stop ();
380
389
WiFiSTAClass::_smartConfigDone = true ;
390
+ #endif
381
391
}
382
392
}
383
393
@@ -693,6 +703,7 @@ bool WiFiGenericClass::initiateFTM(uint8_t frm_count, uint16_t burst_period, uin
693
703
* @return true on success
694
704
*/
695
705
bool WiFiGenericClass::setDualAntennaConfig (uint8_t gpio_ant1, uint8_t gpio_ant2, wifi_rx_ant_t rx_mode, wifi_tx_ant_t tx_mode) {
706
+ #if !CONFIG_ESP_WIFI_REMOTE_ENABLED
696
707
697
708
esp_phy_ant_gpio_config_t wifi_ant_io;
698
709
@@ -759,7 +770,7 @@ bool WiFiGenericClass::setDualAntennaConfig(uint8_t gpio_ant1, uint8_t gpio_ant2
759
770
log_e (" Failed to set antenna configuration" );
760
771
return false ;
761
772
}
762
-
773
+ # endif
763
774
return true ;
764
775
}
765
776
0 commit comments