You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
539 B
Lua
30 lines
539 B
Lua
local com = {}
|
|
local devices = {}
|
|
|
|
function com.isAvailable(pid,devName)
|
|
|
|
end
|
|
function com.invoke(pid,devName,...)
|
|
|
|
end
|
|
function com.proxy(devName)
|
|
|
|
end
|
|
|
|
function com.init()
|
|
for k,v in components.list() do
|
|
devices[v] = {["type"] = components.type(v)} -- components type
|
|
end
|
|
end
|
|
function com.runtime()
|
|
while true do
|
|
local eD = {coroutine.yield()}
|
|
if eD[1] == "component_added" then -- component added
|
|
devices[eD[2]] = {["type"] = eD[3]}
|
|
elseif eD[1] == "component_removed" then -- component removed
|
|
|
|
end
|
|
end
|
|
end
|
|
|
|
return com |