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,\"init\":null,\"scope\":\"\",\"private\":false}},\"servers\""
8 ":[{\"url\":\"ws://{host}:{port}/api/monitor\",\"description\":\"Unicens2"
9 " API.\",\"variables\":{\"host\":{\"default\":\"localhost\"},\"port\":{\""
10 "default\":\"1234\"}},\"x-afb-events\":[{\"$ref\":\"#/components/schemas/"
11 "afb-event\"}]}],\"components\":{\"schemas\":{\"afb-reply\":{\"$ref\":\"#"
12 "/components/schemas/afb-reply-v2\"},\"afb-event\":{\"$ref\":\"#/componen"
13 "ts/schemas/afb-event-v2\"},\"afb-reply-v2\":{\"title\":\"Generic respons"
14 "e.\",\"type\":\"object\",\"required\":[\"jtype\",\"request\"],\"properti"
15 "es\":{\"jtype\":{\"type\":\"string\",\"const\":\"afb-reply\"},\"request\""
16 ":{\"type\":\"object\",\"required\":[\"status\"],\"properties\":{\"status"
17 "\":{\"type\":\"string\"},\"info\":{\"type\":\"string\"},\"token\":{\"typ"
18 "e\":\"string\"},\"uuid\":{\"type\":\"string\"},\"reqid\":{\"type\":\"str"
19 "ing\"}}},\"response\":{\"type\":\"object\"}}},\"afb-event-v2\":{\"type\""
20 ":\"object\",\"required\":[\"jtype\",\"event\"],\"properties\":{\"jtype\""
21 ":{\"type\":\"string\",\"const\":\"afb-event\"},\"event\":{\"type\":\"str"
22 "ing\"},\"data\":{\"type\":\"object\"}}}},\"x-permissions\":{\"config\":{"
23 "\"permission\":\"urn:AGL:permission:UNICENS:public:initialise\"},\"monit"
24 "or\":{\"permission\":\"urn:AGL:permission:UNICENS:public:monitor\"}},\"r"
25 "esponses\":{\"200\":{\"description\":\"A complex object array response\""
26 ",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/"
27 "schemas/afb-reply\"}}}}}},\"paths\":{\"/configure\":{\"description\":\"c"
28 "onfigure Unicens2 lib from NetworkConfig.XML.\",\"get\":{\"x-permissions"
29 "\":{\"$ref\":\"#/components/x-permissions/config\"},\"parameters\":[{\"i"
30 "n\":\"query\",\"name\":\"filename\",\"required\":true,\"schema\":{\"type"
31 "\":\"string\"}}],\"responses\":{\"200\":{\"$ref\":\"#/components/respons"
32 "es/200\"}}}},\"/volume\":{\"description\":\"Set Master Volume.\",\"get\""
33 ":{\"x-permissions\":{\"$ref\":\"#/components/x-permissions/monitor\"},\""
34 "parameters\":[{\"in\":\"query\",\"name\":\"value\",\"required\":true,\"s"
35 "chema\":{\"type\":\"integer\"}}],\"responses\":{\"200\":{\"$ref\":\"#/co"
36 "mponents/responses/200\"}}}},\"/monitor\":{\"description\":\"Subscribe t"
37 "o Unicens Event.\",\"get\":{\"x-permissions\":{\"$ref\":\"#/components/x"
38 "-permissions/monitor\"},\"responses\":{\"200\":{\"$ref\":\"#/components/"
39 "responses/200\"}}}}}}"
42 static const struct afb_auth _afb_auths_v2_UNICENS[] = {
43 { .type = afb_auth_Permission, .text = "urn:AGL:permission:UNICENS:public:initialise" },
44 { .type = afb_auth_Permission, .text = "urn:AGL:permission:UNICENS:public:monitor" }
47 void ucs2_configure(struct afb_req req);
48 void ucs2_volume(struct afb_req req);
49 void ucs2_monitor(struct afb_req req);
51 static const struct afb_verb_v2 _afb_verbs_v2_UNICENS[] = {
54 .callback = ucs2_configure,
55 .auth = &_afb_auths_v2_UNICENS[0],
57 .session = AFB_SESSION_NONE_V2
61 .callback = ucs2_volume,
62 .auth = &_afb_auths_v2_UNICENS[1],
64 .session = AFB_SESSION_NONE_V2
68 .callback = ucs2_monitor,
69 .auth = &_afb_auths_v2_UNICENS[1],
71 .session = AFB_SESSION_NONE_V2
76 const struct afb_binding_v2 afbBindingV2 = {
78 .specification = _afb_description_v2_UNICENS,
80 .verbs = _afb_verbs_v2_UNICENS,