@@ -310,7 +310,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_station_obj, wifi_radio_stop_station);
310310//| authmode: Optional[AuthMode] = None,
311311//| max_connections: Optional[int] = 4
312312//| ) -> None:
313- //| """Starts an Access Point with the specified ssid and password.
313+ //| """Starts running an access point with the specified ssid and password.
314314//|
315315//| If ``channel`` is given, the access point will use that channel unless
316316//| a station is already operating on a different channel.
@@ -376,14 +376,24 @@ STATIC mp_obj_t wifi_radio_start_ap(size_t n_args, const mp_obj_t *pos_args, mp_
376376STATIC MP_DEFINE_CONST_FUN_OBJ_KW (wifi_radio_start_ap_obj , 1 , wifi_radio_start_ap );
377377
378378//| def stop_ap(self) -> None:
379- //| """Stops the Access Point ."""
379+ //| """Stops the access point ."""
380380//| ...
381381STATIC mp_obj_t wifi_radio_stop_ap (mp_obj_t self ) {
382382 common_hal_wifi_radio_stop_ap (self );
383383 return mp_const_none ;
384384}
385385MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_stop_ap_obj , wifi_radio_stop_ap );
386386
387+ //| ap_active: bool
388+ //| """True if running as an access point. (read-only)"""
389+ STATIC mp_obj_t wifi_radio_get_ap_active (mp_obj_t self ) {
390+ return mp_obj_new_bool (common_hal_wifi_radio_get_ap_active (self ));
391+ }
392+ MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_get_ap_active_obj , wifi_radio_get_ap_active );
393+
394+ MP_PROPERTY_GETTER (wifi_radio_ap_active_obj ,
395+ (mp_obj_t )& wifi_radio_get_ap_active_obj );
396+
387397//| def connect(
388398//| self,
389399//| ssid: Union[str | ReadableBuffer],
@@ -464,44 +474,50 @@ STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_m
464474}
465475STATIC MP_DEFINE_CONST_FUN_OBJ_KW (wifi_radio_connect_obj , 1 , wifi_radio_connect );
466476
477+ //| connected: bool
478+ //| """True if connected to an access point (read-only)."""
479+ STATIC mp_obj_t wifi_radio_get_connected (mp_obj_t self ) {
480+ return mp_obj_new_bool (common_hal_wifi_radio_get_connected (self ));
481+ }
482+ MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_get_connected_obj , wifi_radio_get_connected );
483+
484+ MP_PROPERTY_GETTER (wifi_radio_connected_obj ,
485+ (mp_obj_t )& wifi_radio_get_connected_obj );
486+
467487//| ipv4_gateway: Optional[ipaddress.IPv4Address]
468- //| """IP v4 Address of the station gateway when connected to an access point. None otherwise."""
488+ //| """IP v4 Address of the station gateway when connected to an access point. None otherwise. (read-only) """
469489STATIC mp_obj_t wifi_radio_get_ipv4_gateway (mp_obj_t self ) {
470490 return common_hal_wifi_radio_get_ipv4_gateway (self );
471-
472491}
473492MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_get_ipv4_gateway_obj , wifi_radio_get_ipv4_gateway );
474493
475494MP_PROPERTY_GETTER (wifi_radio_ipv4_gateway_obj ,
476495 (mp_obj_t )& wifi_radio_get_ipv4_gateway_obj );
477496
478497//| ipv4_gateway_ap: Optional[ipaddress.IPv4Address]
479- //| """IP v4 Address of the access point gateway, when enabled. None otherwise."""
498+ //| """IP v4 Address of the access point gateway, when enabled. None otherwise. (read-only) """
480499STATIC mp_obj_t wifi_radio_get_ipv4_gateway_ap (mp_obj_t self ) {
481500 return common_hal_wifi_radio_get_ipv4_gateway_ap (self );
482-
483501}
484502MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_get_ipv4_gateway_ap_obj , wifi_radio_get_ipv4_gateway_ap );
485503
486504MP_PROPERTY_GETTER (wifi_radio_ipv4_gateway_ap_obj ,
487505 (mp_obj_t )& wifi_radio_get_ipv4_gateway_ap_obj );
488506
489507//| ipv4_subnet: Optional[ipaddress.IPv4Address]
490- //| """IP v4 Address of the station subnet when connected to an access point. None otherwise."""
508+ //| """IP v4 Address of the station subnet when connected to an access point. None otherwise. (read-only) """
491509STATIC mp_obj_t wifi_radio_get_ipv4_subnet (mp_obj_t self ) {
492510 return common_hal_wifi_radio_get_ipv4_subnet (self );
493-
494511}
495512MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_get_ipv4_subnet_obj , wifi_radio_get_ipv4_subnet );
496513
497514MP_PROPERTY_GETTER (wifi_radio_ipv4_subnet_obj ,
498515 (mp_obj_t )& wifi_radio_get_ipv4_subnet_obj );
499516
500517//| ipv4_subnet_ap: Optional[ipaddress.IPv4Address]
501- //| """IP v4 Address of the access point subnet, when enabled. None otherwise."""
518+ //| """IP v4 Address of the access point subnet, when enabled. None otherwise. (read-only) """
502519STATIC mp_obj_t wifi_radio_get_ipv4_subnet_ap (mp_obj_t self ) {
503520 return common_hal_wifi_radio_get_ipv4_subnet_ap (self );
504-
505521}
506522MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_get_ipv4_subnet_ap_obj , wifi_radio_get_ipv4_subnet_ap );
507523
@@ -538,10 +554,9 @@ STATIC mp_obj_t wifi_radio_set_ipv4_address(size_t n_args, const mp_obj_t *pos_a
538554STATIC MP_DEFINE_CONST_FUN_OBJ_KW (wifi_radio_set_ipv4_address_obj , 1 , wifi_radio_set_ipv4_address );
539555
540556//| ipv4_address: Optional[ipaddress.IPv4Address]
541- //| """IP v4 Address of the station when connected to an access point. None otherwise."""
557+ //| """IP v4 Address of the station when connected to an access point. None otherwise. (read-only) """
542558STATIC mp_obj_t _wifi_radio_get_ipv4_address (mp_obj_t self ) {
543559 return common_hal_wifi_radio_get_ipv4_address (self );
544-
545560}
546561MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_get_ipv4_address_obj , _wifi_radio_get_ipv4_address );
547562
@@ -552,7 +567,6 @@ MP_PROPERTY_GETTER(wifi_radio_ipv4_address_obj,
552567//| """IP v4 Address of the access point, when enabled. None otherwise."""
553568STATIC mp_obj_t wifi_radio_get_ipv4_address_ap (mp_obj_t self ) {
554569 return common_hal_wifi_radio_get_ipv4_address_ap (self );
555-
556570}
557571MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_get_ipv4_address_ap_obj , wifi_radio_get_ipv4_address_ap );
558572
@@ -563,7 +577,6 @@ MP_PROPERTY_GETTER(wifi_radio_ipv4_address_ap_obj,
563577//| """IP v4 Address of the DNS server to be used."""
564578STATIC mp_obj_t wifi_radio_get_ipv4_dns (mp_obj_t self ) {
565579 return common_hal_wifi_radio_get_ipv4_dns (self );
566-
567580}
568581MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_get_ipv4_dns_obj , wifi_radio_get_ipv4_dns );
569582
@@ -582,7 +595,6 @@ MP_PROPERTY_GETSET(wifi_radio_ipv4_dns_obj,
582595//| """Network object containing BSSID, SSID, authmode, channel, country and RSSI when connected to an access point. None otherwise."""
583596STATIC mp_obj_t wifi_radio_get_ap_info (mp_obj_t self ) {
584597 return common_hal_wifi_radio_get_ap_info (self );
585-
586598}
587599MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_get_ap_info_obj , wifi_radio_get_ap_info );
588600
@@ -656,12 +668,14 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = {
656668
657669 { MP_ROM_QSTR (MP_QSTR_start_ap ), MP_ROM_PTR (& wifi_radio_start_ap_obj ) },
658670 { MP_ROM_QSTR (MP_QSTR_stop_ap ), MP_ROM_PTR (& wifi_radio_stop_ap_obj ) },
671+ { MP_ROM_QSTR (MP_QSTR_ap_active ), MP_ROM_PTR (& wifi_radio_ap_active_obj ) },
659672
660673 { MP_ROM_QSTR (MP_QSTR_start_dhcp ), MP_ROM_PTR (& wifi_radio_start_dhcp_client_obj ) },
661674 { MP_ROM_QSTR (MP_QSTR_stop_dhcp ), MP_ROM_PTR (& wifi_radio_stop_dhcp_client_obj ) },
662675
663676 { MP_ROM_QSTR (MP_QSTR_connect ), MP_ROM_PTR (& wifi_radio_connect_obj ) },
664677 // { MP_ROM_QSTR(MP_QSTR_connect_to_enterprise), MP_ROM_PTR(&wifi_radio_connect_to_enterprise_obj) },
678+ { MP_ROM_QSTR (MP_QSTR_connected ), MP_ROM_PTR (& wifi_radio_connected_obj ) },
665679
666680 { MP_ROM_QSTR (MP_QSTR_ap_info ), MP_ROM_PTR (& wifi_radio_ap_info_obj ) },
667681 { MP_ROM_QSTR (MP_QSTR_ipv4_dns ), MP_ROM_PTR (& wifi_radio_ipv4_dns_obj ) },
@@ -674,9 +688,6 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = {
674688
675689 { MP_ROM_QSTR (MP_QSTR_set_ipv4_address ), MP_ROM_PTR (& wifi_radio_set_ipv4_address_obj ) },
676690
677- // { MP_ROM_QSTR(MP_QSTR_access_point_active), MP_ROM_PTR(&wifi_radio_access_point_active_obj) },
678- // { MP_ROM_QSTR(MP_QSTR_start_access_point), MP_ROM_PTR(&wifi_radio_start_access_point_obj) },
679-
680691 { MP_ROM_QSTR (MP_QSTR_ping ), MP_ROM_PTR (& wifi_radio_ping_obj ) },
681692};
682693
0 commit comments