Skip to content

Conversation

@e5h
Copy link

@e5h e5h commented Jul 22, 2024

If any additional bits are being used in wifi_connect (eg. by setting both a CONNECTED and IP_ASSIGNED flag), a direct comparison of result == CONNECTED will fail even if the CONNECTED bit is set, due to the presence of other bits.

Since the checked flags are cleared via xClearOnExit = pdTRUE, the flag notifying an IP assignment will be lost, and not set again in any reasonable amount of time. This is a simple change to evaluate the bitwise & result of the return to evaluate if the correct flag has been set.

If additional flags are set in the wifi events, a direct comparison of "result == CONNECTED" will fail even if the bits are set. Since these flags were cleared, the wifi will be connected but never return the correct status from "wifi_connect_sta".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant