1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-21 18:57:41 +00:00

peripheral overhaul

This commit is contained in:
kepler155c@gmail.com
2018-01-06 22:25:33 -05:00
parent 911fec9118
commit 13ec8ea04f
7 changed files with 49 additions and 27 deletions

View File

@@ -8,8 +8,8 @@ local Socket = require('socket')
local Util = require('util')
Event.addRoutine(function()
print('peripheral: listening on port 189')
while true do
print('peripheral: listening on port 189')
local socket = Socket.server(189)
print('peripheral: connection from ' .. socket.dhost)
@@ -19,7 +19,9 @@ Event.addRoutine(function()
if uri then
local peripheral = Peripheral.lookup(uri)
if peripheral then
if not peripheral then
print('peripheral: invalid peripheral ' .. uri)
else
print('peripheral: proxing ' .. uri)
local proxy = {
methods = { }