summaryrefslogtreecommitdiffstats
path: root/plugins/low-can.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-11-02 15:58:45 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commit6ee4db6878464642ddf9f0909748841a45b58a88 (patch)
tree4c3588d216e903174f1281b757e98816d7323afa /plugins/low-can.cpp
parented2c3d0267e3c5e1392635dacad2752de935d6b4 (diff)
Migrate to ctl-utilities library
New version of controller as a library. Loading additionnals files from each sections. Change-Id: I4f5e78d0baf9650cb8d1cc1da26f8e1fd73b792c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'plugins/low-can.cpp')
-rw-r--r--plugins/low-can.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/low-can.cpp b/plugins/low-can.cpp
index a425296..8d09eda 100644
--- a/plugins/low-can.cpp
+++ b/plugins/low-can.cpp
@@ -31,7 +31,7 @@
extern "C"
{
-CTLP_REGISTER("low-can");
+CTLP_CAPI_REGISTER("low-can");
typedef struct {
bool door;
@@ -66,15 +66,14 @@ CTLP_ONLOAD(plugin, composerHandle)
pluginCtx->pluginHandle = (struct signalCBT*)composerHandle;
pluginCtx->subscriptionBatch = json_object_new_array();
- AFB_NOTICE ("Low-can plugin: label='%s' version='%s' info='%s'",
- plugin->label,
- plugin->version,
+ AFB_NOTICE ("Low-can plugin: label='%s' info='%s'",
+ plugin->uid,
plugin->info);
return (void*)pluginCtx;
}
-CTLP_CAPI (subscribeToLow, source, argsJ, eventJ, context) {
+CTLP_CAPI (subscribeToLow, source, argsJ, eventJ) {
lowCANCtxT *pluginCtx = (lowCANCtxT*)source->context;
json_object* dependsArrayJ = nullptr, *subscribeArgsJ = nullptr, *subscribeFilterJ = nullptr, *responseJ = nullptr, *filterJ = nullptr;
const char *id = nullptr, *event = nullptr, *unit = nullptr;
@@ -125,7 +124,7 @@ CTLP_CAPI (subscribeToLow, source, argsJ, eventJ, context) {
return err;
}
-CTLP_CAPI (isOpen, source, argsJ, eventJ, context) {
+CTLP_CAPI (isOpen, source, argsJ, eventJ) {
const char *eventName = nullptr;
int eventStatus;
uint64_t timestamp;
@@ -168,7 +167,7 @@ CTLP_CAPI (isOpen, source, argsJ, eventJ, context) {
}
AFB_DEBUG("This is the situation: source:%s, args:%s, event:%s,\n fld: %s, flw: %s, frd: %s, frw: %s, rld: %s, rlw: %s, rrd: %s, rrw: %s",
- source->label,
+ source->uid,
json_object_to_json_string(argsJ),
json_object_to_json_string(eventJ),
pluginCtx->allDoorsCtx.front_left.door ? "true":"false",