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 any additional bits are being used in
wifi_connect
(eg. by setting both aCONNECTED
andIP_ASSIGNED
flag), a direct comparison ofresult == CONNECTED
will fail even if theCONNECTED
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.