@@ -138,6 +138,27 @@ MP_PROPERTY_GETSET(wifi_radio_mac_address_obj,
138138 (mp_obj_t )& wifi_radio_get_mac_address_obj ,
139139 (mp_obj_t )& wifi_radio_set_mac_address_obj );
140140
141+ //| tx_power: int
142+ //| """Wifi transmission power, in dBm."""
143+ //|
144+ STATIC mp_obj_t wifi_radio_get_tx_power (mp_obj_t self_in ) {
145+ wifi_radio_obj_t * self = MP_OBJ_TO_PTR (self_in );
146+ return mp_obj_new_int (common_hal_wifi_radio_get_tx_power (self ));
147+ }
148+ MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_get_tx_power_obj , wifi_radio_get_tx_power );
149+
150+ STATIC mp_obj_t wifi_radio_set_tx_power (mp_obj_t self_in , mp_obj_t tx_power_in ) {
151+ mp_int_t tx_power = mp_obj_get_int (tx_power_in );
152+ wifi_radio_obj_t * self = MP_OBJ_TO_PTR (self_in );
153+ common_hal_wifi_radio_set_tx_power (self , tx_power );
154+ return mp_const_none ;
155+ }
156+ MP_DEFINE_CONST_FUN_OBJ_2 (wifi_radio_set_tx_power_obj , wifi_radio_set_tx_power );
157+
158+ MP_PROPERTY_GETSET (wifi_radio_tx_power_obj ,
159+ (mp_obj_t )& wifi_radio_get_tx_power_obj ,
160+ (mp_obj_t )& wifi_radio_set_tx_power_obj );
161+
141162//| mac_address_ap: ReadableBuffer
142163//| """MAC address for the AP. When the address is altered after interface is started
143164//| the changes would only be reflected once the interface restarts."""
@@ -549,6 +570,7 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = {
549570 { MP_ROM_QSTR (MP_QSTR_mac_address ), MP_ROM_PTR (& wifi_radio_mac_address_obj ) },
550571 { MP_ROM_QSTR (MP_QSTR_mac_address_ap ), MP_ROM_PTR (& wifi_radio_mac_address_ap_obj ) },
551572
573+ { MP_ROM_QSTR (MP_QSTR_tx_power ), MP_ROM_PTR (& wifi_radio_tx_power_obj ) },
552574 { MP_ROM_QSTR (MP_QSTR_start_scanning_networks ), MP_ROM_PTR (& wifi_radio_start_scanning_networks_obj ) },
553575 { MP_ROM_QSTR (MP_QSTR_stop_scanning_networks ), MP_ROM_PTR (& wifi_radio_stop_scanning_networks_obj ) },
554576
0 commit comments