From b7dd0a6e19d5387bc8d499bd1b3a99d457fa58d9 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Mon, 25 Sep 2017 18:29:48 +0200 Subject: Enhance pointer manage and container browsing - SourceAPI now holds share_ptr of Signal - Signal are stored in a map 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 --- plugins/low-can.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'plugins/low-can.cpp') 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 -- cgit 1.2.3-korg