diff --git a/reactor-plc/threads.lua b/reactor-plc/threads.lua index 0de3b7e..f262b4e 100644 --- a/reactor-plc/threads.lua +++ b/reactor-plc/threads.lua @@ -212,7 +212,7 @@ function threads.thread__main(smem, init) ---@cast device Modem local is_comms_modem = util.trinary(plc_dev.modem_wired, plc_dev.modem_iface == param1, device.isWireless()) - -- note, check init_ok since nic will be nil if it is false + -- note, check init_ok first since nic will be nil if it is false if is_comms_modem and not (plc_state.init_ok and nic.is_connected()) then -- reconnected modem plc_dev.modem = device diff --git a/scada-common/network.lua b/scada-common/network.lua index 7483c8e..279a806 100644 --- a/scada-common/network.lua +++ b/scada-common/network.lua @@ -86,9 +86,9 @@ function network.nic(modem) -- used to quickly return out of tx/rx functions if there is nothing to do connected = true, -- used to avoid costly MAC calculations if not required - use_hash = c_eng.hmac and modem.isWireless(), + use_hash = c_eng.hmac and modem.isWireless(), -- open channels - channels = {} + channels = {} } ---@class nic:Modem diff --git a/scada-common/ppm.lua b/scada-common/ppm.lua index a0a1247..d540a34 100644 --- a/scada-common/ppm.lua +++ b/scada-common/ppm.lua @@ -447,7 +447,7 @@ end ---@return table|nil reactor function table function ppm.get_fission_reactor() return ppm.get_device("fissionReactorLogicAdapter") end --- get the named wired modem +-- get a wired modem by name ---@nodiscard ---@param iface string CC peripheral interface ---@return Modem|nil modem function table