|
|
@ -1,28 +0,0 @@ |
|
|
|
-- This file takes as input a script and a label |
|
|
|
-- it will ask the eeprom machine to flash it to an eeprom |
|
|
|
|
|
|
|
local computer = require("computer") |
|
|
|
local net = require("net") |
|
|
|
|
|
|
|
local args = {...} |
|
|
|
|
|
|
|
print("Reading " .. args[1]) |
|
|
|
|
|
|
|
f = io.open(args[1]) |
|
|
|
local bytes = f:read() |
|
|
|
f:close() |
|
|
|
computer.beep(100) |
|
|
|
|
|
|
|
print("Broadcasting bios") |
|
|
|
if args[2] == nil then |
|
|
|
net.broadcast(10, "eeprom-flash", bytes) |
|
|
|
else |
|
|
|
net.broadcast(10, "eeprom-flash", bytes, args[2]) |
|
|
|
end |
|
|
|
computer.beep(200) |
|
|
|
|
|
|
|
print("Waiting for response...") |
|
|
|
local pkt, err = net.recv{10} |
|
|
|
|
|
|
|
print("Status: " .. tostring(pkt.data[1]) .. " Slot: " .. tostring(pkt.data[2])) |
|
|
|
computer.beep(1000) |