Merge pull request #3758 from tannewt/update_connect_doc

Update wifi.Radio.connect doc
This commit is contained in:
Jeff Epler 2020-11-25 21:09:56 -06:00 committed by GitHub
commit 6fd123a5c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 4 deletions

View File

@ -138,9 +138,9 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t
if (bssid_len > 0){
memcpy(&config->sta.bssid, bssid, bssid_len);
config->sta.bssid[bssid_len] = 0;
config->sta.bssid_set = 1;
config->sta.bssid_set = true;
} else {
config->sta.bssid_set = 0;
config->sta.bssid_set = false;
}
// If channel is 0 (default/unset) and BSSID is not given, do a full scan instead of fast scan
// This will ensure that the best AP in range is chosen automatically

View File

@ -142,9 +142,25 @@ const mp_obj_property_t wifi_radio_hostname_obj = {
(mp_obj_t)&mp_const_none_obj},
};
//| def connect(self, ssid: ReadableBuffer, password: ReadableBuffer = b"", *, channel: Optional[int] = 0, timeout: Optional[float] = None) -> bool:
//| def connect(self,
//| ssid: ReadableBuffer,
//| password: ReadableBuffer = b"",
//| *,
//| channel: Optional[int] = 0,
//| bssid: Optional[ReadableBuffer] = b"",
//| timeout: Optional[float] = None) -> bool:
//| """Connects to the given ssid and waits for an ip address. Reconnections are handled
//| automatically once one connection succeeds."""
//| automatically once one connection succeeds.
//|
//| By default, this will scan all channels and connect to the access point (AP) with the
//| given ``ssid`` and greatest signal strength (rssi).
//|
//| If ``channel`` is given, the scan will begin with the given channel and connect to
//| the first AP with the given ``ssid``. This can speed up the connection time
//| significantly because a full scan doesn't occur.
//|
//| If ``bssid`` is given, the scan will start at the first channel or the one given and
//| connect to the AP with the given ``bssid`` and ``ssid``."""
//| ...
//|
STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {