fix old bug that was masking new bug
This commit is contained in:
parent
e4f06f69cd
commit
31d45a3f32
|
@ -683,7 +683,7 @@ msgid "Can't set CCCD on local Characteristic"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ports/espressif/common-hal/wifi/Radio.c
|
#: ports/espressif/common-hal/wifi/Radio.c
|
||||||
msgid "Can't set MAC address while connected"
|
msgid "Station must be started"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: shared-bindings/storage/__init__.c shared-bindings/usb_cdc/__init__.c
|
#: shared-bindings/storage/__init__.c shared-bindings/usb_cdc/__init__.c
|
||||||
|
|
|
@ -121,8 +121,8 @@ mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void common_hal_wifi_radio_set_mac_address(wifi_radio_obj_t *self, const uint8_t *mac) {
|
void common_hal_wifi_radio_set_mac_address(wifi_radio_obj_t *self, const uint8_t *mac) {
|
||||||
if (self->sta_mode) {
|
if (!self->sta_mode) {
|
||||||
mp_raise_RuntimeError(translate("Can't set MAC address while connected"));
|
mp_raise_RuntimeError(translate("Station must be started"));
|
||||||
}
|
}
|
||||||
if ((mac[0] & 0b1) == 0b1) {
|
if ((mac[0] & 0b1) == 0b1) {
|
||||||
mp_raise_RuntimeError(translate("Invalid multicast MAC address"));
|
mp_raise_RuntimeError(translate("Invalid multicast MAC address"));
|
||||||
|
|
|
@ -152,7 +152,7 @@ void common_hal_wifi_init(void) {
|
||||||
mp_raise_RuntimeError(translate("Failed to init wifi"));
|
mp_raise_RuntimeError(translate("Failed to init wifi"));
|
||||||
}
|
}
|
||||||
// set station mode to avoid the default SoftAP
|
// set station mode to avoid the default SoftAP
|
||||||
esp_wifi_set_mode(WIFI_MODE_STA);
|
common_hal_wifi_radio_start_station(self);
|
||||||
// start wifi
|
// start wifi
|
||||||
common_hal_wifi_radio_set_enabled(self, true);
|
common_hal_wifi_radio_set_enabled(self, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,8 +118,8 @@ const mp_obj_property_t wifi_radio_hostname_obj = {
|
||||||
};
|
};
|
||||||
|
|
||||||
//| mac_address: ReadableBuffer
|
//| mac_address: ReadableBuffer
|
||||||
//| """MAC address of the wifi radio station.
|
//| """MAC address for the station. When the address is altered after interface is connected
|
||||||
//| Can only be set while the Station is not started."""
|
//| the changes would only be reflected once the interface reconnects."""
|
||||||
//|
|
//|
|
||||||
STATIC mp_obj_t wifi_radio_get_mac_address(mp_obj_t self_in) {
|
STATIC mp_obj_t wifi_radio_get_mac_address(mp_obj_t self_in) {
|
||||||
wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in);
|
wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in);
|
||||||
|
|
Loading…
Reference in New Issue