File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
ports/espressif/common-hal/wifi Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -683,7 +683,7 @@ msgid "Can't set CCCD on local Characteristic"
683
683
msgstr ""
684
684
685
685
#: ports/espressif/common-hal/wifi/Radio.c
686
- msgid "Can't set MAC address while connected "
686
+ msgid "Station must be started "
687
687
msgstr ""
688
688
689
689
#: shared-bindings/storage/__init__.c shared-bindings/usb_cdc/__init__.c
Original file line number Diff line number Diff line change @@ -121,8 +121,8 @@ mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self) {
121
121
}
122
122
123
123
void common_hal_wifi_radio_set_mac_address (wifi_radio_obj_t * self , const uint8_t * mac ) {
124
- if (self -> sta_mode ) {
125
- mp_raise_RuntimeError (translate ("Can't set MAC address while connected " ));
124
+ if (! self -> sta_mode ) {
125
+ mp_raise_RuntimeError (translate ("Station must be started " ));
126
126
}
127
127
if ((mac [0 ] & 0b1 ) == 0b1 ) {
128
128
mp_raise_RuntimeError (translate ("Invalid multicast MAC address" ));
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ void common_hal_wifi_init(void) {
152
152
mp_raise_RuntimeError (translate ("Failed to init wifi" ));
153
153
}
154
154
// set station mode to avoid the default SoftAP
155
- esp_wifi_set_mode ( WIFI_MODE_STA );
155
+ common_hal_wifi_radio_start_station ( self );
156
156
// start wifi
157
157
common_hal_wifi_radio_set_enabled (self , true);
158
158
}
Original file line number Diff line number Diff line change @@ -118,8 +118,8 @@ const mp_obj_property_t wifi_radio_hostname_obj = {
118
118
};
119
119
120
120
//| mac_address: ReadableBuffer
121
- //| """MAC address of the wifi radio station.
122
- //| Can only be set while the Station is not started ."""
121
+ //| """MAC address for the station. When the address is altered after interface is connected
122
+ //| the changes would only be reflected once the interface reconnects ."""
123
123
//|
124
124
STATIC mp_obj_t wifi_radio_get_mac_address (mp_obj_t self_in ) {
125
125
wifi_radio_obj_t * self = MP_OBJ_TO_PTR (self_in );
You can’t perform that action at this time.
0 commit comments