diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-05-03 20:35:21 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-07-05 16:22:47 +0200 |
commit | 1c93ff74e3e7ec828a21e9028b99cd46752ebce8 (patch) | |
tree | 06b9ed43e55f70e354673d2e451f22e537e17b99 /conf.d/project | |
parent | e72c4b089a2e6c9f8529f9a4031913b7ca11c8a3 (diff) |
Rework loading sources and signals.
Some function that are now included in the controller submodule
do not need to be in the composer as well. Also initialize
sources and signals in the same way .
JSON configuration needs to be updated to fit this changes
Change-Id: I2043791e7ee80f8350f33ed15bdf9980c0773b82
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'conf.d/project')
-rw-r--r-- | conf.d/project/data/signal-composer-daemon-04-oncall.lua | 2 | ||||
-rw-r--r-- | conf.d/project/etc/control-basic-conf.json (renamed from conf.d/project/etc/control-txc-demo.json) | 8 | ||||
-rw-r--r-- | conf.d/project/etc/control-signal-composer.json | 9 | ||||
-rw-r--r-- | conf.d/project/etc/sig-demoboard.json | 5 | ||||
-rw-r--r-- | conf.d/project/etc/sig-doors.json | 39 | ||||
-rw-r--r-- | conf.d/project/etc/sig-geoloc.json | 9 | ||||
-rw-r--r-- | conf.d/project/etc/sig-txc.json | 11 | ||||
-rw-r--r-- | conf.d/project/etc/sources-txc.json | 6 | ||||
-rw-r--r-- | conf.d/project/etc/sources.json | 6 |
9 files changed, 63 insertions, 32 deletions
diff --git a/conf.d/project/data/signal-composer-daemon-04-oncall.lua b/conf.d/project/data/signal-composer-daemon-04-oncall.lua index 9d31f25..a66d71f 100644 --- a/conf.d/project/data/signal-composer-daemon-04-oncall.lua +++ b/conf.d/project/data/signal-composer-daemon-04-oncall.lua @@ -64,7 +64,7 @@ function _Unit_Converter(source, args, event) print('Converted value is: '.. event['value'] .. args["to"]) - _lua2c['setSignalValueWrap'](source, event) + composer:setSignalValueWrap(source, event) end -- Display receive arguments and echo them to caller diff --git a/conf.d/project/etc/control-txc-demo.json b/conf.d/project/etc/control-basic-conf.json index d44a8fe..dd7255f 100644 --- a/conf.d/project/etc/control-txc-demo.json +++ b/conf.d/project/etc/control-basic-conf.json @@ -19,10 +19,10 @@ "basename": "gps" }, { - "uid": "builtin", - "info": "Builtin routine for onReceived or getSignals routines", - "basename": "builtin", - "lua2c": "setSignalValueWrap" + "uid": "convert", + "info": "LUA fonctions used to convert standard unit.", + "spath": "/tmp", + "file": "unit-conversion.lua" } ], "signals": { diff --git a/conf.d/project/etc/control-signal-composer.json b/conf.d/project/etc/control-signal-composer.json index da100e1..1ea7198 100644 --- a/conf.d/project/etc/control-signal-composer.json +++ b/conf.d/project/etc/control-signal-composer.json @@ -9,15 +9,20 @@ }, "plugins": [ { + "uid": "convert", + "info": "LUA fonctions used to convert standard unit.", + "libs": "unit-conversion.lua" + }, + { "uid": "gps-callbacks", "info": "Manage interaction with gps service", - "basename": "gps" + "libs": "gps.ctlso" } ], "signals": { "files": ["sig-txc" ] }, "sources": { - "files": "sources" + "files": "sources-txc" } } diff --git a/conf.d/project/etc/sig-demoboard.json b/conf.d/project/etc/sig-demoboard.json index da64a26..2d9493f 100644 --- a/conf.d/project/etc/sig-demoboard.json +++ b/conf.d/project/etc/sig-demoboard.json @@ -24,10 +24,7 @@ "event": "low-can/diagnostic_messages.engine.speed", "retention": 30, "unit": "rpm", - "frequency": 1, - "onReceived": { - "function": "plugin://defaultOnReceived" - } + "frequency": 1 }, { "uid": "fuel_level", diff --git a/conf.d/project/etc/sig-doors.json b/conf.d/project/etc/sig-doors.json index 98cec4e..35f617e 100644 --- a/conf.d/project/etc/sig-doors.json +++ b/conf.d/project/etc/sig-doors.json @@ -5,56 +5,64 @@ "uid": "rear_left_window", "event": "low-can/messages.windows.rear_left.open", "onReceived": { - "function": "plugin://low-can-callbacks/isOpen" + "uri": "plugin://low-can-callbacks", + "function": "isOpen" } }, { "uid": "rear_left_door", "event": "low-can/messages.doors.rear_left.open", "onReceived": { - "function": "plugin://low-can-callbacks/isOpen" + "uri": "plugin://low-can-callbacks", + "function": "isOpen" } }, { "uid": "rear_right_window", "event": "low-can/messages.windows.rear_right.open", "onReceived": { - "function": "plugin://low-can-callbacks/isOpen" + "uri": "plugin://low-can-callbacks", + "function": "isOpen" } }, { "uid": "rear_right_door", "event": "low-can/messages.doors.rear_right.open", "onReceived": { - "function": "plugin://low-can-callbacks/isOpen" + "uri": "plugin://low-can-callbacks", + "function": "isOpen" } }, { "uid": "front_left_window", "event": "low-can/messages.windows.front_left.open", "onReceived": { - "function": "plugin://low-can-callbacks/isOpen" + "uri": "plugin://low-can-callbacks", + "function": "isOpen" } }, { "uid": "front_left_door", "event": "low-can/messages.doors.front_left.open", "onReceived": { - "function": "plugin://low-can-callbacks/isOpen" + "uri": "plugin://low-can-callbacks", + "function": "isOpen" } }, { "uid": "front_right_window", "event": "low-can/messages.windows.front_right.open", "onReceived": { - "function": "plugin://low-can-callbacks/isOpen" + "uri": "plugin://low-can-callbacks", + "function": "isOpen" } }, { "uid": "front_right_door", "event": "low-can/messages.doors.front_right.open", "onReceived": { - "function": "plugin://low-can-callbacks/isOpen" + "uri": "plugin://low-can-callbacks", + "function": "isOpen" } }, { @@ -64,7 +72,8 @@ "rear_left_door" ], "onReceived": { - "function": "plugin://low-can-callbacks/isOpen" + "uri": "plugin://low-can-callbacks", + "function": "isOpen" } }, { @@ -74,7 +83,8 @@ "rear_right_window" ], "onReceived": { - "function": "plugin://low-can-callbacks/isOpen", + "uri": "plugin://low-can-callbacks", + "function": "isOpen", "args": {} } }, @@ -85,7 +95,8 @@ "front_left_window" ], "onReceived": { - "function": "plugin://low-can-callbacks/isOpen", + "uri": "plugin://low-can-callbacks", + "function": "isOpen", "args": {} } }, @@ -96,7 +107,8 @@ "front_right_window" ], "onReceived": { - "function": "plugin://low-can-callbacks/isOpen", + "uri": "plugin://low-can-callbacks", + "function": "isOpen", "args": {} } }, @@ -113,7 +125,8 @@ "rear_right_window" ], "onReceived": { - "function": "plugin://low-can-callbacks/isOpen", + "uri": "plugin://low-can-callbacks", + "function": "isOpen", "args": { "evtname": "doors.open" } diff --git a/conf.d/project/etc/sig-geoloc.json b/conf.d/project/etc/sig-geoloc.json index 09ec6f3..0922b18 100644 --- a/conf.d/project/etc/sig-geoloc.json +++ b/conf.d/project/etc/sig-geoloc.json @@ -7,7 +7,8 @@ "unit": "degree", "frequency": 1, "onReceived": { - "function": "plugin://gps-callbacks/getLatitude" + "uri": "plugin://gps-callbacks", + "function": "getLatitude" } }, { @@ -16,7 +17,8 @@ "unit": "degree", "frequency": 1, "onReceived": { - "function": "plugin://gps-callbacks/getSignal", + "uri": "plugin://gps-callbacks", + "function": "getSignal", "args": { "what": "longitude" } @@ -38,7 +40,8 @@ "unit": "degree", "frequency": 1, "onReceived": { - "function": "lua://_Heading" + "uri": "plugin://gps-callbacks", + "function": "getHeading" } }, { diff --git a/conf.d/project/etc/sig-txc.json b/conf.d/project/etc/sig-txc.json index 275eea6..abe8a73 100644 --- a/conf.d/project/etc/sig-txc.json +++ b/conf.d/project/etc/sig-txc.json @@ -8,6 +8,14 @@ "unit": "km/h", "getSignalsArgs": { "event": "vehicle_speed" + }, + "onReceived": { + "uri": "lua://convert/", + "function": "_Unit_Converter", + "args": { + "from": "km/h", + "to": "mi/h" + } } }, { @@ -96,7 +104,8 @@ "retention": 30, "unit": "degrees", "onReceived": { - "function": "plugin://gps-callbacks/getHeading" + "uri": "plugin://gps-callbacks", + "function": "getHeading" } } ] diff --git a/conf.d/project/etc/sources-txc.json b/conf.d/project/etc/sources-txc.json index 4404d60..77bc99b 100644 --- a/conf.d/project/etc/sources-txc.json +++ b/conf.d/project/etc/sources-txc.json @@ -6,11 +6,13 @@ "api": "txc", "info": "Use TXC demo binding as signals provider", "init": { - "function": "api://txc/start", + "uri": "api://txc", + "function": "start", "args": {"filename": "var/nyc-downtown-crosstown.json"} }, "getSignals": { - "function": "api://txc/subscribe" + "uri": "api://txc", + "function": "subscribe" } } ] diff --git a/conf.d/project/etc/sources.json b/conf.d/project/etc/sources.json index c01ebd1..35d62a8 100644 --- a/conf.d/project/etc/sources.json +++ b/conf.d/project/etc/sources.json @@ -6,7 +6,8 @@ "api": "low-can", "info": "Low level binding to handle CAN bus communications", "getSignals": { - "function": "plugin://low-can-callbacks/subscribeToLow" + "uri": "plugin://low-can-callbacks", + "function": "subscribeToLow" } }, { @@ -14,7 +15,8 @@ "api": "gps", "info": "Low level binding which retrieve Satellite positionning values", "init": { - "function": "api://gps/subscribe", + "uri": "api://gps", + "function": "subscribe", "args": { "value": "location" } |