mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
36 lines
566 B
Lua
36 lines
566 B
Lua
--
|
|
-- Core I/O - Pocket Central I/O Management
|
|
--
|
|
|
|
local psil = require("scada-common.psil")
|
|
|
|
local coreio = {}
|
|
|
|
---@class pocket_core_io
|
|
local io = {
|
|
ps = psil.create()
|
|
}
|
|
|
|
---@enum POCKET_LINK_STATE
|
|
local LINK_STATE = {
|
|
UNLINKED = 0,
|
|
SV_LINK_ONLY = 1,
|
|
API_LINK_ONLY = 2,
|
|
LINKED = 3
|
|
}
|
|
|
|
coreio.LINK_STATE = LINK_STATE
|
|
|
|
-- get the core PSIL
|
|
function coreio.core_ps()
|
|
return io.ps
|
|
end
|
|
|
|
-- set network link state
|
|
---@param state POCKET_LINK_STATE
|
|
function coreio.report_link_state(state)
|
|
io.ps.publish("link_state", state)
|
|
end
|
|
|
|
return coreio
|