diff --git a/Makefile b/Makefile index cb6a6f534..38bf6475f 100644 --- a/Makefile +++ b/Makefile @@ -126,6 +126,7 @@ koboupdate: all cp kobo/koreader.sh $(INSTALL_DIR)/koreader cp kobo/suspend.sh $(INSTALL_DIR)/koreader cp kobo/nickel.sh $(INSTALL_DIR)/koreader + cp kobo/wifi.sh $(INSTALL_DIR)/koreader # create new package cd $(INSTALL_DIR) && \ zip -9 -r \ diff --git a/frontend/ui/networkmgr.lua b/frontend/ui/networkmgr.lua index 7fa9115d3..4c7c53c92 100644 --- a/frontend/ui/networkmgr.lua +++ b/frontend/ui/networkmgr.lua @@ -22,7 +22,7 @@ function NetworkMgr:turnOnWifi() if Device:isKindle() then kindleEnableWifi(1) elseif Device:isKobo() then - -- TODO: turn on wifi on kobo? + os.execute("./wifi.sh on") end end @@ -30,7 +30,7 @@ function NetworkMgr:turnOffWifi() if Device:isKindle() then kindleEnableWifi(0) elseif Device:isKobo() then - -- TODO: turn off wifi on kobo? + os.execute("./wifi.sh off") end end diff --git a/kobo/wifi.sh b/kobo/wifi.sh new file mode 100644 index 000000000..910471f47 --- /dev/null +++ b/kobo/wifi.sh @@ -0,0 +1,23 @@ +#!/bin/sh +export PATH=$PATH:/sbin:/usr/sbin + +case $1 in + on ) + for mod in sdio_wifi_pwr dhd; do + insmod /drivers/ntx508/wifi/${mod}.ko 2>/dev/null + done + sleep 1 + ifconfig eth0 up + wlarm_le -i eth0 up + wpa_supplicant -s -i eth0 -c /etc/wpa_supplicant/wpa_supplicant.conf -C /var/run/wpa_supplicant -B + sleep 1 + udhcpc -S -i eth0 -s /etc/udhcpc.d/default.script -t15 -T10 -A3 -b -q >/dev/null 2>&1 & + ;; + off ) + killall wpa_supplicant 2>/dev/null + wlarm_le -i eth0 down + ifconfig eth0 down + rmmod -r dhd + rmmod -r sdio_wifi_pwr + ;; +esac