Initialize modular ATM10 CC control system

This commit is contained in:
2026-07-13 02:46:11 +02:00
commit 5362d31036
28 changed files with 331 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
local constants = require("core.constants")
local M = {}
function M.message(kind, source, target, payload)
return {
protocol = constants.PROTOCOL,
version = constants.PROTOCOL_VERSION,
type = kind,
source = source,
target = target,
requestId = ("%s-%d-%d"):format(source, os.getComputerID(), os.epoch("utc")),
timestamp = os.epoch("utc"),
payload = payload or {},
}
end
function M.valid(message)
return type(message) == "table"
and message.protocol == constants.PROTOCOL
and message.version == constants.PROTOCOL_VERSION
and type(message.type) == "string"
end
return M