Skip to content

Commit

Permalink
set ESP32 hostname in manifest #470
Browse files Browse the repository at this point in the history
  • Loading branch information
phoddie committed Sep 30, 2020
1 parent 3a7db2d commit e5e84b0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/network/wifi/esp32/xs6wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "xsHost.h"

#include "mc.xs.h" // for xsID_ values
#include "mc.defines.h"

#include "esp_wifi.h"

Expand Down Expand Up @@ -392,6 +393,10 @@ static esp_err_t doWiFiEvent(void *ctx, system_event_t *event)
switch (event_id) {
case SYSTEM_EVENT_STA_START:
if (ESP_OK == esp_wifi_get_config(WIFI_IF_STA, &wifi_config)) {
#ifdef MODDEF_WIFI_HOSTNAME
tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_STA, MODDEF_WIFI_HOSTNAME);
#endif

gWiFiState = 3;
gWiFiConnectRetryRemaining = MODDEF_WIFI_ESP32_CONNECT_RETRIES;
esp_wifi_connect();
Expand Down

0 comments on commit e5e84b0

Please sign in to comment.