Skip to content

Commit

Permalink
Merge pull request #964 from maidnl/GIGA_R1_WiFiUDP_endPacket_fails_fix
Browse files Browse the repository at this point in the history
GIGA R1: fix for UDP endPacket failing
  • Loading branch information
pennam authored Oct 2, 2024
2 parents b7b114e + 2a92205 commit 6ae4fb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions libraries/WiFi/src/WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ int arduino::WiFiClass::begin(const char* ssid, const char* passphrase, wl_enc_t
_security = ap_list[connected_ap].get_security();
} else {
// For hidden networks, the security mode must be set explicitly.
// if ENC_TYPE_UNKNOWN this means that is the default value and so the user
// has not set it... no worth trying, it is probably an unknown (not hidden)
// interface
if(security == ENC_TYPE_UNKNOWN) {
_currentNetworkStatus = WL_CONNECT_FAILED;
return _currentNetworkStatus;
}
_security = enum2sec(security);
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/WiFi/src/WiFi.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class WiFiClass : public MbedSocketClass {
* param passphrase: Passphrase. Valid characters in a passphrase
* must be between ASCII 32-126 (decimal).
*/
int begin(const char* ssid, const char* passphrase, wl_enc_type security = ENC_TYPE_CCMP);
int begin(const char* ssid, const char* passphrase, wl_enc_type security = ENC_TYPE_UNKNOWN);

// Inherit config methods from the parent class
using MbedSocketClass::config;
Expand Down

0 comments on commit 6ae4fb5

Please sign in to comment.