From a786404092ff3ccf5786470859345aa81dcf2b78 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Tue, 16 Apr 2024 15:55:40 -0400 Subject: [PATCH] #476 fixed PPM not initing fault counter in __index handler when a function is found --- scada-common/ppm.lua | 2 ++ scada-common/util.lua | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scada-common/ppm.lua b/scada-common/ppm.lua index 34a6a60..e6a95e8 100644 --- a/scada-common/ppm.lua +++ b/scada-common/ppm.lua @@ -141,7 +141,9 @@ local function peri_init(iface) local funcs = peripheral.wrap(iface) if (type(funcs) == "table") and (type(funcs[key]) == "function") then -- add this function then return it + self.fault_counts[key] = 0 self.device[key] = protect_peri_function(key, funcs[key]) + log.info(util.c("PPM: [@", iface, "] initialized previously undefined field ", key, "()")) return self.device[key] diff --git a/scada-common/util.lua b/scada-common/util.lua index 5433ab9..98a1667 100644 --- a/scada-common/util.lua +++ b/scada-common/util.lua @@ -22,7 +22,7 @@ local t_pack = table.pack local util = {} -- scada-common version -util.version = "1.2.1" +util.version = "1.2.2" util.TICK_TIME_S = 0.05 util.TICK_TIME_MS = 50