Skip to content

Commit 0beec32

Browse files
committed
Stop hard coding IP gateway and mask
Fixes #383
1 parent abcd62a commit 0beec32

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pico_w/wifi/access_point/picow_access_point.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,17 @@ int main() {
306306

307307
cyw43_arch_enable_ap_mode(ap_name, password, CYW43_AUTH_WPA2_AES_PSK);
308308

309+
#if LWIP_IPV6
310+
#define IP(x) ((x).u_addr.ip4)
311+
#else
312+
#define IP(x) (x)
313+
#endif
314+
309315
ip4_addr_t mask;
310-
IP4_ADDR(ip_2_ip4(&state->gw), 192, 168, 4, 1);
311-
IP4_ADDR(ip_2_ip4(&mask), 255, 255, 255, 0);
316+
IP(state->gw).addr = PP_HTONL(CYW43_DEFAULT_IP_AP_ADDRESS);
317+
IP(mask).addr = PP_HTONL(CYW43_DEFAULT_IP_MASK);
318+
319+
#undef IP
312320

313321
// Start the dhcp server
314322
dhcp_server_t dhcp_server;

0 commit comments

Comments
 (0)