aboutsummaryrefslogtreecommitdiffstats
path: root/conf.d/project
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-26 18:36:47 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commitc22ad857bcd2f567d22f3239d91fa65720718713 (patch)
tree165407be42745a190672ff64fe27503074380735 /conf.d/project
parent7f5a4ef3053eaac5c3f936b6294087d3d2b72c38 (diff)
lua2c completely operationnal
- Retrieve args from lua call correctly - Correctly push and set function pointer into plugin symbols Change-Id: I12d03e1101c458a042887a67a35a08082bd98f4c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'conf.d/project')
-rw-r--r--conf.d/project/lua.d/init-daemon-04-oncall.lua12
1 files changed, 4 insertions, 8 deletions
diff --git a/conf.d/project/lua.d/init-daemon-04-oncall.lua b/conf.d/project/lua.d/init-daemon-04-oncall.lua
index 04b6080..7dc4669 100644
--- a/conf.d/project/lua.d/init-daemon-04-oncall.lua
+++ b/conf.d/project/lua.d/init-daemon-04-oncall.lua
@@ -42,8 +42,6 @@ function _Unit_Converter(source, args, event)
local sourcei, targeti = _positions[sourceunits], _positions[targetunits]
assert(sourcei and targeti)
- AFB:notice("LUA OnCall Echo Args source=%s args=%s event=%s", source, args, event)
-
if sourcei<targeti then
local base=1
@@ -51,10 +49,9 @@ function _Unit_Converter(source, args, event)
base=base*_interval[i][2]
end
- print("Value in", targetunits, "is", value/base)
- _result["result"] = value/base
+ event["value"] = value/base
- lua2c["setSignalValueWrap"](source, _result)
+ lua2c["setSignalValueWrap"](source, event)
elseif sourcei>targeti then
@@ -63,10 +60,9 @@ function _Unit_Converter(source, args, event)
base=base*interval[i][2]
end
- print("Value in ", targetunits, "is", value*base)
- _result["result"] = value/base
+ event["value"] = value/base
- lua2c["setSignalValueWrap"](source, _result)
+ lua2c["setSignalValueWrap"](source, event)
else
print("No conversion")