Not check the return value of esp_wifi_connect() in any case? Why?

axellin
Posts: 197
Joined: Mon Sep 17, 2018 9:09 am

Not check the return value of esp_wifi_connect() in any case? Why?

Postby axellin » Sat Jan 16, 2021 1:53 am

In recent change of esp-idf, I found this commit:
https://github.com/espressif/esp-idf/co ... d1eac2f546

Can someone explain why?
Did this change fix any issue?

BTW,
I know what is changed by reading the code, but I don't know the *reason* for the change and what is the user visible impact.
Please improve the commit log to describe the *reason* for the changes.

ESP_Sprite
Posts: 9048
Joined: Thu Nov 26, 2015 4:08 am

Re: Not check the return value of esp_wifi_connect() in any case? Why?

Postby ESP_Sprite » Sun Jan 17, 2021 1:58 pm

From our internal commit: 'esp_wifi_connect() is called after triggering the WiFi disconnect event when the WiFi is connected, and esp_wifi_connect() returns ERR. In this case, we should not check the return value of esp_wifi_connect()'

My guess would be that this works around some issues that would make the examples way more complicated if handled correctly.

Who is online

Users browsing this forum: Bing [Bot], Hello1024 and 159 guests