2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
koreader/frontend/device.lua
Martín Fernández 1e69fae7bc [feat] Add support for BQ/Fnac devices (#4294)
Adds support for devices found in https://blog.bq.com/es/bq-ereaders-developers-program/. Tested on BQ Cervantes 4 (last BQ device from 2017).

It adds a new touch input event handler (discussed in #4275) which should work on other single touch devices (ie: Kobo Touch, Mini, Glo, Aura HD) but wasn't tested.

Includes base bump with: [feat] Add BQ/Fnac device support (https://github.com/koreader/koreader-base/pull/745)
2018-10-31 23:48:36 +01:00

51 lines
1.3 KiB
Lua

local isAndroid, _ = pcall(require, "android")
local util = require("ffi/util")
local function probeDevice()
if util.isSDL() then
return require("device/sdl/device")
end
if isAndroid then
return require("device/android/device")
end
local kindle_sn = io.open("/proc/usid", "r")
if kindle_sn then
kindle_sn:close()
return require("device/kindle/device")
end
local kg_test_stat = lfs.attributes("/bin/kobo_config.sh")
if kg_test_stat then
return require("device/kobo/device")
end
local pbook_test_stat = lfs.attributes("/ebrmain")
if pbook_test_stat then
return require("device/pocketbook/device")
end
local sony_prstux_test_stat = lfs.attributes("/etc/PRSTUX")
if sony_prstux_test_stat then
return require("device/sony-prstux/device")
end
local cervantes_test_stat = lfs.attributes("/usr/bin/ntxinfo")
if cervantes_test_stat then
return require("device/cervantes/device")
end
-- add new ports here:
--
-- if --[[ implement a proper test instead --]] false then
-- return require("device/newport/device")
-- end
error("Could not find hardware abstraction for this platform. If you are trying to run the emulator, please ensure SDL is installed.")
end
local dev = probeDevice()
dev:init()
return dev