From 99914a58a2d5b2638e2c1fdac5ca74a2d247e6fa Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 7 Nov 2018 10:54:01 +0100 Subject: First simple platform-info API implementation Bug-AGL: SPEC-1917 Change-Id: I300155302c9d69c6549ddabc6af53e2ad55eb18d Signed-off-by: Romain Forlot --- src/platform-info-apidef.h | 64 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/platform-info-apidef.h (limited to 'src/platform-info-apidef.h') diff --git a/src/platform-info-apidef.h b/src/platform-info-apidef.h new file mode 100644 index 0000000..c09da63 --- /dev/null +++ b/src/platform-info-apidef.h @@ -0,0 +1,64 @@ +static const struct afb_auth _afb_auths_platform_info[] = { + { .type = afb_auth_Permission, .text = "urn:AGL:permission::platform:info:get " }, + { .type = afb_auth_Permission, .text = "urn:AGL:permission::platform:info:set " } +}; + + void afv_get(afb_req_t req); + void afv_set(afb_req_t req); + void afv_subscribe(afb_req_t req); + void afv_unsubscribe(afb_req_t req); + +static const struct afb_verb_v3 _afb_verbs_platform_info[] = { + { + .verb = "get", + .callback = afv_get, + .auth = &_afb_auths_platform_info[0], + .info = "Get a platform data.", + .session = AFB_SESSION_NONE + }, + { + .verb = "set", + .callback = afv_set, + .auth = &_afb_auths_platform_info[1], + .info = "Set a platform data.", + .session = AFB_SESSION_NONE + }, + { + .verb = "unsubscribe", + .callback = afv_unsubscribe, + .auth = NULL, + .info = "Unsubscribe to changes (hotplug event, failures, ...)", + .session = AFB_SESSION_NONE + }, + { + .verb = "subscribe", + .callback = afv_subscribe, + .auth = NULL, + .info = "Subscribe to changes (hotplug event, failures, ...)", + .session = AFB_SESSION_NONE + }, + { + .verb = NULL, + .callback = NULL, + .auth = NULL, + .info = NULL, + .session = 0 + } +}; + +int init(afb_api_t api); + +const struct afb_binding_v3 afbBindingV3 = { + .api = "platform-info", + .specification = NULL, + .info = "", + .verbs = _afb_verbs_platform_info, + .preinit = NULL, + .init = init, + .onevent = NULL, + .userdata = NULL, + .provide_class = NULL, + .require_class = NULL, + .require_api = NULL, + .noconcurrency = 0 +}; -- cgit 1.2.3-korg