@@ -8,6 +8,7 @@ void startConfigAP()
8
8
stopUART2Tasks (); // Delete F9 serial tasks if running
9
9
10
10
#ifdef COMPILE_WIFI
11
+ #ifdef COMPILE_AP
11
12
12
13
wifi_init_config_t wifi_init_config = WIFI_INIT_CONFIG_DEFAULT ();
13
14
esp_wifi_init (&wifi_init_config); // Restart WiFi resources
@@ -175,13 +176,15 @@ void startConfigAP()
175
176
}, handleFirmwareFileUpload);
176
177
177
178
server.begin ();
179
+ #endif
178
180
#endif
179
181
180
182
radioState = WIFI_ON_NOCONNECTION;
181
183
}
182
184
183
185
// Handler for firmware file upload
184
186
#ifdef COMPILE_WIFI
187
+ #ifdef COMPILT_AP
185
188
static void handleFirmwareFileUpload (AsyncWebServerRequest *request, String fileName, size_t index, uint8_t *data, size_t len, bool final )
186
189
{
187
190
if (!index)
@@ -266,9 +269,11 @@ static void handleFirmwareFileUpload(AsyncWebServerRequest *request, String file
266
269
}
267
270
}
268
271
#endif
272
+ #endif
269
273
270
274
// Events triggered by web sockets
271
275
#ifdef COMPILE_WIFI
276
+ #ifdef COMPILE_AP
272
277
void onWsEvent (AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len)
273
278
{
274
279
if (type == WS_EVT_CONNECT) {
@@ -291,10 +296,12 @@ void onWsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventT
291
296
}
292
297
}
293
298
#endif
299
+ #endif
294
300
295
301
// Create a csv string with current settings
296
302
void createSettingsString (char * settingsCSV)
297
303
{
304
+ #ifdef COMPILE_AP
298
305
// System Info
299
306
stringRecord (settingsCSV, " platformPrefix" , platformPrefix);
300
307
@@ -408,11 +415,13 @@ void createSettingsString(char* settingsCSV)
408
415
strcat (settingsCSV, " \0 " );
409
416
Serial.printf (" settingsCSV len: %d\n\r " , strlen (settingsCSV));
410
417
Serial.printf (" settingsCSV: %s\n\r " , settingsCSV);
418
+ #endif
411
419
}
412
420
413
421
// Given a settingName, and string value, update a given setting
414
422
void updateSettingWithValue (const char *settingName, const char * settingValueStr)
415
423
{
424
+ #ifdef COMPILE_AP
416
425
char * ptr;
417
426
double settingValue = strtod (settingValueStr, &ptr);
418
427
@@ -602,6 +611,7 @@ void updateSettingWithValue(const char *settingName, const char* settingValueStr
602
611
Serial.printf (" Unknown '%s': %0.3lf\n\r " , settingName, settingValue);
603
612
}
604
613
} // End last strcpy catch
614
+ #endif
605
615
}
606
616
607
617
// Add record with int
0 commit comments