GIGA R1: fix for UDP endPacket failing #964
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for #944 (GIGA R1, WiFiUDP::endPacket() fails after release 4.1.3)
Apparently the problem was introduced in 79d35ef (this introduced support for hidden WiFi Network).
The "unknown" network mentioned in #944 was mistaken for an hidden network causing the problem (as a side effect the failed connection took much more time because of the re-tries to connect to not existent network).
The PR bypass the problem defaulting the security parameter of begin() to Unknown.
If the network is not hidden the security is taken from the connection itself.
If the network is hidden the user must set the security => if the security is Unknown the user has not set the security parameter, so this is an attempt to connect to a not existent network and the PR restore the previous behavior (no attempt to connect, this also remove the additional time).