api change for modems

This commit is contained in:
kepler155c@gmail.com 2019-04-18 11:13:28 -04:00
parent e6d1e58ce2
commit 54660c6089
3 changed files with 3 additions and 2 deletions

View File

@ -30,7 +30,7 @@ function Peripheral.addDevice(deviceList, side)
-- ptype = 'wireless_modem'
-- else
ptype = 'wired_modem'
if dev.getMetadata then
if dev.isAccessPoint then
-- avoid open computer relays being registered
-- as 'wired_modem'
ptype = dev.getMetadata().name or 'wired_modem'

View File

@ -2,7 +2,7 @@ local device = _G.device
local kernel = _G.kernel
local function register(v)
if v and v.isWireless and v.getMetadata and v.getNamesRemote then
if v and v.isWireless and v.isAccessPoint and v.getNamesRemote then
v.children = { }
for _, name in pairs(v.getNamesRemote()) do
local dev = v.getMethodsRemote(name)

View File

@ -145,6 +145,7 @@ function kernel.newRoutine(args)
timestamp = os.clock(),
terminal = kernel.window,
window = kernel.window,
title = 'untitled',
}, { __index = Routine })
Util.merge(routine, args)