Init hostnames earlier (#29)

This commit is contained in:
Astra 2023-03-21 13:22:48 +02:00 committed by GitHub
parent 721e5eac54
commit 9824d4db2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -151,7 +151,7 @@ static bool network_connect_ap(mstring_t* ap_ssid, mstring_t* ap_pass) {
return result;
}
void network_post_init(void) {
void network_hostnames_init(void) {
mstring_t* hostname = mstring_alloc();
ESP_LOGI(TAG, "init mdns");
@ -190,6 +190,8 @@ WiFiMode network_init(void) {
nvs_config_get_wifi_mode(&wifi_mode);
network_hostnames_init();
switch(wifi_mode) {
case WiFiModeAP:
nvs_config_get_ap_ssid(ssid);
@ -208,8 +210,6 @@ WiFiMode network_init(void) {
mstring_free(ssid);
mstring_free(pass);
network_post_init();
return wifi_mode;
}