bool KoboExportUSBStorage() { #ifdef KOBO bool result = false; RmMod("g_ether"); RmMod("g_file_storage"); switch (DetectKoboModel()) { case KoboModel::UNKNOWN: // Let unknown try the old device case KoboModel::MINI: case KoboModel::TOUCH: case KoboModel::AURA: InsMod("/drivers/ntx508/usb/gadget/arcotg_udc.ko"); result = InsMod("/drivers/ntx508/usb/gadget/g_file_storage.ko", "file=/dev/mmcblk0p3", "stall=0"); break; case KoboModel::GLO_HD: InsMod("/drivers/mx6sl-ntx/usb/gadget/arcotg_udc.ko"); result = InsMod("/drivers/mx6sl-ntx/usb/gadget/g_file_storage.ko", "file=/dev/mmcblk0p3", "stall=0"); break; } return result; #else return true; #endif }
bool KoboWifiOff() { #ifdef KOBO const char* szInterface = std::getenv("INTERFACE"); if(!szInterface) { szInterface = "eth0"; } Run("/usr/bin/killall", "wpa_supplicant", "udhcpc"); Run("/bin/wlarm_le", "-i", szInterface, "down"); Run("/sbin/ifconfig", szInterface, "down"); const char * szModule = std::getenv("WIFI_MODULE"); if(!szModule) { szModule = "dhd"; } RmMod(szModule); RmMod("sdio_wifi_pwr"); return true; #else return false; #endif }
void KoboUnexportSerial() { #ifdef KOBO RmMod("g_serial"); RmMod("arcotg_udc"); #endif }
void KoboUnexportUSBStorage() { #ifdef KOBO RmMod("g_ether"); RmMod("g_file_storage"); RmMod("arcotg_udc"); #endif }
bool KoboExportUSBStorage() { #ifdef KOBO RmMod("g_ether"); RmMod("g_file_storage"); InsMod("/drivers/ntx508/usb/gadget/arcotg_udc.ko"); return InsMod("/drivers/ntx508/usb/gadget/g_file_storage.ko", "file=/dev/mmcblk0p3", "stall=0"); #else return true; #endif }
bool KoboWifiOff() { #ifdef KOBO Run("/usr/bin/killall", "wpa_supplicant", "udhcpc"); Run("/bin/wlarm_le", "-i", "eth0", "down"); Run("/sbin/ifconfig", "eth0", "down"); RmMod("dhd"); RmMod("sdio_wifi_pwr"); return true; #else return false; #endif }
bool KoboExportSerial() { #ifdef KOBO RmMod("g_ether"); RmMod("g_file_storage"); InsMod("/drivers/current/usb/gadget/arcotg_udc.ko"); if(InsMod("/drivers/current/usb/gadget/g_serial.ko")) { for(unsigned i = 0; i < 5; ++i ) { if(File::Exists("/dev/ttyGS0")) { return true; } Sleep(100); } } return false; #else return true; #endif }