aboutsummaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal-composer.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-28 20:10:13 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commit6075d60a3d8368cdfdece93abadd2bc9d8110e76 (patch)
treef7cbc3358276aedb6e950f77b906581197107d80 /signal-composer-binding/signal-composer.cpp
parentcd1dcf7b36c6c5223806b8eee9a5a5875b890cbf (diff)
Builtin plugin integration
Change-Id: I285c666c9ac77b6c1efb56406ce0a9cf33ec140f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal-composer.cpp')
-rw-r--r--signal-composer-binding/signal-composer.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/signal-composer-binding/signal-composer.cpp b/signal-composer-binding/signal-composer.cpp
index ab5c63c..4218bae 100644
--- a/signal-composer-binding/signal-composer.cpp
+++ b/signal-composer-binding/signal-composer.cpp
@@ -123,6 +123,27 @@ CtlActionT* Composer::convert2Action(const std::string& name, json_object* actio
"label", name.c_str(),
"callback", callbackJ);
}
+ else if(startsWith(function, "builtin://"))
+ {
+ std::string uri = std::string(function).substr(10);
+ char b[8] = "builtin";
+ char* label = strncat(b , name.c_str(), name.size());
+ std::vector<std::string> uriV = Composer::parseURI(uri);
+ if(uriV.size() > 1) {AFB_WARNING("Too many thing specified. Uri has to be like: builtin://<builtin-function-name>");}
+ return new CtlActionT {
+ CTL_TYPE_CB,
+ nullptr,
+ uriV[0].c_str(),
+ functionArgsJ,
+ Signal::defaultOnReceivedCB,
+ CtlSourceT{
+ label,
+ nullptr,
+ {nullptr, nullptr},
+ nullptr,
+ }
+ };
+ }
else
{
AFB_ERROR("Wrong function uri specified. You have to specified 'lua://', 'plugin://' or 'api://'. (%s)", function);