fix: close port 0 at correct place
This commit is contained in:
@@ -98,9 +98,7 @@ end
|
||||
-- scan
|
||||
function handleScan(keys)
|
||||
-- to-do: check and maybe inform if turtle is already linked to another host
|
||||
|
||||
HOST_CHANNEL = keys.hostChannel
|
||||
modem.close(0)
|
||||
|
||||
log.info("received scan, host channel assigned to %d, replying...", keys.hostChannel)
|
||||
|
||||
@@ -129,6 +127,7 @@ function handleRegister(keys)
|
||||
|
||||
log.info("received register, host assigned channel: %d", keys.turtleChannel)
|
||||
modem.open(keys.turtleChannel)
|
||||
modem.close(0)
|
||||
end
|
||||
|
||||
declareCommandHandler("REGISTER", handleRegister, { ["id"] = "number", ["turtleChannel"] = "number" })
|
||||
|
||||
Reference in New Issue
Block a user