summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-25 18:29:48 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commitb7dd0a6e19d5387bc8d499bd1b3a99d457fa58d9 (patch)
tree0d1a26964435e8f91b96713e2b5beb3c1e94d0b2 /plugins
parentdb45a68715c07e6b8fe35e322ddcbbc6c473cb2b (diff)
Enhance pointer manage and container browsing
- SourceAPI now holds share_ptr of Signal - Signal are stored in a map<string,signal> that change way to browse the signals - subscribed property included in SourceAPI. - Clean old code - renaming struct SignalValue->signalValue Change-Id: Ic5c28296ddd7197c6562e12fbc91c504c1cc0b4d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/low-can.cpp11
-rw-r--r--plugins/lua2c-interface.c2
2 files changed, 6 insertions, 7 deletions
diff --git a/plugins/low-can.cpp b/plugins/low-can.cpp
index 62f10f3..c4f79d2 100644
--- a/plugins/low-can.cpp
+++ b/plugins/low-can.cpp
@@ -112,7 +112,6 @@ CTLP_CAPI (subscribeToLow, source, argsJ, eventJ, context) {
AFB_ERROR("Error building subscription query object");
return err;
}
-
json_object_array_add(pluginCtx->subscriptionBatch, subscribeArgsJ);
}
else
@@ -142,29 +141,29 @@ CTLP_CAPI (isOpen, source, argsJ, eventJ, context) {
return -1;
}
- struct SignalValue value = {
+ struct signalValue value = {
.hasBool = true, .boolVal = eventStatus,
.hasNum = false, .numVal = 0,
.hasStr = false, .strVal = std::string()
};
if(strcasestr(eventName, "front_left"))
{
- pluginCtx->pluginHandle->setSignalValue(eventName,(long long int)timestamp, value);
+ pluginCtx->pluginHandle->setsignalValue(eventName,(long long int)timestamp, value);
setDoor(&pluginCtx->allDoorsCtx.front_left, eventName, eventStatus);
}
else if(strcasestr(eventName, "front_right"))
{
- pluginCtx->pluginHandle->setSignalValue(eventName,(long long int)timestamp, value);
+ pluginCtx->pluginHandle->setsignalValue(eventName,(long long int)timestamp, value);
setDoor(&pluginCtx->allDoorsCtx.front_right, eventName, eventStatus);
}
else if(strcasestr(eventName, "rear_left"))
{
- pluginCtx->pluginHandle->setSignalValue(eventName,(long long int)timestamp, value);
+ pluginCtx->pluginHandle->setsignalValue(eventName,(long long int)timestamp, value);
setDoor(&pluginCtx->allDoorsCtx.rear_left, eventName, eventStatus);
}
else if(strcasestr(eventName, "rear_right"))
{
- pluginCtx->pluginHandle->setSignalValue(eventName,(long long int)timestamp, value);
+ pluginCtx->pluginHandle->setsignalValue(eventName,(long long int)timestamp, value);
setDoor(&pluginCtx->allDoorsCtx.rear_right, eventName, eventStatus);
}
else
diff --git a/plugins/lua2c-interface.c b/plugins/lua2c-interface.c
index dd69b11..0bff8d6 100644
--- a/plugins/lua2c-interface.c
+++ b/plugins/lua2c-interface.c
@@ -48,7 +48,7 @@ CTLP_ONLOAD(plugin, handle) {
return (void*)pluginCtx;
}
-CTLP_LUA2C (ssetSignalValue, label, argsJ)
+CTLP_LUA2C (_setsignalValue, label, argsJ)
{
AFB_NOTICE("label: %s, argsJ: %s", label, json_object_to_json_string(argsJ));
return 0;