#include #include "pico/stdlib.h" #include "pico/cyw43_arch.h" #include "cyw43.h" #include "lwip/ip_addr.h" #include "ap.h" #include "dhcpserver.h" static dhcp_server_t dhcp_server; bool ap_start(void) { cyw43_arch_enable_ap_mode(AP_SSID, AP_PASS, CYW43_AUTH_WPA2_AES_PSK); cyw43_wifi_pm(&cyw43_state, CYW43_NONE_PM); ip_addr_t gw, mask; gw.addr = PP_HTONL(CYW43_DEFAULT_IP_AP_ADDRESS); mask.addr = PP_HTONL(CYW43_DEFAULT_IP_MASK); dhcp_server_init(&dhcp_server, &gw, &mask); printf("AP up: SSID=%s pass=%s ip=%s\n", AP_SSID, AP_PASS, ipaddr_ntoa(&gw)); return true; }