Bring up a minimal cyw43 Soft-AP (powersave disabled) plus USB serial blink example, with Makefile flash/monitor helpers and build ignore. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
637 B
C
30 lines
637 B
C
#include <stdio.h>
|
|
|
|
#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;
|
|
}
|