Kindle: NetworkMgr: isWifiOn isConnected (#10059)

isWifiOn for kindle currently returns if the interface is connected, change this to doing what is says isWifiOn the file is only present if the wireless interface is up.

isConnected pings the gateway, rely on the kernel for a more reliable check.

Whan connecting to my android phone's wifi hotspot to remote debug from my phone, the network is connected yet the phone(gateway) does not respond to pings leading koreader to shut down the connection thinking it is unsuccessful
reviewable/pr10036/r5^2 v2023.01
yparitcher 1 year ago committed by GitHub
parent b070a121d6
commit 747c3eaf9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -84,7 +84,7 @@ local function isWifiUp()
local out = file:read("*number")
file:close()
return out == 1
return true, out == 1
end
--[[

@ -248,6 +248,9 @@ end
function NetworkMgr:isConnected()
if Device:isAndroid() or Device:isCervantes() or Device:isPocketBook() or Device:isEmulator() then
return self:isWifiOn()
elseif Device:isKindle() then
local on, connected = self:isWifiOn()
return on and connected
else
-- Pull the default gateway first, so we don't even try to ping anything if there isn't one...
local default_gw

Loading…
Cancel
Save