change hostname

This commit is contained in:
Martin Brodbeck 2022-12-27 18:16:49 +01:00
parent 01a722bef8
commit 65d26b5e3d

View file

@ -14,6 +14,8 @@ int wifi_setup(uint32_t country, const string &ssid, const string &pw) {
cyw43_arch_enable_sta_mode();
netif_set_hostname(netif_default, "AbfallPicoW");
if (cyw43_arch_wifi_connect_async(ssid.c_str(), pw.c_str(), CYW43_AUTH_WPA2_MIXED_PSK)) {
return 2;
}
@ -39,9 +41,11 @@ int wifi_setup(uint32_t country, const string &ssid, const string &pw) {
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 0);
} else {
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1);
printf("IP: %s\n", ip4addr_ntoa(netif_ip_addr4(netif_default)));
}
return 0;
return status;
}
int main() {