Change comment, and logic on dhcpserver

This commit is contained in:
Bill Sideris 2022-11-30 21:51:50 +02:00
parent 44d5326d4c
commit f8070d2141
No known key found for this signature in database
GPG Key ID: 1BEF1BCEBA58EA33
2 changed files with 6 additions and 3 deletions

View File

@ -155,8 +155,11 @@ void common_hal_wifi_radio_start_station(wifi_radio_obj_t *self) {
void common_hal_wifi_radio_stop_station(wifi_radio_obj_t *self) {
// <strike>This is wrong</strike> This is fine.
cyw43_wifi_leave(&cyw43_state, CYW43_ITF_STA);
// This is wrong, but without this call the state of ITF_STA is still
// reported as CYW43_LINK_JOIN (by wifi_link_status) and CYW43_LINK_UP
// (by tcpip_link_status). However since ap disconnection isn't working
// either, this is not an issue.
cyw43_wifi_leave(&cyw43_state, CYW43_ITF_AP);
bindings_cyw43_wifi_enforce_pm();

View File

@ -265,9 +265,9 @@ static void dhcp_server_process(void *arg, struct udp_pcb *upcb, struct pbuf *p,
d->lease[yi].expiry = (mp_hal_ticks_ms() + DEFAULT_LEASE_TIME_S * 1000) >> 16;
dhcp_msg.yiaddr[3] = DHCPS_BASE_IP + yi;
opt_write_u8(&opt, DHCP_OPT_MSG_TYPE, DHCPACK);
printf("DHCPS: client connected: MAC=%02x:%02x:%02x:%02x:%02x:%02x IP=%u.%u.%u.%u\n",
LWIP_DEBUGF(DHCP_DEBUG, ("DHCPS: client connected: MAC=%02x:%02x:%02x:%02x:%02x:%02x IP=%u.%u.%u.%u\n",
dhcp_msg.chaddr[0], dhcp_msg.chaddr[1], dhcp_msg.chaddr[2], dhcp_msg.chaddr[3], dhcp_msg.chaddr[4], dhcp_msg.chaddr[5],
dhcp_msg.yiaddr[0], dhcp_msg.yiaddr[1], dhcp_msg.yiaddr[2], dhcp_msg.yiaddr[3]);
dhcp_msg.yiaddr[0], dhcp_msg.yiaddr[1], dhcp_msg.yiaddr[2], dhcp_msg.yiaddr[3]));
break;
}