Skip to content

Commit

Permalink
Stop hard coding IP gateway and mask
Browse files Browse the repository at this point in the history
Fixes #383
  • Loading branch information
peterharperuk committed Feb 5, 2025
1 parent abcd62a commit 0beec32
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pico_w/wifi/access_point/picow_access_point.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,17 @@ int main() {

cyw43_arch_enable_ap_mode(ap_name, password, CYW43_AUTH_WPA2_AES_PSK);

#if LWIP_IPV6
#define IP(x) ((x).u_addr.ip4)
#else
#define IP(x) (x)
#endif

ip4_addr_t mask;
IP4_ADDR(ip_2_ip4(&state->gw), 192, 168, 4, 1);
IP4_ADDR(ip_2_ip4(&mask), 255, 255, 255, 0);
IP(state->gw).addr = PP_HTONL(CYW43_DEFAULT_IP_AP_ADDRESS);
IP(mask).addr = PP_HTONL(CYW43_DEFAULT_IP_MASK);

#undef IP

// Start the dhcp server
dhcp_server_t dhcp_server;
Expand Down

0 comments on commit 0beec32

Please sign in to comment.