-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WiFiSTA - new status constant WL_STOPPED #8849
Conversation
@JAndrassy - I think that this change will cause issues. WL_IDLE is used for other cases. I can see that WL_NO_SHILED is in the Arduino WiFi Shiled Library examples, but it is not the case for Arduino ESP32. I also see that the Arduino WiFi Library has a Note: this library was retired and is no longer maintained. Looking into the new UNO R4 WiFi, it uses other way to check the module: WL_NO_MODULE = WL_NO_SHIELD and it comes from ESP32 module. In ESP32 Arduino when the WiFi Interface is suspended, it goes to WL_NO_SHIELD state, which makes sense because it would be like "removing the shield". When the code starts the WiFi is suspended, which is equivalent to WL_NO_SHIELD... This status is changed in the WiFi Event Call back arduino-esp32/libraries/WiFi/src/WiFiGeneric.cpp Lines 1051 to 1053 in e2487b1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a clear motivation to this change in the ESP32 Arduino scope.
@me-no-dev - what do you think?
@SuGlider agreed. |
maybe be there should be a new constant in |
Let's say that we create a WL_STOPPED and this is the initial state. What would WL_NO_SHIELD be used for? 1- in the declaration of the A new constant for stopped STA would be used in (2) and (3). It should be added with a higher value (254) because the inital state must be higher than This would make But ... this could be a way to make it compatible with Arduino Upstream. @me-no-dev PTAL. |
as already the comment next to is states :-) |
OK, please proceed with the change for evaluation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's create a WL_STOPPED = 254 and use it as inital value.
to change initial WiFi.status() because WL_NO_SHIELD is checked in any generic Arduino WiFi example
373889a
to
26b27ff
Compare
All those statuses are really there only for some sort of compatibility. Reality is that original WiFi library is STA only, external chip with a very different capabilities. I am generally all for compatibility, as long as it does not prevent us to progress and provide new and better things. As @SuGlider said, this is almost never used, so I am also fine with whatever you guys decide, as long as it does not break anything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @JAndrassy - LGTM.
WL_NO_SHIELD as initial status() value stops any generic Arduino WiFi example
Generic Arduino WiFi examples start with