supervisor code cleanup, adjusted prints

This commit is contained in:
Mikayla Fischler
2022-04-28 22:41:08 -04:00
parent 67ec8fbd91
commit d688f9a1c6
4 changed files with 10 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
-- #REQUIRES comms.lua
-- #REQUIRES modbus.lua
-- #REQUIRES mqueue.lua
-- #REQUIRES util.lua
-- #REQUIRES svsessions.lua
local PROTOCOLS = comms.PROTOCOLS
@@ -11,6 +12,11 @@ local RTU_ADVERT_TYPES = comms.RTU_ADVERT_TYPES
local SESSION_TYPE = svsessions.SESSION_TYPE
local print = util.print
local println = util.println
local print_ts = util.print_ts
local println_ts = util.println_ts
-- supervisory controller communications
function superv_comms(num_reactors, modem, dev_listen, coord_listen)
local self = {
@@ -137,6 +143,7 @@ function superv_comms(num_reactors, modem, dev_listen, coord_listen)
_send_plc_linking(r_port, { RPLC_LINKING.COLLISION })
else
-- got an ID; assigned to a reactor successfully
println("connected to reactor " .. packet.data[1] .. " PLC (port " .. r_port .. ")")
log._debug("PLC_LNK: allowed for device at " .. r_port)
_send_plc_linking(r_port, { RPLC_LINKING.ALLOW })
end