@@ -139,13 +139,19 @@ MP_PROPERTY_GETSET(wifi_radio_hostname_obj,
139
139
140
140
//| mac_address: ReadableBuffer
141
141
//| """MAC address for the station. When the address is altered after interface is connected
142
- //| the changes would only be reflected once the interface reconnects."""
142
+ //| the changes would only be reflected once the interface reconnects.
143
+ //|
144
+ //| **Limitations:** Not settable on RP2040 CYW43 boards, such as Pi Pico W.
145
+ //| """
146
+
147
+
143
148
STATIC mp_obj_t _wifi_radio_get_mac_address (mp_obj_t self_in ) {
144
149
wifi_radio_obj_t * self = MP_OBJ_TO_PTR (self_in );
145
150
return MP_OBJ_FROM_PTR (common_hal_wifi_radio_get_mac_address (self ));
146
151
}
147
152
MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_get_mac_address_obj , _wifi_radio_get_mac_address );
148
153
154
+ #if CIRCUITPY_WIFI_RADIO_SETTABLE_MAC_ADDRESS
149
155
STATIC mp_obj_t wifi_radio_set_mac_address (mp_obj_t self_in , mp_obj_t mac_address_in ) {
150
156
mp_buffer_info_t mac_address ;
151
157
mp_get_buffer_raise (mac_address_in , & mac_address , MP_BUFFER_READ );
@@ -160,10 +166,16 @@ STATIC mp_obj_t wifi_radio_set_mac_address(mp_obj_t self_in, mp_obj_t mac_addres
160
166
return mp_const_none ;
161
167
}
162
168
MP_DEFINE_CONST_FUN_OBJ_2 (wifi_radio_set_mac_address_obj , wifi_radio_set_mac_address );
169
+ #endif
163
170
171
+ #if CIRCUITPY_WIFI_RADIO_SETTABLE_MAC_ADDRESS
164
172
MP_PROPERTY_GETSET (wifi_radio_mac_address_obj ,
165
173
(mp_obj_t )& wifi_radio_get_mac_address_obj ,
166
174
(mp_obj_t )& wifi_radio_set_mac_address_obj );
175
+ #else
176
+ MP_PROPERTY_GETTER (wifi_radio_mac_address_obj ,
177
+ (mp_obj_t )& wifi_radio_get_mac_address_obj );
178
+ #endif
167
179
168
180
//| tx_power: float
169
181
//| """Wifi transmission power, in dBm."""
@@ -187,13 +199,17 @@ MP_PROPERTY_GETSET(wifi_radio_tx_power_obj,
187
199
188
200
//| mac_address_ap: ReadableBuffer
189
201
//| """MAC address for the AP. When the address is altered after interface is started
190
- //| the changes would only be reflected once the interface restarts."""
202
+ //| the changes would only be reflected once the interface restarts.
203
+ //|
204
+ //| **Limitations:** Not settable on RP2040 CYW43 boards, such as Pi Pico W.
205
+ //| """
191
206
STATIC mp_obj_t wifi_radio_get_mac_address_ap (mp_obj_t self_in ) {
192
207
wifi_radio_obj_t * self = MP_OBJ_TO_PTR (self_in );
193
208
return MP_OBJ_FROM_PTR (common_hal_wifi_radio_get_mac_address_ap (self ));
194
209
}
195
210
MP_DEFINE_CONST_FUN_OBJ_1 (wifi_radio_get_mac_address_ap_obj , wifi_radio_get_mac_address_ap );
196
211
212
+ #if CIRCUITPY_WIFI_RADIO_SETTABLE_MAC_ADDRESS
197
213
STATIC mp_obj_t wifi_radio_set_mac_address_ap (mp_obj_t self_in , mp_obj_t mac_address_in ) {
198
214
mp_buffer_info_t mac_address ;
199
215
mp_get_buffer_raise (mac_address_in , & mac_address , MP_BUFFER_READ );
@@ -208,10 +224,16 @@ STATIC mp_obj_t wifi_radio_set_mac_address_ap(mp_obj_t self_in, mp_obj_t mac_add
208
224
return mp_const_none ;
209
225
}
210
226
MP_DEFINE_CONST_FUN_OBJ_2 (wifi_radio_set_mac_address_ap_obj , wifi_radio_set_mac_address_ap );
227
+ #endif
211
228
229
+ #if CIRCUITPY_WIFI_RADIO_SETTABLE_MAC_ADDRESS
212
230
MP_PROPERTY_GETSET (wifi_radio_mac_address_ap_obj ,
213
231
(mp_obj_t )& wifi_radio_get_mac_address_ap_obj ,
214
232
(mp_obj_t )& wifi_radio_set_mac_address_ap_obj );
233
+ #else
234
+ MP_PROPERTY_GETTER (wifi_radio_mac_address_ap_obj ,
235
+ (mp_obj_t )& wifi_radio_get_mac_address_ap_obj );
236
+ #endif
215
237
216
238
//| def start_scanning_networks(
217
239
//| self, *, start_channel: int = 1, stop_channel: int = 11
0 commit comments