esp32/network_wlan: Add support to set/get the wifi protocol.
Add 'protocol' option to WLAN.config() to support setting/getting the wifi protocol modes: MODE_11G|MODE_11G|MODE_11N.
This commit is contained in:
parent
98d1c50159
commit
76f2e3e62b
@ -490,6 +490,10 @@ STATIC mp_obj_t network_wlan_config(size_t n_args, const mp_obj_t *args, mp_map_
|
||||
esp_exceptions(esp_wifi_set_max_tx_power(power));
|
||||
break;
|
||||
}
|
||||
case MP_QSTR_protocol: {
|
||||
esp_exceptions(esp_wifi_set_protocol(self->if_id, mp_obj_get_int(kwargs->table[i].value)));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
goto unknown;
|
||||
}
|
||||
@ -578,6 +582,12 @@ STATIC mp_obj_t network_wlan_config(size_t n_args, const mp_obj_t *args, mp_map_
|
||||
val = mp_obj_new_float(power * 0.25);
|
||||
break;
|
||||
}
|
||||
case MP_QSTR_protocol: {
|
||||
uint8_t protocol_bitmap;
|
||||
esp_exceptions(esp_wifi_get_protocol(self->if_id, &protocol_bitmap));
|
||||
val = MP_OBJ_NEW_SMALL_INT(protocol_bitmap);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
goto unknown;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user