From d41ee92a1b4c7db9e2ce8640817cec54113dc7de Mon Sep 17 00:00:00 2001 From: deadprogram Date: Thu, 11 Jan 2024 12:48:05 +0100 Subject: [PATCH] rtl8720dn: allow connecting to open wifi access points Signed-off-by: deadprogram --- rtl8720dn/rtl8720dn.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rtl8720dn/rtl8720dn.go b/rtl8720dn/rtl8720dn.go index 483a1e53e..be60f2a85 100644 --- a/rtl8720dn/rtl8720dn.go +++ b/rtl8720dn/rtl8720dn.go @@ -111,7 +111,11 @@ func (r *rtl8720dn) connectToAP() error { } // Start the connection process - securityType := uint32(0x00400004) + securityType := uint32(0) // RTW_SECURITY_OPEN + if len(r.params.Passphrase) != 0 { + securityType = 0x00400004 // RTW_SECURITY_WPA2_AES_PSK + } + result := r.rpc_wifi_connect(r.params.Ssid, r.params.Passphrase, securityType, -1, 0) if result != 0 { if debugging(debugBasic) {