transition to kernel

This commit is contained in:
kepler155c@gmail.com
2018-01-13 15:17:26 -05:00
parent fc8d44b60d
commit bd37b57780
20 changed files with 336 additions and 223 deletions

View File

@@ -22,6 +22,7 @@ Event.addRoutine(function()
-- need to prevent multiple shares
if not peripheral then
print('peripheral: invalid peripheral ' .. uri)
socket:write('Invalid peripheral: ' .. uri)
else
print('peripheral: proxing ' .. uri)
local proxy = {
@@ -62,6 +63,11 @@ Event.addRoutine(function()
print('peripheral: lost connection from ' .. socket.dhost)
break
end
if not _G.device[peripheral.name] then
print('periperal: detached')
socket:close()
break
end
if peripheral[data.fn] then
socket:write({ peripheral[data.fn](table.unpack(data.args)) })
end