8000 Update wifi.Radio.connect doc · ehershey/circuitpython@4ac11c8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4ac11c8

Browse files
committed
Update wifi.Radio.connect doc
Now it includes bssid info.
1 parent e778fc1 commit 4ac11c8

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

ports/esp32s2/common-hal/wifi/Radio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t
138138
if (bssid_len > 0){
139139
memcpy(&config->sta.bssid, bssid, bssid_len);
140140
config->sta.bssid[bssid_len] = 0;
141-
config->sta.bssid_set = 1;
141+
config->sta.bssid_set = true;
142142
} else {
143-
config->sta.bssid_set = 0;
143+
config->sta.bssid_set = false;
144144
}
145145
// If channel is 0 (default/unset) and BSSID is not given, do a full scan instead of fast scan
146146
// This will ensure that the best AP in range is chosen automatically

shared-bindings/wifi/Radio.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,25 @@ const mp_obj_property_t wifi_radio_hostname_obj = {
142142
(mp_obj_t)&mp_const_none_obj},
143143
};
144144

145-
//| def connect(self, ssid: ReadableBuffer, password: ReadableBuffer = b"", *, channel: Optional[int] = 0, timeout: Optional[float] = None) -> bool:
145+
//| def connect(self,
146+
//| ssid: ReadableBuffer,
147+
//| password: ReadableBuffer = b"",
148+
//| *,
149+
//| channel: Optional[int] = 0,
150+
//| bssid: Optional[ReadableBuffer] = b"",
151+
//| timeout: Optional[float] = None) -> bool:
146152
//| """Connects to the given ssid and waits for an ip address. Reconnections are handled
147-
//| automatically once one connection succeeds."""
153+
//| automatically once one connection succeeds.
154+
//|
155+
//| By default, this will scan all channels and connect to the access point (AP) with the
156+
//| given ``ssid`` and greatest signal strength (rssi).
157+
//|
158+
//| If ``channel`` is given, the scan will begin with the given channel and connect to
159+
//| the first AP with the given ``ssid``. This can speed up the connection time
160+
//| significantly because a full scan doesn't occur.
161+
//|
162+
//| If ``bssid`` is given, the scan will start at the first channel or the one given and
163+
//| connect to the AP with the given ``bssid`` and ``ssid``."""
148164
//| ...
149165
//|
150166
STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {

0 commit comments

Comments
 (0)
0