Skip to content

Commit 6f6c0cf

Browse files
committed
embellish rtd comments. channel _should_ default to 1 behind the scenes since 0 is out of range, but just to be sure, default channel to 1
1 parent c510c4d commit 6f6c0cf

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

shared-bindings/wifi/Radio.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,21 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_station_obj, wifi_radio_stop_station);
192192

193193
//| def start_ap(self,
194194
//| ssid: ReadableBuffer,
195-
//| password: ReadableBuffer = b"") -> None:
196-
//| """Starts an Access Point with the specified ssid and password."""
195+
//| password: ReadableBuffer = b"",
196+
//| *,
197+
//| channel: Optional[int] = 1) -> None:
198+
//| """Starts an Access Point with the specified ssid and password.
199+
//|
200+
//| If ``channel`` is given, the access point will use that channel unless
201+
//| wifi is already operating on a different channel due to an active station."""
197202
//| ...
198203
//|
199204
STATIC mp_obj_t wifi_radio_start_ap(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
200205
enum { ARG_ssid, ARG_password, ARG_channel };
201206
static const mp_arg_t allowed_args[] = {
202207
{ MP_QSTR_ssid, MP_ARG_REQUIRED | MP_ARG_OBJ },
203208
{ MP_QSTR_password, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
204-
{ MP_QSTR_channel, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} },
209+
{ MP_QSTR_channel, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} },
205210
};
206211

207212
wifi_radio_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);

0 commit comments

Comments
 (0)