diff options
author | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-08-29 14:55:35 +0200 |
---|---|---|
committer | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-09-04 16:53:59 +0200 |
commit | 38da977e18f4b9e9a295119b8bac194a8a87a498 (patch) | |
tree | 3da50543ce6bd03d40cb7427f3ab55cf3e358ad7 /src/main.cpp | |
parent | 7a5d735041a1390fffda46ef451d70859137a808 (diff) |
app/main: add send_event() to binding_api
* Preliminary event support - wrong names, likely wrong implementation
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index bea9f11..a768347 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -127,5 +127,17 @@ int binding_init() noexcept { #include "afb_binding_glue.inl" +// XXX implement send_event right here... +namespace wm { +void binding_api::send_event(char const *evname, json_object *payload) { + logdebug("%s: %s(%s)", __func__, evname, json_object_to_json_string(payload)); + afb_event ev = afb_daemon_make_event(evname); + int ret = afb_event_broadcast(ev, payload); + if (ret != 0) { + logdebug("afb_event_broadcast failed: %m"); + } +} +} + extern "C" const struct afb_binding_v2 afbBindingV2 = { "winman", nullptr, nullptr, winman_verbs, nullptr, binding_init, nullptr, 1}; |