diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-09-21 18:16:21 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-12-14 11:00:25 +0100 |
commit | b9dd9b46d25f106694528722d63fdc1611d31afd (patch) | |
tree | 748d356c9d2e9700b846248a87099701d1008f28 /conf.d/project | |
parent | c27b88e3c36585d11e866902f73d1e961357c45c (diff) |
Make compile LUA2C functions, binding not working
Change-Id: I37e66929e3ebf464802f9b89a222743936862029
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'conf.d/project')
-rw-r--r-- | conf.d/project/etc/init-daemon.json | 7 | ||||
-rw-r--r-- | conf.d/project/etc/sig-demoboard.json | 2 | ||||
-rw-r--r-- | conf.d/project/lua.d/init-daemon-04-oncall.lua | 7 |
3 files changed, 15 insertions, 1 deletions
diff --git a/conf.d/project/etc/init-daemon.json b/conf.d/project/etc/init-daemon.json index 045f3fe..a631859 100644 --- a/conf.d/project/etc/init-daemon.json +++ b/conf.d/project/etc/init-daemon.json @@ -20,6 +20,13 @@ "version": "1.0", "info": "Manage interaction with gps service", "basename": "gps" + }, + { + "label": "lua2c", + "version": "1.0", + "info": "Lua2C Interface", + "basename": "lua2c-interface", + "lua2c": ["ssetSignalValue"] } ] } diff --git a/conf.d/project/etc/sig-demoboard.json b/conf.d/project/etc/sig-demoboard.json index 5eb662c..84269d6 100644 --- a/conf.d/project/etc/sig-demoboard.json +++ b/conf.d/project/etc/sig-demoboard.json @@ -2,7 +2,7 @@ "signals": [ { "id": "vehicle_speed", - "event": "low-can/messages.vehicle.speed", + "event": "low-can/messages.vehicle.average.speed", "class": "temporal", "unit": "km/h", "frequency": 1, 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 ae16aa7..d473121 100644 --- a/conf.d/project/lua.d/init-daemon-04-oncall.lua +++ b/conf.d/project/lua.d/init-daemon-04-oncall.lua @@ -28,6 +28,7 @@ _interval={ {"m/s",0.27777777777778}, } +_result = {} _positions={} for i=1,3 do _positions[_interval[i][1]]=i @@ -51,6 +52,9 @@ function _Unit_Converter(source, args, event) end print("Value in", targetunits, "is", value/base) + _result["result"] = value/base + + ssetSignalValue(source, _result) elseif sourcei>targeti then @@ -60,6 +64,9 @@ function _Unit_Converter(source, args, event) end print("Value in ", targetunits, "is", value*base) + _result["result"] = value/base + + ssetSignalValue(source, _result) else print("No conversion") |