X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=inline;f=src%2Fafb-api-dbus.c;h=905c723d75f1942165938cd4bb8cd9e77a536518;hb=6518887513840471ea9c5af7e534787717e6bd82;hp=eda7985f50fc5b056e75c27cc44345d6374059e6;hpb=741d4e0505c588f38a64350c1d3c53c74f7ac22c;p=src%2Fapp-framework-binder.git diff --git a/src/afb-api-dbus.c b/src/afb-api-dbus.c index eda7985f..905c723d 100644 --- a/src/afb-api-dbus.c +++ b/src/afb-api-dbus.c @@ -36,6 +36,7 @@ #include "afb-api-so.h" #include "afb-context.h" #include "afb-evt.h" +#include "afb-subcall.h" #include "verbose.h" static const char DEFAULT_PATH_PREFIX[] = "/org/agl/afb/api/"; @@ -446,6 +447,18 @@ static void dbus_req_send(struct dbus_req *dreq, const char *buffer, size_t size dbus_req_reply(dreq, RETRAW, buffer, ""); } +static int dbus_req_subscribe(struct dbus_req *dreq, struct afb_event event) +{ + return -1; +} + +static int dbus_req_unsubscribe(struct dbus_req *dreq, struct afb_event event) +{ + return -1; +} + +static void dbus_req_subcall(struct dbus_req *dreq, const char *api, const char *verb, struct json_object *args, void (*callback)(void*, int, struct json_object*), void *closure); + const struct afb_req_itf afb_api_dbus_req_itf = { .json = (void*)dbus_req_json, .get = (void*)dbus_req_get, @@ -456,9 +469,19 @@ const struct afb_req_itf afb_api_dbus_req_itf = { .context_get = (void*)afb_context_get, .context_set = (void*)afb_context_set, .addref = (void*)dbus_req_addref, - .unref = (void*)dbus_req_unref + .unref = (void*)dbus_req_unref, + .session_close = (void*)afb_context_close, + .session_set_LOA = (void*)afb_context_change_loa, + .subscribe = (void*)dbus_req_subscribe, + .unsubscribe = (void*)dbus_req_unsubscribe, + .subcall = (void*)dbus_req_subcall }; +static void dbus_req_subcall(struct dbus_req *dreq, const char *api, const char *verb, struct json_object *args, void (*callback)(void*, int, struct json_object*), void *closure) +{ + afb_subcall(&dreq->context, api, verb, args, callback, closure, (struct afb_req){ .itf = &afb_api_dbus_req_itf, .closure = dreq }); +} + /******************* server part **********************************/ /* called when the object for the service is called */