mirror of https://github.com/koreader/koreader
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96850c23a0
Much easier to deal with thanks to the cleanup work done in #10062 ;). * `carrier` is set to 1 as soon as the device is *administratively* up (in practice, as soon as we run `ifconfig up`). This is perfectly fine for `isWifiOn`, but absolutely not for `isConnected`, because we are not, actually, connected to *anything*, no attempt at associating has even been made at that point. Besides being semantically wrong, in practice, this will horribly break the connectivity check, because it expects that `isConnected` means we can talk to at least the LAN. * Delving into the Linux docs reveals that `operstate` looks like a better candidate, as it reflects *operational status*; for Wi-Fi, that means associated and successfully authenticated. That's... closer, but still not it, because we still don't have an IP, so we technically can't talk to anything other than the AP. * So, I've brought out the big guns (`getifaddrs`), and replicated a bit of code that I already use in the USBNetwork hack on Kindle, to detect whether we actually have an IP assigned. (Other approaches, like `/proc/net/route`, may not be entirely fool-proof, and/or get complicated when IPv6 enters the fray (which it does, on Kobo, Mk. 8+ devices are IPv6-enabled)). TL;DR: Bunch of C via ffi, and `isConnected` now returns true only when the device is operationally up *and* we have an IP assigned. Pulls in https://github.com/koreader/koreader-base/pull/1579 & https://github.com/koreader/lj-wpaclient/pull/10 |
1 year ago | |
---|---|---|
.. | ||
apps | 1 year ago | |
device | 1 year ago | |
document | 2 years ago | |
ui | 1 year ago | |
cache.lua | 2 years ago | |
cacheitem.lua | 2 years ago | |
configurable.lua | 3 years ago | |
datetime.lua | 2 years ago | |
dbg.lua | 2 years ago | |
depgraph.lua | 4 years ago | |
device.lua | 3 years ago | |
dispatcher.lua | 1 year ago | |
docsettings.lua | 2 years ago | |
dump.lua | 2 years ago | |
fontlist.lua | 2 years ago | |
gettext.lua | 2 years ago | |
httpclient.lua | 8 years ago | |
languagesupport.lua | 2 years ago | |
logger.lua | 2 years ago | |
luadata.lua | 2 years ago | |
luadefaults.lua | 2 years ago | |
luasettings.lua | 2 years ago | |
luxl.lua | 4 years ago | |
optmath.lua | 3 years ago | |
persist.lua | 2 years ago | |
pluginloader.lua | 2 years ago | |
pluginshare.lua | 2 years ago | |
random.lua | 5 years ago | |
readcollection.lua | 4 years ago | |
readhistory.lua | 1 year ago | |
socketutil.lua | 2 years ago | |
sort.lua | 1 year ago | |
userpatch.lua | 1 year ago | |
util.lua | 2 years ago | |
version.lua | 2 years ago |