Skip to content

Commit bf4906b

Browse files
peterharperuklurch
andauthored
Improve error code description for some cyw43 connection methods (#2586)
* Improve error code description for some cyw43 connection methods Fixes #2564 * Apply suggestions from code review Put error description on separate lines for clarity. Co-authored-by: Andrew Scheller <[email protected]> --------- Co-authored-by: Andrew Scheller <[email protected]>
1 parent f194749 commit bf4906b

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/rp2_common/pico_cyw43_arch/include/pico/cyw43_arch.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,9 @@ void cyw43_arch_disable_ap_mode(void);
399399
* \param auth the authorization type to use when the password is enabled. Values are \ref CYW43_AUTH_WPA_TKIP_PSK,
400400
* \ref CYW43_AUTH_WPA2_AES_PSK, or \ref CYW43_AUTH_WPA2_MIXED_PSK (see \ref CYW43_AUTH_)
401401
*
402-
* \return 0 if the initialization is successful, an error code otherwise see \ref pico_error_codes
402+
* \return 0 if the connection is successful.
403+
* PICO_ERROR_BADAUTH is returned if the WiFi password is wrong.
404+
* PICO_ERROR_CONNECT_FAILED is returned if the connection failed for some other reason.
403405
*/
404406
int cyw43_arch_wifi_connect_blocking(const char *ssid, const char *pw, uint32_t auth);
405407

@@ -413,7 +415,9 @@ int cyw43_arch_wifi_connect_blocking(const char *ssid, const char *pw, uint32_t
413415
* \param auth the authorization type to use when the password is enabled. Values are \ref CYW43_AUTH_WPA_TKIP_PSK,
414416
* \ref CYW43_AUTH_WPA2_AES_PSK, or \ref CYW43_AUTH_WPA2_MIXED_PSK (see \ref CYW43_AUTH_)
415417
*
416-
* \return 0 if the initialization is successful, an error code otherwise see \ref pico_error_codes
418+
* \return 0 if the connection is successful.
419+
* PICO_ERROR_BADAUTH is returned if the WiFi password is wrong.
420+
* PICO_ERROR_CONNECT_FAILED is returned if the connection failed for some other reason.
417421
*/
418422
int cyw43_arch_wifi_connect_bssid_blocking(const char *ssid, const uint8_t *bssid, const char *pw, uint32_t auth);
419423

@@ -427,7 +431,10 @@ int cyw43_arch_wifi_connect_bssid_blocking(const char *ssid, const uint8_t *bssi
427431
* \ref CYW43_AUTH_WPA2_AES_PSK, or \ref CYW43_AUTH_WPA2_MIXED_PSK (see \ref CYW43_AUTH_)
428432
* \param timeout how long to wait in milliseconds for a connection to succeed before giving up
429433
*
430-
* \return 0 if the initialization is successful, an error code otherwise see \ref pico_error_codes
434+
* \return 0 if the connection is successful.
435+
* PICO_ERROR_TIMEOUT is returned if the timeout is reached before a successful connection.
436+
* PICO_ERROR_BADAUTH is returned if the WiFi password is wrong.
437+
* PICO_ERROR_CONNECT_FAILED is returned if the connection failed for some other reason.
431438
*/
432439
int cyw43_arch_wifi_connect_timeout_ms(const char *ssid, const char *pw, uint32_t auth, uint32_t timeout);
433440

@@ -442,7 +449,10 @@ int cyw43_arch_wifi_connect_timeout_ms(const char *ssid, const char *pw, uint32_
442449
* \ref CYW43_AUTH_WPA2_AES_PSK, or \ref CYW43_AUTH_WPA2_MIXED_PSK (see \ref CYW43_AUTH_)
443450
* \param timeout how long to wait in milliseconds for a connection to succeed before giving up
444451
*
445-
* \return 0 if the initialization is successful, an error code otherwise see \ref pico_error_codes
452+
* \return 0 if the connection is successful.
453+
* PICO_ERROR_TIMEOUT is returned if the timeout is reached before a successful connection.
454+
* PICO_ERROR_BADAUTH is returned if the WiFi password is wrong.
455+
* PICO_ERROR_CONNECT_FAILED is returned if the connection failed for some other reason.
446456
*/
447457
int cyw43_arch_wifi_connect_bssid_timeout_ms(const char *ssid, const uint8_t *bssid, const char *pw, uint32_t auth, uint32_t timeout);
448458

0 commit comments

Comments
 (0)