mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2024-12-22 02:53:49 +01:00
api usb info
This commit is contained in:
parent
10cf3c35b1
commit
11c061c8ed
@ -111,6 +111,24 @@ function M.access(request, response)
|
||||
return true
|
||||
end
|
||||
|
||||
function M.usb(request, response)
|
||||
|
||||
response:setSuccess()
|
||||
|
||||
local file, error = io.open("/sys/devices/platform/ehci-platform/usb1/1-1/speed",'r')
|
||||
if file ~= nil then
|
||||
local speed = file:read('*a')
|
||||
file:close()
|
||||
speed = tonumber(speed)
|
||||
response:addData('speed', speed)
|
||||
|
||||
-- check usb device speed
|
||||
-- http://stackoverflow.com/questions/1957589/usb-port-speed-linux
|
||||
local highSpeed = (speed == 480)
|
||||
response:addData('highSpeed', highSpeed)
|
||||
end
|
||||
end
|
||||
|
||||
function M.status(request, response)
|
||||
|
||||
local ds = wifi.getDeviceState()
|
||||
|
Loading…
Reference in New Issue
Block a user