2 static const char _afb_description_v2_UNICENS[] =
3 "{\"openapi\":\"3.0.0\",\"$schema\":\"http:iot.bzh/download/openapi/schem"
4 "a-3.0/default-schema.json\",\"info\":{\"description\":\"\",\"title\":\"u"
5 "cs2\",\"version\":\"1.0\",\"x-binding-c-generator\":{\"api\":\"UNICENS\""
6 ",\"version\":2,\"prefix\":\"ucs2_\",\"postfix\":\"\",\"start\":null,\"on"
7 "event\":null,\"preinit\":null,\"init\":\"ucs2_initbinding\",\"scope\":\""
8 "\",\"private\":false}},\"servers\":[{\"url\":\"ws://{host}:{port}/api/mo"
9 "nitor\",\"description\":\"Unicens2 API.\",\"variables\":{\"host\":{\"def"
10 "ault\":\"localhost\"},\"port\":{\"default\":\"1234\"}},\"x-afb-events\":"
11 "[{\"$ref\":\"#/components/schemas/afb-event\"}]}],\"components\":{\"sche"
12 "mas\":{\"afb-reply\":{\"$ref\":\"#/components/schemas/afb-reply-v2\"},\""
13 "afb-event\":{\"$ref\":\"#/components/schemas/afb-event-v2\"},\"afb-reply"
14 "-v2\":{\"title\":\"Generic response.\",\"type\":\"object\",\"required\":"
15 "[\"jtype\",\"request\"],\"properties\":{\"jtype\":{\"type\":\"string\",\""
16 "const\":\"afb-reply\"},\"request\":{\"type\":\"object\",\"required\":[\""
17 "status\"],\"properties\":{\"status\":{\"type\":\"string\"},\"info\":{\"t"
18 "ype\":\"string\"},\"token\":{\"type\":\"string\"},\"uuid\":{\"type\":\"s"
19 "tring\"},\"reqid\":{\"type\":\"string\"}}},\"response\":{\"type\":\"obje"
20 "ct\"}}},\"afb-event-v2\":{\"type\":\"object\",\"required\":[\"jtype\",\""
21 "event\"],\"properties\":{\"jtype\":{\"type\":\"string\",\"const\":\"afb-"
22 "event\"},\"event\":{\"type\":\"string\"},\"data\":{\"type\":\"object\"}}"
23 "}},\"x-permissions\":{\"config\":{\"permission\":\"urn:AGL:permission:UN"
24 "ICENS:public:initialise\"},\"monitor\":{\"permission\":\"urn:AGL:permiss"
25 "ion:UNICENS:public:monitor\"}},\"responses\":{\"200\":{\"description\":\""
26 "A complex object array response\",\"content\":{\"application/json\":{\"s"
27 "chema\":{\"$ref\":\"#/components/schemas/afb-reply\"}}}}}},\"paths\":{\""
28 "/listconfig\":{\"description\":\"List Config Files\",\"get\":{\"x-permis"
29 "sions\":{\"$ref\":\"#/components/x-permissions/config\"},\"parameters\":"
30 "[{\"in\":\"query\",\"name\":\"cfgpath\",\"required\":false,\"schema\":{\""
31 "type\":\"string\"}}],\"responses\":{\"200\":{\"$ref\":\"#/components/res"
32 "ponses/200\"}}}},\"/initialise\":{\"description\":\"configure Unicens2 l"
33 "ib from NetworkConfig.XML.\",\"get\":{\"x-permissions\":{\"$ref\":\"#/co"
34 "mponents/x-permissions/config\"},\"parameters\":[{\"in\":\"query\",\"nam"
35 "e\":\"filename\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\""
36 "responses\":{\"200\":{\"$ref\":\"#/components/responses/200\"}}}},\"/sub"
37 "scribe\":{\"description\":\"Subscribe to UNICENS Events.\",\"get\":{\"x-"
38 "permissions\":{\"$ref\":\"#/components/x-permissions/monitor\"},\"respon"
39 "ses\":{\"200\":{\"$ref\":\"#/components/responses/200\"}}}},\"/writei2c\""
40 ":{\"description\":\"Writes I2C command to remote node.\",\"get\":{\"x-pe"
41 "rmissions\":{\"$ref\":\"#/components/x-permissions/monitor\"},\"paramete"
42 "rs\":[{\"in\":\"query\",\"name\":\"node\",\"required\":true,\"schema\":{"
43 "\"type\":\"integer\",\"format\":\"int32\"}},{\"in\":\"query\",\"name\":\""
44 "data\",\"required\":true,\"schema\":{\"type\":\"array\",\"format\":\"int"
45 "32\"},\"style\":\"simple\"}],\"responses\":{\"200\":{\"$ref\":\"#/compon"
46 "ents/responses/200\"}}}}}}"
49 static const struct afb_auth _afb_auths_v2_UNICENS[] = {
50 { .type = afb_auth_Permission, .text = "urn:AGL:permission:UNICENS:public:initialise" },
51 { .type = afb_auth_Permission, .text = "urn:AGL:permission:UNICENS:public:monitor" }
54 void ucs2_listconfig(struct afb_req req);
55 void ucs2_initialise(struct afb_req req);
56 void ucs2_subscribe(struct afb_req req);
57 void ucs2_writei2c(struct afb_req req);
59 static const struct afb_verb_v2 _afb_verbs_v2_UNICENS[] = {
62 .callback = ucs2_listconfig,
63 .auth = &_afb_auths_v2_UNICENS[0],
64 .info = "List Config Files",
65 .session = AFB_SESSION_NONE_V2
69 .callback = ucs2_initialise,
70 .auth = &_afb_auths_v2_UNICENS[0],
71 .info = "configure Unicens2 lib from NetworkConfig.XML.",
72 .session = AFB_SESSION_NONE_V2
76 .callback = ucs2_subscribe,
77 .auth = &_afb_auths_v2_UNICENS[1],
78 .info = "Subscribe to UNICENS Events.",
79 .session = AFB_SESSION_NONE_V2
83 .callback = ucs2_writei2c,
84 .auth = &_afb_auths_v2_UNICENS[1],
85 .info = "Writes I2C command to remote node.",
86 .session = AFB_SESSION_NONE_V2
97 const struct afb_binding_v2 afbBindingV2 = {
99 .specification = _afb_description_v2_UNICENS,
101 .verbs = _afb_verbs_v2_UNICENS,
103 .init = ucs2_initbinding,