summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--conf.d/project/etc/control-signal-composer.json2
-rw-r--r--conf.d/project/etc/sig-demoboard.json19
-rw-r--r--conf.d/project/etc/sig-steering-wheel.json77
-rw-r--r--signal-composer-binding/source.cpp2
4 files changed, 98 insertions, 2 deletions
diff --git a/conf.d/project/etc/control-signal-composer.json b/conf.d/project/etc/control-signal-composer.json
index 0ed9fac..58f8435 100644
--- a/conf.d/project/etc/control-signal-composer.json
+++ b/conf.d/project/etc/control-signal-composer.json
@@ -25,7 +25,7 @@
}
],
"signals": {
- "files": ["sig-doors", "sig-demoboard", "sig-geoloc" ]
+ "files": [ "sig-doors", "sig-demoboard", "sig-steering-wheel", "sig-geoloc" ]
},
"sources": {
"files": "sources-basic"
diff --git a/conf.d/project/etc/sig-demoboard.json b/conf.d/project/etc/sig-demoboard.json
index bdd5e4e..bf67144 100644
--- a/conf.d/project/etc/sig-demoboard.json
+++ b/conf.d/project/etc/sig-demoboard.json
@@ -39,6 +39,25 @@
"retention":30,
"unit": "Nm",
"frequency": 1
+ },
+ {
+ "uid": "event.vehicle.speed",
+ "event": "low-can/messages.vehicle.average.speed",
+ "unit": "km/h"
+ },
+ {
+ "uid": "event.engine.speed",
+ "event": "low-can/messages.engine.speed",
+ "unit": "rpm"
+ },
+ {
+ "uid": "event.fuel.level",
+ "event": "low-can/messages.fuel.level",
+ "unit": "liters"
+ },
+ {
+ "uid": "event.fuel.level.low",
+ "event": "low-can/messages.fuel.level.low",
}
]
}
diff --git a/conf.d/project/etc/sig-steering-wheel.json b/conf.d/project/etc/sig-steering-wheel.json
new file mode 100644
index 0000000..6c03f73
--- /dev/null
+++ b/conf.d/project/etc/sig-steering-wheel.json
@@ -0,0 +1,77 @@
+{
+ "$schema": "http://iot.bzh/download/public/schema/json/signal-composer-schema.json",
+ "signals": [
+ {
+ "uid": "event.media.previous",
+ "event": "low-can/messages.steering_wheel.previous"
+ },
+ {
+ "uid": "event.media.next",
+ "event": "low-can/messages.steering_wheel.next"
+ },
+ {
+ "uid": "event.media.mode",
+ "event": "low-can/messages.steering_wheel.mode"
+ },
+ {
+ "uid": "event.volume.up",
+ "event": "low-can/messages.steering_wheel.volume.up"
+ },
+ {
+ "uid": "event.volume.down",
+ "event": "low-can/messages.steering_wheel.volume.down"
+ },
+ {
+ "uid": "event.volume.mute",
+ "event": "low-can/messages.steering_wheel.volume.mute"
+ },
+ {
+ "uid": "event.phone.call",
+ "event": "low-can/messages.steering_wheel.phone.call"
+ },
+ {
+ "uid": "event.phone.hangup",
+ "event": "low-can/messages.steering_wheel.phone.hangup"
+ },
+ {
+ "uid": "event.cruise.enable",
+ "event": "low-can/messages.steering_wheel.cruise.enable"
+ },
+ {
+ "uid": "event.cruise.resume",
+ "event": "low-can/messages.steering_wheel.cruise.resume"
+ },
+ {
+ "uid": "event.cruise.set",
+ "event": "low-can/messages.steering_wheel.cruise.set"
+ },
+ {
+ "uid": "event.cruise.cancel",
+ "event": "low-can/messages.steering_wheel.cruise.cancel"
+ },
+ {
+ "uid": "event.cruise.limit",
+ "event": "low-can/messages.steering_wheel.cruise.limit"
+ },
+ {
+ "uid": "event.cruise.distance",
+ "event": "low-can/messages.steering_wheel.cruise.distance"
+ },
+ {
+ "uid": "event.lane_departure_warning.enable",
+ "event": "low-can/messages.steering_wheel.lane_departure_warning"
+ },
+ {
+ "uid": "event.info",
+ "event": "low-can/messages.steering_wheel.info"
+ },
+ {
+ "uid": "event.voice",
+ "event": "low-can/messages.steering_wheel.voice"
+ },
+ {
+ "uid": "event.horn",
+ "event": "low-can/messages.steering_wheel.horn"
+ }
+ ]
+}
diff --git a/signal-composer-binding/source.cpp b/signal-composer-binding/source.cpp
index 4b21443..f265f40 100644
--- a/signal-composer-binding/source.cpp
+++ b/signal-composer-binding/source.cpp
@@ -147,7 +147,7 @@ void SourceAPI::addSignal(const std::string& id, const std::string& event, std::
{
std::shared_ptr<Signal> sig = std::make_shared<Signal>(id, event, depends, unit, metadata, retention, frequency, onReceived, getSignalsArgs);
- if(onReceived && ! event.empty())
+ if(!event.empty())
afb_api_event_handler_add(afbBindingV3root, event.c_str(), SourceAPI::onSignalEvents, (void*)sig.get());
newSignalsM_[id] = sig;