Skip to content

Commit abeecff

Browse files
authored
Merge pull request #187 from baba-dev/codex/fix-build-failure-with-installer-script
fix(platforms): guard optional wifi hosted deps
2 parents d0f4f7e + a3b3c76 commit abeecff

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed

components/net_sntp/src/net_sntp.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@
88
#include "esp_log.h"
99
#include "esp_netif_sntp.h"
1010
#include "esp_sntp.h"
11-
#include "esp_wifi.h"
1211
#include "freertos/FreeRTOS.h"
1312

13+
#if defined(ESP_PLATFORM)
14+
# include "sdkconfig.h"
15+
# if CONFIG_APP_ENABLE_WIFI_HOSTED
16+
# include "esp_wifi.h"
17+
# endif
18+
#endif
19+
1420
static const char* TAG = "net_sntp";
1521

1622
esp_err_t net_sntp_start(const char* server, bool wait_for_sync)
@@ -47,9 +53,20 @@ esp_err_t net_sntp_start(const char* server, bool wait_for_sync)
4753
ESP_LOGW(TAG, "SNTP sync wait timed out: 0x%x", (unsigned int)err);
4854
}
4955
}
56+
ESP_LOGI(TAG, "SNTP running");
57+
58+
#if defined(ESP_PLATFORM) && CONFIG_APP_ENABLE_WIFI_HOSTED
5059
wifi_mode_t mode = WIFI_MODE_NULL;
51-
esp_wifi_get_mode(&mode);
52-
ESP_LOGI(TAG, "SNTP running (wifi mode=%d)", mode);
60+
esp_err_t wifi_err = esp_wifi_get_mode(&mode);
61+
if (wifi_err == ESP_OK)
62+
{
63+
ESP_LOGI(TAG, "Wi-Fi mode: %d", mode);
64+
}
65+
else
66+
{
67+
ESP_LOGW(TAG, "Failed to query Wi-Fi mode: 0x%x", (unsigned int)wifi_err);
68+
}
69+
#endif
5370
return err;
5471
}
5572

custom/integration/settings_controller.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ namespace custom::integration
907907

908908
void SettingsController::Impl::test_wifi_connection()
909909
{
910-
#if defined(ESP_PLATFORM)
910+
#if defined(ESP_PLATFORM) && CONFIG_APP_ENABLE_WIFI_HOSTED
911911
wifi_ap_record_t ap_info{};
912912
esp_err_t err = esp_wifi_sta_get_ap_info(&ap_info);
913913
if (err == ESP_OK)
@@ -923,6 +923,8 @@ namespace custom::integration
923923
{
924924
post_connection_result("wifi", UI_PAGE_SETTINGS_STATUS_UNKNOWN, "Unavailable");
925925
}
926+
#elif defined(ESP_PLATFORM)
927+
post_connection_result("wifi", UI_PAGE_SETTINGS_STATUS_UNKNOWN, "ESP-Hosted disabled");
926928
#else
927929
post_connection_result("wifi", UI_PAGE_SETTINGS_STATUS_WARNING, "Not supported on host");
928930
#endif

platforms/tab5/dependencies.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ dependencies:
126126
registry_url: https://components.espressif.com/
127127
type: service
128128
rules:
129-
- if: CONFIG_APP_ENABLE_WIFI_HOSTED
129+
- if: $CONFIG{CONFIG_APP_ENABLE_WIFI_HOSTED} == y
130130
version: 1.4.0
131131
espressif/esp_lcd_ili9881c:
132132
component_hash: eb9ba0484d1d14171b69e5d192716fb1cdd6ef068aa4014dc3202486e124498e
@@ -228,7 +228,7 @@ dependencies:
228228
registry_url: https://components.espressif.com/
229229
type: service
230230
rules:
231-
- if: CONFIG_APP_ENABLE_WIFI_HOSTED
231+
- if: $CONFIG{CONFIG_APP_ENABLE_WIFI_HOSTED} == y
232232
version: 0.8.5
233233
espressif/led_strip:
234234
component_hash: f907c58f722c58ab8545366668cfd8769cefb7d97a631a14e9d16234cc72bdff

platforms/tab5/main/idf_component.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ dependencies:
55
espressif/esp_hosted:
66
version: 1.4.0
77
rules:
8-
- if: "CONFIG_APP_ENABLE_WIFI_HOSTED"
8+
- if: "$CONFIG{CONFIG_APP_ENABLE_WIFI_HOSTED} == y"
99
espressif/esp_wifi_remote:
1010
version: 0.8.5
1111
rules:
12-
- if: "CONFIG_APP_ENABLE_WIFI_HOSTED"
12+
- if: "$CONFIG{CONFIG_APP_ENABLE_WIFI_HOSTED} == y"
1313
chmorgan/esp-audio-player: 1.0.7
1414
chmorgan/esp-file-iterator: 1.0.0
1515
espressif/led_strip: 3.0.0

0 commit comments

Comments
 (0)