Skip to content

Commit 6ae4fb5

Browse files
authored
Merge pull request #964 from maidnl/GIGA_R1_WiFiUDP_endPacket_fails_fix
GIGA R1: fix for UDP endPacket failing
2 parents b7b114e + 2a92205 commit 6ae4fb5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Diff for: libraries/WiFi/src/WiFi.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ int arduino::WiFiClass::begin(const char* ssid, const char* passphrase, wl_enc_t
6060
_security = ap_list[connected_ap].get_security();
6161
} else {
6262
// For hidden networks, the security mode must be set explicitly.
63+
// if ENC_TYPE_UNKNOWN this means that is the default value and so the user
64+
// has not set it... no worth trying, it is probably an unknown (not hidden)
65+
// interface
66+
if(security == ENC_TYPE_UNKNOWN) {
67+
_currentNetworkStatus = WL_CONNECT_FAILED;
68+
return _currentNetworkStatus;
69+
}
6370
_security = enum2sec(security);
6471
}
6572

Diff for: libraries/WiFi/src/WiFi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class WiFiClass : public MbedSocketClass {
7474
* param passphrase: Passphrase. Valid characters in a passphrase
7575
* must be between ASCII 32-126 (decimal).
7676
*/
77-
int begin(const char* ssid, const char* passphrase, wl_enc_type security = ENC_TYPE_CCMP);
77+
int begin(const char* ssid, const char* passphrase, wl_enc_type security = ENC_TYPE_UNKNOWN);
7878

7979
// Inherit config methods from the parent class
8080
using MbedSocketClass::config;

0 commit comments

Comments
 (0)