@@ -8,6 +8,7 @@ void startConfigAP()
88 stopUART2Tasks (); // Delete F9 serial tasks if running
99
1010#ifdef COMPILE_WIFI
11+ #ifdef COMPILE_AP
1112
1213 wifi_init_config_t wifi_init_config = WIFI_INIT_CONFIG_DEFAULT ();
1314 esp_wifi_init (&wifi_init_config); // Restart WiFi resources
@@ -175,13 +176,15 @@ void startConfigAP()
175176 }, handleFirmwareFileUpload);
176177
177178 server.begin ();
179+ #endif
178180#endif
179181
180182 radioState = WIFI_ON_NOCONNECTION;
181183}
182184
183185// Handler for firmware file upload
184186#ifdef COMPILE_WIFI
187+ #ifdef COMPILT_AP
185188static void handleFirmwareFileUpload (AsyncWebServerRequest *request, String fileName, size_t index, uint8_t *data, size_t len, bool final )
186189{
187190 if (!index)
@@ -266,9 +269,11 @@ static void handleFirmwareFileUpload(AsyncWebServerRequest *request, String file
266269 }
267270}
268271#endif
272+ #endif
269273
270274// Events triggered by web sockets
271275#ifdef COMPILE_WIFI
276+ #ifdef COMPILE_AP
272277void onWsEvent (AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len)
273278{
274279 if (type == WS_EVT_CONNECT) {
@@ -291,10 +296,12 @@ void onWsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventT
291296 }
292297}
293298#endif
299+ #endif
294300
295301// Create a csv string with current settings
296302void createSettingsString (char * settingsCSV)
297303{
304+ #ifdef COMPILE_AP
298305 // System Info
299306 stringRecord (settingsCSV, " platformPrefix" , platformPrefix);
300307
@@ -408,11 +415,13 @@ void createSettingsString(char* settingsCSV)
408415 strcat (settingsCSV, " \0 " );
409416 Serial.printf (" settingsCSV len: %d\n\r " , strlen (settingsCSV));
410417 Serial.printf (" settingsCSV: %s\n\r " , settingsCSV);
418+ #endif
411419}
412420
413421// Given a settingName, and string value, update a given setting
414422void updateSettingWithValue (const char *settingName, const char * settingValueStr)
415423{
424+ #ifdef COMPILE_AP
416425 char * ptr;
417426 double settingValue = strtod (settingValueStr, &ptr);
418427
@@ -602,6 +611,7 @@ void updateSettingWithValue(const char *settingName, const char* settingValueStr
602611 Serial.printf (" Unknown '%s': %0.3lf\n\r " , settingName, settingValue);
603612 }
604613 } // End last strcpy catch
614+ #endif
605615}
606616
607617// Add record with int
0 commit comments