Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify isWifiOn on Kobo #5211

Merged
merged 1 commit into from Aug 14, 2019

Conversation

@NiLuJe
Copy link
Member

commented Aug 14, 2019

Don't fork for lsmod + grep, we can perfectly well parse /proc/modules
ourselves ;).

c.f., #5203 (comment)

Simplify isWifiOn on Kobo
Don't fork for lsmod + grep, we can perfectly well parse /proc/modules
ourselves ;).

c.f., #5203 (comment)

@Frenzie Frenzie added the Kobo label Aug 14, 2019

@Frenzie Frenzie added this to the 2019.09 milestone Aug 14, 2019

@Frenzie

This comment has been minimized.

Copy link
Member

commented Aug 14, 2019

And I'm not really sure when we gained this function, but this means the icon can also be shown on Kobo. At least as a basic energy use notification.

@NiLuJe

This comment has been minimized.

Copy link
Member Author

commented Aug 14, 2019

Yeah, I vaguely checked other patforms:

Kindle: lipc via dbus (though the stock lipc lua bindings) or fork(), meh :/
Cervantes: sysfs, but only true if the interface is up. Sill, probably okay for the icon ;).
PB: InkView. Possibly perfectly fine, too, but here be dragons.
Sony: double fork(), meh :/

@pazos

This comment has been minimized.

Copy link
Contributor

commented Aug 14, 2019

Cervantes: sysfs, but only true if the interface is up. Sill, probably okay for the icon ;)

Yep, on cervantes we report isWifiOn as true based on 2nd layer according to IEEE 802.11 wireless LAN protocol.

This way wifi is on even on networks where we cannot ping remote locations but can still access to LAN services.

The reason we don't care about modules is that having them loaded doesn't mean that the interface is associated with an AP. For instance isWifiOn will return false if the interface is up but wpa_supplicant failed to associate.

@NiLuJe

This comment has been minimized.

Copy link
Member Author

commented Aug 14, 2019

Yep, whereas I needed isWifiOn as-is on Kobo to deal with crappy launchers that left WiFi in a broken/dangerous/crashy state ;).

@Frenzie Frenzie merged commit 1051122 into koreader:master Aug 14, 2019

1 check passed

ci/circleci: build Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.