aboutsummaryrefslogtreecommitdiffstats
path: root/src/platform-info-apidef.h
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-11-07 10:54:01 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2018-11-28 17:34:38 +0100
commit99914a58a2d5b2638e2c1fdac5ca74a2d247e6fa (patch)
tree18661bc142ff60e6d1e596ae6d4fc5193774f07c /src/platform-info-apidef.h
parentb0899d3e0d83457403fa6195a3448d9d6610adb6 (diff)
First simple platform-info API implementationguppy_6.99.2guppy/6.99.26.99.2
Bug-AGL: SPEC-1917 Change-Id: I300155302c9d69c6549ddabc6af53e2ad55eb18d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/platform-info-apidef.h')
-rw-r--r--src/platform-info-apidef.h64
1 files changed, 64 insertions, 0 deletions
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
+};