@@ -359,11 +359,11 @@ void common_hal_wifi_radio_stop_dhcp_client(wifi_radio_obj_t *self) {
359
359
}
360
360
361
361
void common_hal_wifi_radio_start_dhcp_server (wifi_radio_obj_t * self ) {
362
- mp_raise_NotImplementedError ( NULL );
362
+ dhcp_stop ( NETIF_AP );
363
363
}
364
364
365
365
void common_hal_wifi_radio_stop_dhcp_server (wifi_radio_obj_t * self ) {
366
- mp_raise_NotImplementedError ( NULL );
366
+ dhcp_stop ( NETIF_AP );
367
367
}
368
368
369
369
void common_hal_wifi_radio_set_ipv4_address (wifi_radio_obj_t * self , mp_obj_t ipv4 , mp_obj_t netmask , mp_obj_t gateway , mp_obj_t ipv4_dns ) {
@@ -380,7 +380,15 @@ void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv
380
380
}
381
381
382
382
void common_hal_wifi_radio_set_ipv4_address_ap (wifi_radio_obj_t * self , mp_obj_t ipv4 , mp_obj_t netmask , mp_obj_t gateway ) {
383
- mp_raise_NotImplementedError (NULL );
383
+ common_hal_wifi_radio_stop_dhcp_server (self );
384
+
385
+ ip4_addr_t ipv4_addr , netmask_addr , gateway_addr ;
386
+ ipaddress_ipaddress_to_lwip (ipv4 , & ipv4_addr );
387
+ ipaddress_ipaddress_to_lwip (netmask , & netmask_addr );
388
+ ipaddress_ipaddress_to_lwip (gateway , & gateway_addr );
389
+ netif_set_addr (NETIF_AP , & ipv4_addr , & netmask_addr , & gateway_addr );
390
+
391
+ common_hal_wifi_radio_start_dhcp_server (self );
384
392
}
385
393
386
394
volatile bool ping_received ;
0 commit comments