Skip to content

Commit

Permalink
Description: Network setup changes
Browse files Browse the repository at this point in the history
- Simplify WEP input (figure out encryption from length of entered key) 


git-svn-id: https://svn.slimdevices.com/repos/jive/7.8/trunk/squeezeplay@9676 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9
  • Loading branch information
Felix Mueller committed Mar 23, 2012
1 parent 039d840 commit 6129a9c
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,11 @@ function _enterPassword(self, iface, ssid, nocheck)
return _enterPSK(self, iface, ssid)

elseif string.find(flags, "WEP") then
return _chooseWEPLength(self, iface, ssid)
-- fm+
-- return _chooseWEPLength(self, iface, ssid)
self.encryption = "wep40_104"
return _enterWEPKey(self, iface, ssid)
-- fm-

elseif string.find(flags, "WPA%-EAP") or string.find(flags, "WPA2%-EAP") then
return _enterEAP(self, iface, ssid)
Expand Down Expand Up @@ -778,19 +782,25 @@ function _chooseEncryption(self, iface, ssid)
_connect(self, iface, ssid, true, false)
end
},
-- fm+
-- {
-- text = self:string("NETWORK_WEP_64"),
-- sound = "WINDOWSHOW",
-- callback = function()
-- self.encryption = "wep40"
-- _enterWEPKey(self, iface, ssid)
-- end
-- },
-- fm-

{
text = self:string("NETWORK_WEP_64"),
sound = "WINDOWSHOW",
callback = function()
self.encryption = "wep40"
_enterWEPKey(self, iface, ssid)
end
},
{
text = self:string("NETWORK_WEP_128"),
text = self:string("NETWORK_WEP_64_128"),
sound = "WINDOWSHOW",
callback = function()
self.encryption = "wep104"
-- fm+
-- self.encryption = "wep104"
self.encryption = "wep40_104"
-- fm-
_enterWEPKey(self, iface, ssid)
end
},
Expand Down Expand Up @@ -861,12 +871,19 @@ function _enterWEPKey(self, iface, ssid)
window:setAllowScreensaver(false)

local v
-- set the initial value
if self.encryption == "wep40" then
v = Textinput.hexValue("", 10, 10)
else
v = Textinput.hexValue("", 26, 26)
end

-- fm+
-- -- set the initial value
-- if self.encryption == "wep40" then
-- v = Textinput.hexValue("", 10, 10)
-- else
-- v = Textinput.hexValue("", 26, 26)
-- end

-- allow for longer input
self.encryption = "wep40_104"
v = Textinput.hexValue("", 10, 26)
-- fm-

local textinput = Textinput("textinput", v,
function(widget, value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,21 @@ NETWORK_WEP_128
RU 128-разрядный WEP (26 знаков)
SV 128-bitars WEP (26 tecken)

NETWORK_WEP_64_128
CS WEP 64-bit (10 znaků) / WEP 128-bit (26 znaků)
DA WEP 64-bit (10 tegn) / WEP 128-bit (26 tegn)
DE 64-Bit-WEP (10 Zeichen) / 128-Bit-WEP (26 Zeichen)
EN WEP 64-bit (10 Characters) / WEP 128-bit (26 Characters)
ES WEP de 64 bits (10 caracteres) / WEP de 128 bits (26 caracteres)
FI WEP 64-bittinen (10 merkkiä) / WEP 128-bittinen (26 merkkiä)
FR WEP 64 bits (10 caractères) / WEP 128 bits (26 caractères)
IT WEP a 64 bit (10 caratteri) / WEP a 128 bit (26 caratteri)
NL WEP 64-bits (10 tekens) / WEP 128 bits (26 tekens)
NO WEP 64-bit (10 tegn) / WEP 128-bit (26 tegn)
PL WEP 64 bity (10 znaków) / WEP 128 bitów (26 znaków)
RU 64-разрядный WEP (10 знаков) / 128-разрядный WEP (26 знаков)
SV 64-bitars WEP (10 tecken) / 128-bitars WEP (26 tecken)

NETWORK_WPA
CS WPA Personal
DA WPA Personal
Expand Down
21 changes: 15 additions & 6 deletions src/squeezeplay_squeezeos/share/jive/net/Networking.lua
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,10 @@ function t_addNetwork(self, ssid, option)
assert(self:request(request) == "OK\n", "wpa_cli failed:" .. request)
end

if option.encryption == "wep40" or option.encryption == "wep104" then
-- fm+
-- if option.encryption == "wep40" or option.encryption == "wep104" then
if option.encryption == "wep40_104" then
-- fm-
log:info("encryption WEP")

request = 'SET_NETWORK ' .. id .. ' wep_key0 ' .. option.key
Expand Down Expand Up @@ -1961,12 +1964,18 @@ function t_wpsStatus(self)
-- No encryption
if proto == nil and psk == nil and key == nil then
status.wps_encryption = "none"
-- WEP 64
elseif key ~= nil and #key <= 10 then
status.wps_encryption = "wep40"
-- WEP 128

-- fm+
-- -- WEP 64
-- elseif key ~= nil and #key <= 10 then
-- status.wps_encryption = "wep40"
-- -- WEP 128
-- elseif key ~= nil then
-- status.wps_encryption = "wep104"
elseif key ~= nil then
status.wps_encryption = "wep104"
status.wps_encryption = "wep10_104"
-- fm-

-- WPA
elseif proto == "WPA" then
status.wps_encryption = "wpa"
Expand Down

0 comments on commit 6129a9c

Please sign in to comment.